From 26ff29348931389f7c7e8d78bc4c3630dfc8d342 Mon Sep 17 00:00:00 2001 From: steviez Date: Wed, 8 Apr 2020 02:10:02 -0500 Subject: multi_usrp_rfnoc: Fix get_rx/tx_rates() This replaces incorrect code with the proper function calls to retrieve the range of possible sample rates. --- host/lib/usrp/multi_usrp_rfnoc.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp index 11d5f28d1..0c716c0a3 100644 --- a/host/lib/usrp/multi_usrp_rfnoc.cpp +++ b/host/lib/usrp/multi_usrp_rfnoc.cpp @@ -1076,13 +1076,12 @@ public: meta_range_t get_rx_rates(size_t chan) { + std::lock_guard l(_graph_mutex); auto rx_chain = _get_rx_chan(chan); - return (rx_chain.ddc) - ? make_overall_tune_range( - rx_chain.radio->get_rx_frequency_range(rx_chain.block_chan), - rx_chain.ddc->get_frequency_range(rx_chain.block_chan), - rx_chain.radio->get_rx_bandwidth(rx_chain.block_chan)) - : rx_chain.radio->get_rx_frequency_range(rx_chain.block_chan); + if (rx_chain.ddc) { + return rx_chain.ddc->get_output_rates(rx_chain.block_chan); + } + return rx_chain.radio->get_rate_range(); } tune_result_t set_rx_freq(const tune_request_t& tune_request, size_t chan) @@ -1655,13 +1654,12 @@ public: meta_range_t get_tx_rates(size_t chan) { + std::lock_guard l(_graph_mutex); auto tx_chain = _get_tx_chan(chan); - return (tx_chain.duc) - ? make_overall_tune_range( - tx_chain.radio->get_tx_frequency_range(tx_chain.block_chan), - tx_chain.duc->get_frequency_range(tx_chain.block_chan), - tx_chain.radio->get_tx_bandwidth(tx_chain.block_chan)) - : tx_chain.radio->get_tx_frequency_range(tx_chain.block_chan); + if (tx_chain.duc) { + return tx_chain.duc->get_input_rates(tx_chain.block_chan); + } + return tx_chain.radio->get_rate_range(); } tune_result_t set_tx_freq(const tune_request_t& tune_request, size_t chan) -- cgit v1.2.3