Hello all,
I've been trying to use the set_start_time() method of usrp_source to
start my USRP N210 streaming data at a known time. The USRP has the
GPSDO fitted and the time is set automatically from this, so I can
specify an absolute time for when I want streaming to begin. I've done
this successfully using UHD in C++ programs, but I couldn't get it to
work in GNURadio. For the record, I'm using GNURadio 3.6.1 and UHD 3.4.2.
The problem seemed to be that despite calling set_start_time(),
streaming didn't start when it should, yet if I specified a start time
in the past, the program failed with an error as I'd expect, so the
start time seemed to be interpreted correctly.
Having studied gr_uhd_usrp_source.cc, I realised that the problem is
that the timeout for the first call to the recv() function in UHD is
very short so that if my start time is many seconds in the future, the
call times out and the block is done.
My question is: is this the intended behaviour and if so, how do I avoid
my flowgraph stopping before it's even started, so to speak? I could
delay starting the flowgraph until the time is sufficiently close to the
wanted start of streaming, but that sounds a bit risky.
I have made a small patch to gr_uhd_usrp_source.cc to automatically set
an initial receive timeout based on the device time when the streaming
command is issued and the wanted streaming start time. Being new to
GNURadio, I'm not sure if this is the right way to solve the problem but
I'm happy to share the patch if anyone thinks it might be useful.
I would welcome any comments and suggestions on this.
Thanks,
Andrew.
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio