aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2013-02-19 21:54:30 -0800
committerJosh Blum <josh@joshknows.com>2013-02-19 21:54:30 -0800
commit11a213877727ee0b32e55b6adfe0b14a714ca843 (patch)
tree15136dd85bfa47ad526a9ef584f03da789ccd64d
parenta43ec4195a966c88f8841a0e7fb4d5b6ecd115af (diff)
downloaduhd-11a213877727ee0b32e55b6adfe0b14a714ca843.tar.gz
uhd-11a213877727ee0b32e55b6adfe0b14a714ca843.tar.bz2
uhd-11a213877727ee0b32e55b6adfe0b14a714ca843.zip
b100: additional flushing when rx streamer created
-rw-r--r--host/lib/transport/usb_zero_copy_wrapper.cpp8
-rw-r--r--host/lib/usrp/b100/io_impl.cpp4
2 files changed, 12 insertions, 0 deletions
diff --git a/host/lib/transport/usb_zero_copy_wrapper.cpp b/host/lib/transport/usb_zero_copy_wrapper.cpp
index d04244ca9..ec5667020 100644
--- a/host/lib/transport/usb_zero_copy_wrapper.cpp
+++ b/host/lib/transport/usb_zero_copy_wrapper.cpp
@@ -176,6 +176,14 @@ public:
}
managed_recv_buffer::sptr get_recv_buff(double timeout){
+ //lazy flush mechanism - negative timeout
+ if (timeout < 0.0)
+ {
+ _last_recv_buff.reset();
+ while (_internal_zc->get_recv_buff()){}
+ return managed_recv_buffer::sptr();
+ }
+
//attempt to get a managed recv buffer
if (not _last_recv_buff){
_last_recv_buff = _internal_zc->get_recv_buff(timeout);
diff --git a/host/lib/usrp/b100/io_impl.cpp b/host/lib/usrp/b100/io_impl.cpp
index 723756dcc..bcf712cd9 100644
--- a/host/lib/usrp/b100/io_impl.cpp
+++ b/host/lib/usrp/b100/io_impl.cpp
@@ -153,6 +153,10 @@ rx_streamer::sptr b100_impl::get_rx_stream(const uhd::stream_args_t &args_){
id.num_outputs = 1;
my_streamer->set_converter(id);
+ //flush stuff
+ _data_transport->get_recv_buff(-1.0); //negative flushes!!
+ _recv_demuxer = recv_packet_demuxer::make(_data_transport, _rx_dsps.size(), B100_RX_SID_BASE);
+
//bind callbacks for the handler
for (size_t chan_i = 0; chan_i < args.channels.size(); chan_i++){
const size_t dsp = args.channels[chan_i];