From be809f68036a1d5653fee2c74bb10e66c0b31269 Mon Sep 17 00:00:00 2001 From: Thomas Tsou Date: Mon, 23 Jul 2012 13:19:13 -0400 Subject: [PATCH] umtrx: flush any possible garbage bursts at start In certain cases (higher sample-per-symbol counts), there is some sensitivity to either timeouts or bad metadata on the first packet. The first packet sets the transceiver clock, so this is essential. As a workaround, drop the first 50 packets to guarantee that we get a packet with a valid timestamp Signed-off-by: Thomas Tsou --- Transceiver52M/UHDDevice.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index c725696..f3bfeab 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -552,11 +552,13 @@ void uhd_device::restart(uhd::time_spec_t ts) uhd::rx_metadata_t md; uint32_t buff[rx_spp]; - usrp_dev->get_device()->recv(buff, - rx_spp, - md, - uhd::io_type_t::COMPLEX_INT16, - uhd::device::RECV_MODE_ONE_PACKET); + for (int i = 0; i < 50; i++) { + usrp_dev->get_device()->recv(buff, + rx_spp, + md, + uhd::io_type_t::COMPLEX_INT16, + uhd::device::RECV_MODE_ONE_PACKET); + } init_rd_ts = convert_time(md.time_spec, actual_smpl_rt); }