Hello all,
I have 2 x310's, one is a transmitter and the other is a receiver. I have some
code I adapted from a usrp example awhile back and in testing the bounds of my
system, I am getting a ERROR_CODE_LATE_COMMAND warning after a few seconds when
trying to receive every few ms and think I may be misinterpreting at least
partially what my code is doing. I can run the code for up to 5,000ish loops so
I'm guessing something is eventually losing ground somewhere and fails
It all operates out of one .cpp program and manages a send_from_file and
recv_to_file thread.
I'm guessing the problem is on the receive side, and essentially the
recv_to_file function goes something like this:
stream_cmd.num_sampes = num_requested_samples;
stream_cmd.stream_now = false;
stream_cmd.time_spec = uhd::time_spec_t( recv_time );
rx_stream->issue_stream_cmd( stream_cmd );
while (not stop_signal_called) {
num_samples = rx_stream->recv( buffer_ptrs, sampls_per_buff, meta_data,
timeout );
total_num_samps = total_num_samps + num_samps;
///// Receive for 20 us //////
///// basically it's listening for a 20us long signal sent from
transmitter (sent at "recv_time" as well)
///// writes to outfile ////////
///// check for errors ////////
// end of transmitted file presumably reached
If ( num_total_samples >= num_requested_samples) {
num_total_samples = 0;
recv_time = recv_time + delay; // increment delay by 1 ms have
tried as high as 10 ms with no luck after about 10,000 loops or so
stream_cmd.time_spec = uhd::tune_spec_t( recv_time );
rx_stream->issue_stream_cmd( stream_cmd );
for (size_t i=0; i< buffs.size(); i++) {
buff_ptrs.push_back(&buffs[i].front());
}
}
}
I'm thinking it may just be an error in how I've interpreted the example code
and repurposed it. I don't have a strong understanding of the difference
between issue_stream_cmd() and recv() which could be part of the problem as
well. This is a simplified version of the code to explain what's happening so
please let me know if you need additional details
Thanks
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]