usrp-users@lists.ettus.com

Discussion and technical support related to USRP, UHD, RFNoC

View all threads

RX Streaming on Multiple Channels

AS
Arnaldo Sans
Tue, Mar 25, 2025 10:23 AM

Good morning,

Hope everyone is doing well.  I am attempting to stream data to multiple RXs on an on x310.  More specifically, I am using TX/RX and RX2 at RFA [0, 1].  I was reviewing the on-line "USRP Hardware Driver and USRP Manual" (https://files.ettus.com/manual/page_stream.html) material.  Specifically, the section on "Introduction to Streaming".  The authors provide a snippet of code illustrating how to manage a RX streaming for a signal port (below is the python code).

import uhd
import numpy as np
usrp = uhd.usrp.MultiUSRP("type=x300")
stream_args = uhd.usrp.StreamArgs("fc32", "sc16")
stream_args.args = "spp=200" # Note this setting is not valid for all USRPs
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)

I have attempted to modify the above snippet to support RX streaming into two separate ports on the RFA (TX/RX and RX2 at RFA [0, 1]) and I have not been successful.  Below is the error message I am receiving, and I am having trouble deciphering what it's trying to tell me.

.... line 207, in main
rx_streamer.issue_stream_cmd(uhd.libpyuhd.types.stream_cmd, [0,1])

TypeError: issue_stream_cmd(): incompatible function arguments. The following argument types are supported:
1. (self: uhd.libpyuhd.usrp.rx_streamer, arg0: uhd.libpyuhd.types.stream_cmd) -> None

Invoked with: <uhd.libpyuhd.usrp.rx_streamer object at 0x7faf1abc54b0>, <class 'uhd.libpyuhd.types.stream_cmd'>, [0, 1]

Is there a snippet of code available that illustrates how to RX Streaming on Multiple Channels?  Alternatively, any guidance on how to approach this error message will be very welcomed.

Thank you!

Regards,
AJ
Graduate Researcher
College of Electrical & Computing Engineering
Florida International University
10555 West Flagler Street
Room 3863B
Miami, FL 33174
Phone: 305-336-2541 | Email: asans008@FIU.edumailto:asans008@FIU.edu

[cid:image001.png@01DB9D4B.5689C8A0]

Good morning, Hope everyone is doing well. I am attempting to stream data to multiple RXs on an on x310. More specifically, I am using TX/RX and RX2 at RFA [0, 1]. I was reviewing the on-line "USRP Hardware Driver and USRP Manual" (https://files.ettus.com/manual/page_stream.html) material. Specifically, the section on "Introduction to Streaming". The authors provide a snippet of code illustrating how to manage a RX streaming for a signal port (below is the python code). import uhd import numpy as np usrp = uhd.usrp.MultiUSRP("type=x300") stream_args = uhd.usrp.StreamArgs("fc32", "sc16") stream_args.args = "spp=200" # Note this setting is not valid for all USRPs 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) I have attempted to modify the above snippet to support RX streaming into two separate ports on the RFA (TX/RX and RX2 at RFA [0, 1]) and I have not been successful. Below is the error message I am receiving, and I am having trouble deciphering what it's trying to tell me. .... line 207, in main rx_streamer.issue_stream_cmd(uhd.libpyuhd.types.stream_cmd, [0,1]) TypeError: issue_stream_cmd(): incompatible function arguments. The following argument types are supported: 1. (self: uhd.libpyuhd.usrp.rx_streamer, arg0: uhd.libpyuhd.types.stream_cmd) -> None Invoked with: <uhd.libpyuhd.usrp.rx_streamer object at 0x7faf1abc54b0>, <class 'uhd.libpyuhd.types.stream_cmd'>, [0, 1] Is there a snippet of code available that illustrates how to RX Streaming on Multiple Channels? Alternatively, any guidance on how to approach this error message will be very welcomed. Thank you! Regards, AJ Graduate Researcher College of Electrical & Computing Engineering Florida International University 10555 West Flagler Street Room 3863B Miami, FL 33174 Phone: 305-336-2541 | Email: asans008@FIU.edu<mailto:asans008@FIU.edu> [cid:image001.png@01DB9D4B.5689C8A0]
MB
Martin Braun
Wed, Apr 2, 2025 12:37 PM

AJ,

the error is telling you that you called the issue_stream_cmd() method with
invalid arguments. There is no "channel" argument.

Instead, the channels are part of the stream command object itself. Do
something like this:

stream_cmd.channels = [0, 1]

...

rx_streamer.issue_stream_cmd(stream_cmd)

Keep in mind that most daughterboards can only receive on one antenna port
(exceptions are BasicRX/LFRX and TwinRX, which you are not using). If you
are using UBX daughterboards, you get one RX channel from A- and B-side,
respectively.

--M

On Tue, Mar 25, 2025 at 11:24 AM Arnaldo Sans via USRP-users <
usrp-users@lists.ettus.com> wrote:

Good morning,

Hope everyone is doing well.  I am attempting to stream data to multiple
RXs on an on x310.  More specifically, I am using TX/RX and RX2 at RFA [0,
1].  I was reviewing the on-line “USRP Hardware Driver and USRP Manual” (
https://files.ettus.com/manual/page_stream.html) material.  Specifically,
the section on “*Introduction to Streaming”.  *The authors provide a
snippet of code illustrating how to manage a RX streaming for a signal port
(below is the python code).

import uhd

import numpy as np

usrp = uhd.usrp.MultiUSRP("type=x300")

stream_args = uhd.usrp.StreamArgs("fc32", "sc16")

stream_args.args = "spp=200" # Note this setting is not valid for all
USRPs

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)

I have attempted to modify the above snippet to support RX streaming into
two separate ports on the RFA (TX/RX and RX2 at RFA [0, 1]) and I have not
been successful.  Below is the error message I am receiving, and I am
having trouble deciphering what it’s trying to tell me.

…. line 207, in main

  • rx_streamer.issue_stream_cmd(uhd.libpyuhd.types.stream_cmd, [0,1])*

TypeError: issue_stream_cmd(): incompatible function arguments. The
following argument types are supported:

    1. (self: uhd.libpyuhd.usrp.rx_streamer, arg0:
      uhd.libpyuhd.types.stream_cmd) -> None*

Invoked with: <uhd.libpyuhd.usrp.rx_streamer object at 0x7faf1abc54b0>,
<class 'uhd.libpyuhd.types.stream_cmd'>, [0, 1]

Is there a snippet of code available that illustrates how to RX Streaming
on Multiple Channels?  Alternatively, any guidance on how to approach this
error message will be very welcomed.

Thank you!

Regards,

AJ

Graduate Researcher

*College of Electrical & Computing Engineering *

Florida International University

10555 West Flagler Street

Room 3863B

Miami, FL 33174

Phone: 305-336-2541 | Email: asans008@FIU.edu asans008@FIU.edu


USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-leave@lists.ettus.com

AJ, the error is telling you that you called the issue_stream_cmd() method with invalid arguments. There is no "channel" argument. Instead, the channels are part of the stream command object itself. Do something like this: stream_cmd.channels = [0, 1] # ... rx_streamer.issue_stream_cmd(stream_cmd) Keep in mind that most daughterboards can only receive on one antenna port (exceptions are BasicRX/LFRX and TwinRX, which you are not using). If you are using UBX daughterboards, you get one RX channel from A- and B-side, respectively. --M On Tue, Mar 25, 2025 at 11:24 AM Arnaldo Sans via USRP-users < usrp-users@lists.ettus.com> wrote: > Good morning, > > > > Hope everyone is doing well. I am attempting to stream data to multiple > RXs on an on x310. More specifically, I am using TX/RX and RX2 at RFA [0, > 1]. I was reviewing the on-line “USRP Hardware Driver and USRP Manual” ( > https://files.ettus.com/manual/page_stream.html) material. Specifically, > the section on “*Introduction to Streaming”. *The authors provide a > snippet of code illustrating how to manage a RX streaming for a signal port > (below is the python code). > > > > *import uhd* > > *import numpy as np* > > *usrp = uhd.usrp.MultiUSRP("type=x300")* > > *stream_args = uhd.usrp.StreamArgs("fc32", "sc16")* > > *stream_args.args = "spp=200" # Note this setting is not valid for all > USRPs* > > *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)* > > > > I have attempted to modify the above snippet to support RX streaming into > two separate ports on the RFA (TX/RX and RX2 at RFA [0, 1]) and I have not > been successful. Below is the error message I am receiving, and I am > having trouble deciphering what it’s trying to tell me. > > > > > > *…. line 207, in main* > > * rx_streamer.issue_stream_cmd(uhd.libpyuhd.types.stream_cmd, [0,1])* > > > > *TypeError: issue_stream_cmd(): incompatible function arguments. The > following argument types are supported:* > > * 1. (self: uhd.libpyuhd.usrp.rx_streamer, arg0: > uhd.libpyuhd.types.stream_cmd) -> None* > > > > *Invoked with: <uhd.libpyuhd.usrp.rx_streamer object at 0x7faf1abc54b0>, > <class 'uhd.libpyuhd.types.stream_cmd'>, [0, 1]* > > > > > > Is there a snippet of code available that illustrates how to RX Streaming > on Multiple Channels? Alternatively, any guidance on how to approach this > error message will be very welcomed. > > > > Thank you! > > > > *Regards,* > > *AJ* > > *Graduate Researcher* > > *College of Electrical & **Computing** Engineering * > > *Florida International University* > > *10555 West Flagler Street* > > *Room 3863B* > > *Miami, FL 33174* > > *Phone:* *305-336-2541 |* *Email:* *asans008@FIU.edu <asans008@FIU.edu>* > > > > _______________________________________________ > USRP-users mailing list -- usrp-users@lists.ettus.com > To unsubscribe send an email to usrp-users-leave@lists.ettus.com >