From b6ff5fd2837bed63b09798e4fa187b169b7dcdc2 Mon Sep 17 00:00:00 2001 From: steviez Date: Thu, 9 Apr 2020 11:20:35 -0500 Subject: multi_usrp_rfnoc: Manually pass sample rate to ddc/duc This adds (and calls) methods to manually pass radio block sample rate to the input/output properties of the ddc/duc during creation of the multi_usrp_rfnoc object. The ddc/duc require this information in order to return valid, possible output/input sample rates in get_rx_rates()/get_tx_rates(). Before, the ddc/duc wouldn't have this rate until the rfnoc_graph had been connected and committed, which happens in get_rx_stream()/get_tx_stream(). Thus, this fixes an issue where a user was unable to query possible sample rates prior to specifying a sample rate and creating a stream. --- host/include/uhd/rfnoc/ddc_block_control.hpp | 7 +++++++ host/include/uhd/rfnoc/duc_block_control.hpp | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'host/include') diff --git a/host/include/uhd/rfnoc/ddc_block_control.hpp b/host/include/uhd/rfnoc/ddc_block_control.hpp index 88c7ce106..f4197dd55 100644 --- a/host/include/uhd/rfnoc/ddc_block_control.hpp +++ b/host/include/uhd/rfnoc/ddc_block_control.hpp @@ -89,6 +89,13 @@ public: */ virtual double get_input_rate(const size_t chan) const = 0; + /*! Manually set the sampling rate at this block's input + * + * \param rate The requested rate + * \param chan The channel for which the rate is being set + */ + virtual void set_input_rate(const double rate, const size_t chan) = 0; + /*! Return the sampling rate at this block's output * * This is equivalent to calling get_input_rate() divided by the decimation. diff --git a/host/include/uhd/rfnoc/duc_block_control.hpp b/host/include/uhd/rfnoc/duc_block_control.hpp index fcf15068e..4cf8a8fb8 100644 --- a/host/include/uhd/rfnoc/duc_block_control.hpp +++ b/host/include/uhd/rfnoc/duc_block_control.hpp @@ -97,6 +97,13 @@ public: */ virtual double get_output_rate(const size_t chan) const = 0; + /*! Manually set the sampling rate at this block's output + * + * \param rate The requested rate + * \param chan The channel for which the rate is being set + */ + virtual void set_output_rate(const double rate, const size_t chan) = 0; + /*! Return a range of valid input rates, based on the current output rate * * Note the return value is only valid as long as the output rate does not -- cgit v1.2.3