From 1fa617045c7c3ffb345ea595e4ca040219df9fc8 Mon Sep 17 00:00:00 2001 From: michael-west Date: Thu, 3 Dec 2020 13:02:37 -0800 Subject: RFNoC: Demoted zero sample error to warning Requesting zero samples was resulting in an error and causing applications to crash. This was a change frome previous versions of UHD. Demoted to warning so applications continue as they did before. Signed-off-by: Michael West --- host/lib/rfnoc/radio_control_impl.cpp | 5 +++-- host/lib/usrp/cores/rx_vita_core_3000.cpp | 16 +++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/host/lib/rfnoc/radio_control_impl.cpp b/host/lib/rfnoc/radio_control_impl.cpp index 61937e080..f9347b9e7 100644 --- a/host/lib/rfnoc/radio_control_impl.cpp +++ b/host/lib/rfnoc/radio_control_impl.cpp @@ -888,8 +888,9 @@ void radio_control_impl::issue_stream_cmd( if (cmd_bits == regmap::RX_CMD_FINITE) { if (stream_cmd.num_samps == 0) { - throw uhd::value_error("When requesting a finite number of samples, the " - "number of samples must be greater than zero."); + RFNOC_LOG_WARNING("Ignoring stream command for finite acquisition of " + "zero samples"); + return; } // FIXME: The num words might be different from num_samps, check the // radio width diff --git a/host/lib/usrp/cores/rx_vita_core_3000.cpp b/host/lib/usrp/cores/rx_vita_core_3000.cpp index 368ae8e0a..fb3305ce8 100644 --- a/host/lib/usrp/cores/rx_vita_core_3000.cpp +++ b/host/lib/usrp/cores/rx_vita_core_3000.cpp @@ -82,12 +82,18 @@ struct rx_vita_core_3000_impl : rx_vita_core_3000 // not setup yet!"; return; } - if ((stream_cmd.stream_mode == stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE + if (stream_cmd.stream_mode == stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE || stream_cmd.stream_mode == stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_MORE) - && stream_cmd.num_samps > 0x0fffffff) { - throw uhd::assertion_error( - "Invalid stream command: num_samps exceeds maximum value! " - "(Note: Chain multiple commands to request larger bursts)"); + { + if (stream_cmd.num_samps == 0) { + UHD_LOGGER_WARNING("CORES") << "Ignoring stream command for finite acquisition of zero samples"; + return; + } + if (stream_cmd.num_samps > 0x0fffffff) { + throw uhd::assertion_error( + "Invalid stream command: num_samps exceeds maximum value! " + "(Note: Chain multiple commands to request larger bursts)"); + } } // setup the mode to instruction flags -- cgit v1.2.3