[USRP-users] Not dropping samples with UHD/c++ interface

Marcus D. Leech mleech at ripnet.com
Thu Oct 22 23:07:41 EDT 2015


On 10/22/2015 10:56 PM, Chris Stankevitz via USRP-users wrote:
> Hi,
>
> I want to retrieve samples using UHD in my c++ program.  I am using rx_samples_to_file.cpp as a guide.
>
> It is important for my application that I am aware when samples are dropped (due to overflow, etc).  How can I tell if data is missing?  I assume I need to be watching some or all of these values:
>
> uhd::rx_metadata_t::more_fragments
>
> uhd::rx_metadata_t::fragment_offset
>
> uhd::rx_metadata_t::start_of_burst
>
> uhd::rx_metadata_t::end_of_burst
>
> uhd::rx_metadata_t::out_of_sequence
>
> uhd::rx_metadata_t::error_code (is uhd::rx_metadata_t::error_code_t::ERROR_CODE_NONE a guarantee that I have not lost data?)
>
> uhd::rx_streamer::recv return value not equal to the "nsamps_per_buff" (is this a guarantee that data was lost or is about to be lost?)
>
>
> Also,
>
> What value should I specify for:
>
> uhd::rx_streamer::recv argument nsamps_per_buf (can I pick any value I please between 1 and 2^32-1?)
>
> uhd::rx_streamer::recv argument one_packet
>
> I read the docs at http://files.ettus.com/manual/classuhd_1_1rx__streamer.html etc but it didn't clear up the answers for me.
>
> Thank you,
>
> Chris
> _______________________________________________
> USRP-users mailing list
> USRP-users at lists.ettus.com
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
You can look at the out-of-sequence bool, and also ERROR_CODE_OVERFLOW.

Also, the metadata has timestamp information, which you can use to 
figure out how many samples you've lost, since you know how many
   samples you've processed, and what your sample-rate is.






More information about the USRP-users mailing list