From ac95af24fa633e50b1c8ab88664c5d2663ea7b0b Mon Sep 17 00:00:00 2001 From: Dimitri Stolnikov Date: Wed, 16 Apr 2014 22:55:40 +0200 Subject: [PATCH] uhd: pass through only the requested number of channels B210 USRP appears as a 2-channel device by default. We prevent weird application behavior by restricting the number of connected channels to the value given via nchan= argument (1 by default). --- lib/uhd/uhd_sink_c.cc | 3 ++- lib/uhd/uhd_source_c.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/uhd/uhd_sink_c.cc b/lib/uhd/uhd_sink_c.cc index 20272fb..c043e56 100644 --- a/lib/uhd/uhd_sink_c.cc +++ b/lib/uhd/uhd_sink_c.cc @@ -139,7 +139,8 @@ std::string uhd_sink_c::name() size_t uhd_sink_c::get_num_channels() { - return _snk->get_device()->get_rx_num_channels(); +// return _snk->get_device()->get_rx_num_channels(); + return input_signature()->max_streams(); } osmosdr::meta_range_t uhd_sink_c::get_sample_rates( void ) diff --git a/lib/uhd/uhd_source_c.cc b/lib/uhd/uhd_source_c.cc index d8c5e0f..54e0d4b 100644 --- a/lib/uhd/uhd_source_c.cc +++ b/lib/uhd/uhd_source_c.cc @@ -140,7 +140,8 @@ std::string uhd_source_c::name() size_t uhd_source_c::get_num_channels() { - return _src->get_device()->get_rx_num_channels(); +// return _src->get_device()->get_rx_num_channels(); + return output_signature()->max_streams(); } osmosdr::meta_range_t uhd_source_c::get_sample_rates( void )