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).
This commit is contained in:
Dimitri Stolnikov 2014-04-16 22:55:40 +02:00
parent bfbc97db8f
commit ac95af24fa
2 changed files with 4 additions and 2 deletions

View File

@ -139,7 +139,8 @@ std::string uhd_sink_c::name()
size_t uhd_sink_c::get_num_channels() 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 ) osmosdr::meta_range_t uhd_sink_c::get_sample_rates( void )

View File

@ -140,7 +140,8 @@ std::string uhd_source_c::name()
size_t uhd_source_c::get_num_channels() 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 ) osmosdr::meta_range_t uhd_source_c::get_sample_rates( void )