#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:
In addition, all the transport-related options explained on Transport Notes can be set here. These options can be set either when creating the device (see also Device Configuration through address string), or when creating the streamer (when the options are given both times, the stream args take precedence):
Other options are device-specific:
std::vector<size_t> uhd::stream_args_t::channels |
The channels is a list of channel numbers. Leave this blank to default to channel 0 (single-channel application). Set channels for a multi-channel application. Channel mapping depends on the front-end selection (see also Specifying the Subdevice).
A very simple example is an X300 with two daughterboards and a subdev spec of A:0 B:0
. 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, 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 globally to "B:0".
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).