[USRP-users] B210 Re-tuning in rx_timed_samples causes timeout after fixed number of samples

Patrick Sathyanathan wpats at hotmail.com
Sat Jul 18 21:24:33 EDT 2015


Hi,

I modified the rx_timed_samples example to measure retuning time on my B210. I added the following function to retune as in the UHD manual:

void retune(uhd::usrp::multi_usrp::sptr usrp, double frequency)
{
  uhd::tune_request_t tune_req(frequency, 0);
  tune_req.args = uhd::device_addr_t("mode_n=integer");
  boost::timer my_timer;
  usrp->set_rx_freq(tune_req);
  while (not usrp->get_rx_sensor("lo_locked").to_bool()) {
    //sleep for a short time in milliseconds
    boost::this_thread::sleep(boost::posix_time::milliseconds(10));
  }
  double lo_lock_time = my_timer.elapsed();
  printf("Retune to %g time = %g ms\n", frequency, lo_lock_time*1000);
}

And before the while loop in the main function:

    double frequency = 100e6;
    double increment = 16e6;
    retune(usrp, frequency);
    frequency += increment;

and at the end of the while loop:

        retune(usrp, frequency);
        frequency += increment;

When I run the sample with: "rx_timed_samples --nsamps 10000000"
I get the following timeout error after exactly 80169 samples. The last few lines of the output are:

Received packet: 2044 samples, 1 full secs, 0.512107 frac secs
Retune to 7.08e+08 time = 1.021 ms
Received packet: 2044 samples, 1 full secs, 0.512434 frac secs
Retune to 7.24e+08 time = 1.315 ms
Received packet: 453 samples, 1 full secs, 0.512761 frac secs
Retune to 7.4e+08 time = 1.16 ms
OReceive timeout before all samples received...

Done!

This happens every time I run it after exactly the same number of samples. I have tried increasing the timeout value to 0.3 from 0.1 but that doesn't work.

My UHD version is: linux; GNU C++ version 4.8.2; Boost_105400; UHD_003.009.git-186-geb9cfef4

What is going on and how can I fix it ?

Thanks,

--Patrick

 		 	   		  



More information about the USRP-users mailing list