From 632dc63810dae60e89f0e6f1d3149a05733c6116 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 26 Mar 2018 11:52:50 -0700 Subject: rfnoc radio: Improve warning for too many samples requested When doing a NUM_SAMPS_AND_DONE stream command, there is a limit to the number of samples that can be requested (as of now, there's 28 bits for this counter). When the number was exceeded, the previous error message was not helpful. Note that the DDC block will multiply the number of requested samples by the decimation rate. This means the number of samples requested from the radio is higher than the number of samples requested by the application. --- host/lib/rfnoc/radio_ctrl_impl.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/host/lib/rfnoc/radio_ctrl_impl.cpp b/host/lib/rfnoc/radio_ctrl_impl.cpp index a151b2690..643a6e745 100644 --- a/host/lib/rfnoc/radio_ctrl_impl.cpp +++ b/host/lib/rfnoc/radio_ctrl_impl.cpp @@ -360,7 +360,17 @@ void radio_ctrl_impl::issue_stream_cmd( "channel. Skipping."; return; } - UHD_ASSERT_THROW(stream_cmd.num_samps <= 0x0fffffff); + constexpr size_t max_num_samps = 0x0fffffff; + if (stream_cmd.num_samps > max_num_samps) { + UHD_LOG_ERROR("RFNOC RADIO", + "Requesting too many samples in a single burst! " + "Requested " + std::to_string(stream_cmd.num_samps) + ", maximum " + "is " + std::to_string(max_num_samps) + "."); + UHD_LOG_INFO("RFNOC RADIO", + "Note that a decimation block will increase the number of samples " + "per burst. Your application may have requested fewer samples."); + throw uhd::value_error("Requested too many samples in a single burst."); + } _continuous_streaming[chan] = (stream_cmd.stream_mode == stream_cmd_t::STREAM_MODE_START_CONTINUOUS); -- cgit v1.2.3