[USRP-users] Timeout while streaming error while implementing receiving samples in different thread
kamal kumar jeldi
jeldi.kamal2011 at gmail.com
Wed Apr 29 02:33:38 EDT 2015
*P.S: This question might be more of related to C++ programming. But the
methodology works fine on normal compilation but does not work after
integrating with UHD.*
I am using B210 USRP Board. I am trying to implement two threads ( one for
recieving samples and another for processing received samples from other
thread ) using concurrent_queue which stores pointers to std::vector<
std::complex<T> >. Here is the declaration:
std::concurrent_queue< std::vector< std::complex<T> > * > DataQueue;
concurrent_queue is implemented thread safe using mutex and conditional
The recieving thread( one of two threads) receives samples issues
and receives the samples. So, in order to insert a pointer to new received
data, I need a new reference to each samples data for each iteration hence
I came up with this semantics,
std::vector < std::complex<T> > *buff = new std::vector<
std::complex<T> >( samples_per_buffer);
std::vector< std::complex<T> > &r = *buff //just de-referencing the
size_t num_rx_samps = rx_stream->recv(&r.front(),rx_samps_num, md,
//error checking code goes here
The processing thread, just locks this globally defined DataQueue and pops
one pointer and unlocks the queue. Processing part on this popped pointer.
In the main thread, I am starting the thread using std::thread library from
C++11 standards as,
#define DataAcquisition_args() \
usrp, format, wirefmt, spb, total_num_samps, extra_samples, total_time,
bw_summary, stats, null, enable_size_map, continue_on_bad_packet
I have compiled the code with necessary libraries and compiler switches.
The code compiles perfectly to produce the executable. but when the program
is executed, It shows the following error,
*Timeout while streaming*.
Am I making anything wrong while sending parameters to
DataAcquistionThread...??? Where am i going wrong..??
Please help me.. Thanks in advance...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the USRP-users