#include <uhd/stream.hpp>
Public Member Functions | |
stream_args_t (const std::string &cpu="", const std::string &otw="") | |
Convenience constructor for streamer args. More... | |
Public Attributes | |
std::string | cpu_format |
std::string | otw_format |
device_addr_t | args |
std::vector< size_t > | channels |
A struct of parameters to construct a streamer.
Here is an example of how a stream args object could be used in conjunction with uhd::device::get_rx_stream():
Note: Not all combinations of CPU and OTW format have conversion support. You may however write and register your own conversion routines.
|
inline |
Convenience constructor for streamer args.
device_addr_t uhd::stream_args_t::args |
The args parameter is used to pass arbitrary key/value pairs. Possible keys used by args (depends on implementation):
The following are not implemented, but are listed for conceptual purposes:
Other options are device-specific:
std::vector<size_t> uhd::stream_args_t::channels |
List of channel numbers (only used by non-RFNoC devices)
Note: For RFNoC devices, this value is not used. To create a streamer with multiple channels, the uhd::rfnoc::rfnoc_graph::create_tx_streamer() and uhd::rfnoc::rfnoc_graph::create_rx_streamer() API calls have a num_ports
argument.
For non-RFNoC devices (i.e., USRP1, B100, B200, N200), this argument defines how streamer channels map to the front-end selection (see also Specifying the Subdevice).
A very simple example is a B210 with a subdev spec of A:A A:B
. This means the device has two channels available.
Setting stream_args.channels = {0, 1}
therefore configures MIMO streaming from both channels. By switching the channel indexes, stream_args.channels = {1, 0}
, the channels are switched and the first channel of the USRP is mapped to the second channel in the application.
If only a single channel is used for streaming, e.g., stream_args.channels = {1}
would only select a single channel (in this case, the second one). When streaming a single channel from the B-side radio of a USRP, this is a more versatile solution than setting the subdev spec globally to "A:B".
Leave this blank to default to channel 0 (single-channel application).
std::string uhd::stream_args_t::cpu_format |
The CPU format is a string that describes the format of host memory. Conversions for the following CPU formats have been implemented:
The following are not implemented, but are listed to demonstrate naming convention:
The CPU format can be chosen depending on what the application requires.
std::string uhd::stream_args_t::otw_format |
The OTW format is a string that describes the format over-the-wire. The following over-the-wire formats have been implemented:
The following are not implemented, but are listed to demonstrate naming convention:
Setting the OTW ("over-the-wire") format is, in theory, transparent to the application, but changing this can have some side effects. Using less bits for example (e.g. when going from otw_format
sc16
to sc8
) will reduce the dynamic range, and increases quantization noise. On the other hand, it reduces the load on the data link and thus allows more bandwidth (a USRP N210 can work with 25 MHz bandwidth for 16-Bit complex samples, and 50 MHz for 8-Bit complex samples).