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.
streamCommand.num_samps = _buffer.size();
streamCommand.stream_now = false;
streamCommand.time_spec = startingTime;
size_t numReceived = _device->recv(&_buffer, _buffer.size(),
// Error checking elided.
fprintf (stdout, “Off by %g nanoseconds.\n”, (metadata.time_spec -