aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tsou <ttsou@vt.edu>2012-07-23 13:19:13 -0400
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2013-06-24 01:46:10 +0400
commit00ed1441a1a0edfc8e6ba7450475982464d6e4e0 (patch)
tree185b3a2f854218f2d69359442287662445acfac8
parent8d804a4cd809dfd59fd60b4ee9c36f4230cfc4d7 (diff)
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 <ttsou@vt.edu>
-rw-r--r--Transceiver52M/UHDDevice.cpp12
1 files 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);
}