|Subject:||[Discuss-gnuradio] UHD recv timestamp differs from stream command time spec|
|Date:||Thu, 02 Sep 2010 12:39:09 -0500|
I'm using a USRP2 with UHD and starting a receive a short time in the future. I have an external reference and PPS. Below is the pertinent code, slightly simplified.
The timestamp returned in the metadata by recv is always off a little from the time I requested in the stream command. The amount it is off seems to be consistent and related to the sampling rate. For 25 Msps, it's always off by 230 nanoseconds, for 12.5 Msps, it's off by 270 nanoseconds, for 6.25 Msps, it's off by 350 nanoseconds. If I receive one packet at a time using RECV_MODE_ONE_PACKET, the first packet's metadata is off by the same amount.
I'm using the latest gnuradio and uhd (the one with USRP1 support).
Should I expect the timestamp in the received metadata to match the requested time in the stream command?
// set_clock_config elided.
uhd::stream_cmd_t streamCommand(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE); streamCommand.num_samps = _buffer.size(); streamCommand.stream_now = false; streamCommand.time_spec = startingTime; _usrp->issue_stream_cmd(streamCommand);
size_t numReceived = _device->recv(&_buffer, _buffer.size(), metadata, uhd::io_type_t::COMPLEX_INT16, uhd::device::RECV_MODE_FULL_BUFF); // Error checking elided. fprintf (stdout, "Off by %g nanoseconds.\n", (metadata.time_spec - startingTime).get_real_secs()*1e9);
|[Prev in Thread]||Current Thread||[Next in Thread]|