The concept of streaming refers to the transportation of samples or other data between host and device. A streamer is an object that facilitates such streaming. An RX streamer (uhd::rx_streamer) allows the user to receive data from the device. A TX streamer (uhd::tx_streamer) allows the user to transmit data to the device.
For more information, please visit our website.
For RX streaming, the following actions need to be taken:
In Python, the steps could look like this:
import
uhdimport
numpyas
npusrp = uhd.usrp.MultiUSRP(
"type=x300"
)stream_args = uhd.usrp.StreamArgs(
"fc32"
,"sc16"
)stream_args.args =
"spp=200"
rx_streamer = usrp.get_rx_stream(stream_args)
rx_metadata = uhd.types.RXMetadata()
recv_buffer = np.zeros(rx_streamer.get_max_num_samps(), dtype=np.complex64)
stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.start_cont)
stream_cmd.stream_now =
True
rx_streamer.issue_stream_cmd(stream_cmd)
while
run_condition:samps = rx_streamer.recv(recv_buffer, rx_metadata)
stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.stop_cont)
rx_streamer.issue_stream_cmd(stream_cmd)
For TX streaming, the following actions need to be taken:
In Python, the steps could look like this:
import
uhdimport
numpyas
npusrp = uhd.usrp.MultiUSRP(
"type=x300"
)stream_args = uhd.usrp.StreamArgs(
"fc32"
,"sc16"
)stream_args.args =
"spp=200"
tx_streamer = usrp.get_tx_stream(stream_args)
tx_metadata = uhd.types.TXMetadata()
tx_buffer = np.zeros(, dtype=np.complex64)
while
True
:samps = tx_streamer.send(tx_buffer, tx_metadata)
For more details on configuring streamers, cf. Streaming Arguments (Stream Args).
For more details on overruns/underruns, cf. Overflow/Underflow Notes.
Between the host and the device, data (such as I/Q samples) are packetized and encapsulated. Refer to Radio Transport Protocols for more details on the protocols used.
The length of an IF data packet can be limited by several factors:
There are two important data types to consider when streaming. They are referred to as arguments in the uhd::stream_args_t object:
cpu
argument)otw
argument)The host data type refers to the format of samples used in the host for baseband processing. Typically, the data type is complex baseband such as normalized complex-float32 or complex-int16.
The link-layer or "over-the-wire" data type refers to the format of the samples sent through the link. Typically, this data type is complex-int16. However, to increase throughput over the link-layer, at the expense of precision, complex-int8 may be used.
The user may request arbitrary combinations of host and link data types; however, not all combinations are supported. The user may register custom data type formats and conversion routines. See convert.hpp and Converters for further documentation.
Ethernet-based devices allow sending data to an alternative destination instead of back to the controlling UHD session.
Starting with UHD 4.4, these devices allow streaming data to alternative locations from their QSFP/SFP connectors (streaming data to alternative locations from the RJ45 connector is not possible).
To enable remote streaming, create a regular RX streamer. This will work as a proxy for UHD, and an object that will accept stream commands.
Consider the following example: A UHD host controller is running on a computer with IP address 192.168.40.1. It is opening a session with a USRP with IP address 192.168.40.2. It configures the USRP, sets the desired frequency and gain, and any other settings that might be required. Then, it initiates a data stream from the USRP to another computer with IP address 192.168.40.5.
< UHD Host
USRP 192.168.40.1
192.168.40.2
If you are looking for more details, kindly visit Highmesh.
Remote
> Streaming
Destination
192.168.40.5
The sequence of events to enable this feature is illustrated with the following Python snippet:
import
uhdimport
numpyas
npusrp = uhd.usrp.MultiUSRP(
"type=x4xx"
)stream_args = uhd.usrp.StreamArgs(
"fc32"
,"sc16"
)stream_args.args =
"dest_addr=192.168.40.5,dest_port="
rx_streamer = usrp.get_rx_stream(stream_args)
rx_metadata = uhd.types.RXMetadata()
stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.start_cont)
stream_cmd.stream_now =
True
rx_streamer.issue_stream_cmd(stream_cmd)
recv_buffer = np.zeros(rx_streamer.get_max_num_samps(), dtype=np.complex64)
samps = rx_streamer.recv(recv_buffer, rx_metadata)
assert
samps == 0stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.stop_cont)
rx_streamer.issue_stream_cmd(stream_cmd)
The ability to call recv() without a fatal error condition allows using this API with some preexisting applications.
The streamer objects accepts the following arguments:
dest_addr
, dest_port
: The remote destination IP address and port. Both must be provided.dest_mac_addr
: If provided, this value is used as a MAC address. Must be in AA:BB:CC:DD:EE:FF format. If not provided, the device uses ARP to identify the MAC address based on the IP address. When given, there are no further checks that the IP address matches the MAC address.adapter
: The adapter that is used to stream data out of. The adapter names match the interface names as listed on the command line (e.g., sfp0
, sfp1
). This allows connecting to one interface and streaming out of another. It also allows running UHD on the device itself (for MPM devices, i.e. X410, E320, N3xx series) and streaming to a remote destination at a high rate. Note that for X3x0, the available adapter names are hardcoded as sfp0
and sfp1
, respectively.stream_mode
: This key allows two options: raw_payload
(the default) and full_packet
. When full_packet
is selected, the full CHDR packet is streamed and the remote destination needs to dissect or remove the header. With raw_payload
, only the data is sent as a UDP packet (e.g., only IQ samples). See Radio Transport Protocols for more details on CHDR.enable_fc
: Either "0" (default) or "1". Set to "1" to enable flow control. In that case, stream_mode
must also be set to full_packet
in order to be able to handle flow control responses. See the following section for more information.By default, the USRP will stream data to the remote streaming destination at whatever data rate it is set to, and there are no checks to ensure the destination can keep up. This is different from streaming to UHD, where flow control is used to match rates between device and host computer.
If flow control is desired, then using enable_fc=1
as a stream argument will enable flow control. However, the remote destination must now unpack the data packets and send flow control responses to the USRP in order for it to keep streaming. Refer to the RFNoC specification for how to format flow control response packets.
The following limitations apply when using remote streaming:
The N200 Series of USRPs supports alternative stream destinations starting with UHD 3.5.
The sequence to activate remote destination streaming is identical to that in Section RFNoC Devices (X440, X410, X3x0, N3xx Series, E320), with the following differences:
addr
and port
arguments are supported.Welcome to the UHD software distribution! UHD is the free & open-source software driver and API for the Universal Software Radio Peripheral (USRP) SDR platform, created and sold by Ettus Research.
UHD supports all Ettus Research USRP hardware, including all motherboards and daughterboards, and the combinations thereof.
For technical documentation related to USRP hardware or UHD system design, check out the UHD and USRP Manual. That is where you can find Installation Instructions, help on how to build UHD from source on different platforms, development guidelines and reference documentation as well as device usage guidance.
Additionally, be sure to check out the Ettus Research FAQ, and the Knowledge Base for useful application notes and tutorials.
UHD is primarily developed on Linux, but we also test and support the following operating systems.
Other operating systems will most likely work, too, but are not officially supported.
UHD can be used to build stand-alone applications with USRP hardware, or with third-party applications. Some common toolkits / frameworks are:
host/
The source code for the user-space driver.
mpm/
The source code for the module peripheral manager (MPM). This is code that is run on embedded devices.
firmware/
The source code for all microprocessors in USRP hardware.
fpga/
The source code for the UHD FPGA images.
images/
This contains the package builder for FPGA and firmware images. We provide other tools to download image packages, the scripts in here are mainly relevant for UHD maintainers and -developers.
tools/
Additional tools, mainly for debugging purposes. See the readme-file in that directory for more details on the individual tools.
Contact us to discuss your requirements of USRP Manufacturer. Our experienced sales team can help you identify the options that best suit your needs.