laforge
/
openbts-osmo
Archived
1
0
Fork 0

uhd: temporary fix for lingering packet bug

Certain chipsets (e.g. RTL8168) have issues with the
initial packet of samples at that start of a UHD
receive stream resulting in timestamp errors shortly
after start. This temporary patch forces a receive
during init to clear any lingering errant packets.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>
This commit is contained in:
Thomas Tsou 2011-02-04 17:01:00 -05:00
parent 5ed92311dc
commit f5e4628f1f
1 changed files with 18 additions and 0 deletions

View File

@ -270,6 +270,24 @@ bool UHDDevice::open()
usrpDevice->set_clock_config(clock_config);
// Flush buffers for lingering packet on some NICs
uhd::stream_cmd_t cmd =
uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE;
cmd.num_samps = 1;
cmd.stream_now = true;
usrpDevice->issue_stream_cmd(cmd);
uhd::rx_metadata_t md;
uint32_t recvBuf[recvSamplesPerPacket];
usrpDevice->get_device()->recv(
(void*)recvBuf,
recvSamplesPerPacket,
md,
uhd::io_type_t::COMPLEX_INT16,
uhd::device::RECV_MODE_ONE_PACKET);
// Print configuration
LOG(INFO) << usrpDevice->get_pp_string();