From c75edc1d4829709ab379d9ff3c0ce1e444f0dcc1 Mon Sep 17 00:00:00 2001 From: Daniel Jepson Date: Fri, 6 Apr 2018 09:33:12 -0500 Subject: uhd: fix subdevice selection order in txrx_loopback_to_file example --- host/examples/txrx_loopback_to_file.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'host/examples') diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp index 77f12944c..73cc7af50 100644 --- a/host/examples/txrx_loopback_to_file.cpp +++ b/host/examples/txrx_loopback_to_file.cpp @@ -251,6 +251,10 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ std::cout << boost::format("Creating the receive usrp device with: %s...") % rx_args << std::endl; uhd::usrp::multi_usrp::sptr rx_usrp = uhd::usrp::multi_usrp::make(rx_args); + //always select the subdevice first, the channel mapping affects the other settings + if (vm.count("tx-subdev")) tx_usrp->set_tx_subdev_spec(tx_subdev); + if (vm.count("rx-subdev")) rx_usrp->set_rx_subdev_spec(rx_subdev); + //detect which channels to use std::vector tx_channel_strings; std::vector tx_channel_nums; @@ -277,10 +281,6 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ tx_usrp->set_clock_source(ref); rx_usrp->set_clock_source(ref); - //always select the subdevice first, the channel mapping affects the other settings - if (vm.count("tx-subdev")) tx_usrp->set_tx_subdev_spec(tx_subdev); - if (vm.count("rx-subdev")) rx_usrp->set_rx_subdev_spec(rx_subdev); - std::cout << boost::format("Using TX Device: %s") % tx_usrp->get_pp_string() << std::endl; std::cout << boost::format("Using RX Device: %s") % rx_usrp->get_pp_string() << std::endl; -- cgit v1.2.3