Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to receive on two Rx channels with B210 #642

Closed
sada45 opened this issue Oct 24, 2022 · 1 comment
Closed

Failed to receive on two Rx channels with B210 #642

sada45 opened this issue Oct 24, 2022 · 1 comment

Comments

@sada45
Copy link

sada45 commented Oct 24, 2022

Issue Description

Hi, I'm trying to receive IQ signal from two Rx channels with B210 and Python APIs. It works fine while using one Rx channel. However, if the st_args.channels = [0, 1], it returns the error Invalid recv stream command - stream now on multiple channels in a single streamer will fail to time align.
Then, I tried the solution provided in the #325 to set the stream_cmd.stream_now = False. But it turns out that the collected sample are all zeros.

Setup Details

UHD: 4.3.0.0, Python: 3.8.10, OS: Ubuntu 20.04, USRP: B210

Expected Behavior

Actual Behaviour

While using two channels and stream_cmd.stream_now = True

Traceback (most recent call last):
  File "/home/sada45/BLong/USRP/test.py", line 35, in <module>
    streamer.issue_stream_cmd(stream_cmd)
RuntimeError: RuntimeError: Invalid recv stream command - stream now on multiple channels in a single streamer will fail to time align.

If the stream_cmd.stream_now = False, the error is gone, but received samples are all 0:
image

Steps to reproduce the problem

My code to collect the signal samples is:

b210 = uhd.usrp.MultiUSRP("type=b200")
b210.set_rx_rate(config.sample_rate, 0)
b210.set_rx_freq(uhd.libpyuhd.types.tune_request(get_freq_with_chan_num(config.chan)), 0)
b210.set_rx_gain(config.gain, 0)
st_args = uhd.usrp.StreamArgs("fc32", "sc16")
st_args.channels = [0,1]
metadata = uhd.types.RXMetadata()
streamer = b210.get_rx_stream(st_args)
recv_buffer = np.zeros((2, 1000), dtype=np.complex64)
stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.start_cont)
stream_cmd.stream_now = False
streamer.issue_stream_cmd(stream_cmd)
streamer.recv(recv_buffer, metadata)
print(recv_buffer[0, 0:10])
print(recv_buffer[1, 0:10])

stream_cmd = uhd.types.StreamCMD(uhd.types.StreamMode.stop_cont)
streamer.issue_stream_cmd(stream_cmd)

Additional Information

@mbr0wn
Copy link
Contributor

mbr0wn commented Dec 12, 2023

2 channel RX definitely works. Bump your gain and you should be fine. Sorry for leaving this open for so long.

@mbr0wn mbr0wn closed this as completed Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants