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/lib/rfnoc/ddc_block_control.cpp | 5 +++++ host/lib/rfnoc/duc_block_control.cpp | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'host/lib/rfnoc') diff --git a/host/lib/rfnoc/ddc_block_control.cpp b/host/lib/rfnoc/ddc_block_control.cpp index 0522991ba..abf8d1f7b 100644 --- a/host/lib/rfnoc/ddc_block_control.cpp +++ b/host/lib/rfnoc/ddc_block_control.cpp @@ -136,6 +136,11 @@ public: return _samp_rate_in.at(chan).is_valid() ? _samp_rate_in.at(chan).get() : 1.0; } + void set_input_rate(const double rate, const size_t chan) + { + set_property("samp_rate", rate, {res_source_info::INPUT_EDGE, chan}); + } + double get_output_rate(const size_t chan) const { return _samp_rate_out.at(chan).is_valid() ? _samp_rate_out.at(chan).get() : 1.0; diff --git a/host/lib/rfnoc/duc_block_control.cpp b/host/lib/rfnoc/duc_block_control.cpp index 6b052e17a..5888e300e 100644 --- a/host/lib/rfnoc/duc_block_control.cpp +++ b/host/lib/rfnoc/duc_block_control.cpp @@ -138,6 +138,11 @@ public: return _samp_rate_out.at(chan).is_valid() ? _samp_rate_out.at(chan).get() : 1.0; } + void set_output_rate(const double rate, const size_t chan) + { + set_property("samp_rate", rate, {res_source_info::OUTPUT_EDGE, chan}); + } + uhd::meta_range_t get_input_rates(const size_t chan) const { uhd::meta_range_t result; -- cgit v1.2.3