Hi,
Using UHD4.6.0 on ubuntu 22.04 with X310 (same issue on N320). Using a custom
C++ UHD application. The stream start command is timed (about 30s in the
future).
size_t num_rx_samps = rx_stream->recv(buf, len, md, 0.1);
As expected, I get a bunch of CODE_TIMEOUT while waiting for the stream to
start.
About every 3rd time the very non-TIMEOUT response I get is zero-length with
the md.error_code set to OVERFLOW. This seems like a UHD error — how could it
have overflowed without sending me any samples?
Thanks,
Eugene
----------------
uhd::rx_metadata_t md;
bool waiting_for_first_samples = true;
uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
stream_cmd.stream_now = false;
stream_cmd.time_spec = uhd::time_spec_t(start_time_s, 0.0);
rx_stream->issue_stream_cmd(stream_cmd);
auto len = rx_stream->get_max_num_samps();
zmq_sample_t buf[len]; // NOLINT
uint64_t total_samples = 0;
while (!stop){
size_t num_rx_samps = rx_stream->recv(buf, len, md, 0.1);
if (cbuf->enqueue(buf, num_rx_samps) == 2) // Aborting
break;
total_samples += num_rx_samps;
switch (md.error_code) { //handle the error codes
case uhd::rx_metadata_t::ERROR_CODE_NONE:
break;
case uhd::rx_metadata_t::ERROR_CODE_TIMEOUT:
// The data may not start flowing for a while after we come up
// However, after we get the first samples, there should never
// be a timeout. Even at the lowest sample rate of 200 kHz,
// we expect to get plenty of samples during the 0.1 timeout
if (!waiting_for_first_samples)
LOG_WARN("Timeout on ch {} at {:10.2}s, last_report at {:10.2}s",
ch, tw[ch].current_time, tw[ch].prev_report_time);
break;
case uhd::rx_metadata_t::ERROR_CODE_OVERFLOW:
overflows[ch] ++;
LOG_WARN("Overflow on ch {} at {:10.2}s, last_report at {:10.2}s. Total {}",
ch, tw[ch].current_time, tw[ch].prev_report_time, overflows[ch]);
LOG_WARN("total {}, rx {}", total_samples, num_rx_samps);
break;
default:
LOG_ERROR("Got error code on ch {} {:#x}:{}, exiting loop...",
ch, md.error_code, md.strerror());
stop = true;
break;
}
if (num_rx_samps != 0) // got some samples
waiting_for_first_samples = false;
}
---------------------
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]