From 9b6b3315afb2afd3d7c2deb74d8275d8515eafb1 Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Thu, 12 Jan 2017 15:44:24 -0800 Subject: legacy_compat: fallback to min(spp) if no user-specified spp value exists --- host/lib/rfnoc/legacy_compat.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'host/lib') diff --git a/host/lib/rfnoc/legacy_compat.cpp b/host/lib/rfnoc/legacy_compat.cpp index a396fd677..7acaa898c 100644 --- a/host/lib/rfnoc/legacy_compat.cpp +++ b/host/lib/rfnoc/legacy_compat.cpp @@ -467,17 +467,25 @@ private: // methods // If it's not provided, we provide our own spp value. const size_t args_spp = args.args.cast("spp", 0); if (dir == uhd::RX_DIRECTION) { + size_t target_spp = _rx_spp; if (args.args.has_key("spp") and args_spp != _rx_spp) { + target_spp = args_spp; + // TODO: Update flow control on the blocks + } else { for (size_t mboard = 0; mboard < _num_mboards; mboard++) { for (size_t radio = 0; radio < _num_radios_per_board; radio++) { - get_block_ctrl(mboard, RADIO_BLOCK_NAME, radio)->set_arg("spp", args_spp); + const size_t this_spp = get_block_ctrl(mboard, RADIO_BLOCK_NAME, radio)->get_arg("spp"); + target_spp = std::min(this_spp, target_spp); } } - _rx_spp = args_spp; - // TODO: Update flow control on the blocks - } else { - args.args["spp"] = str(boost::format("%d") % _rx_spp); } + for (size_t mboard = 0; mboard < _num_mboards; mboard++) { + for (size_t radio = 0; radio < _num_radios_per_board; radio++) { + get_block_ctrl(mboard, RADIO_BLOCK_NAME, radio)->set_arg("spp", target_spp); + } + } + _rx_spp = target_spp; + args.args["spp"] = str(boost::format("%d") % _rx_spp); } else { if (args.args.has_key("spp") and args_spp != _tx_spp) { _tx_spp = args_spp; @@ -574,10 +582,10 @@ private: // methods const size_t this_spp = get_block_ctrl(i, RADIO_BLOCK_NAME, k)->get_arg("spp"); if (this_spp != _rx_spp) { - throw uhd::runtime_error(str( - boost::format("[legacy compat] Radios have differing spp values: %s has %d, others have %d") + UHD_LOG << str( + boost::format("[legacy compat] Radios have differing spp values: %s has %d, others have %d. UHD will use smaller spp value for all connections. Performance might be not optimal.") % radio_block_id.to_string() % this_spp % _rx_spp - )); + ); } } } -- cgit v1.2.3