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

UHD utility function rx_samples_to_file incorrectly errors out for "RX channel out of range" #723

Closed
gwkraus opened this issue Jan 30, 2024 · 1 comment

Comments

@gwkraus
Copy link

gwkraus commented Jan 30, 2024

Issue Description

The UHD utility function "rx_samples_to_file" incorrectly throws an out-of-range for configured RX frontends error for UHD version 4.4 onwards. The identical command works correctly with version 4.3 and older.

Setup Details

Here's my setup:
Hardware: Dell XPS 15 9500, 64GB RAM, Intel Core i9-10885-H processor (16 cores)
OS: Ubuntu 22.04.3 LTS
USRP: B210 with GPSDO
UHD: pulled versions 4.3 and 4.4 from github and built locally on my laptop, downloaded fpga images with image_downloader utility on 30 JAN 2024.
first non-working version:[INFO] [UHD] linux; GNU C++ version 11.4.0; Boost_107400; UHD_4.4.0.HEAD-33-g4a77791c
last working version: [INFO] [UHD] linux; GNU C++ version 11.4.0; Boost_107400; UHD_4.3.0.HEAD-0-g1f8fd345

Expected Behavior

I expect that the rx_samples_to_file program will configure the USRP, collect the requested amount of samples, and write the sample data to a file.

Actual Behaviour

Execution proceeds normally until the error, occuring after Setting the RX Gain.
The error message is as follows:
Error: LookupError: IndexError: multi_usrp: RX channel 18446744073709551615 out of range for configured RX frontends

Steps to reproduce the problem

I built and installed each version. After installing the version, I executed the rx_samples_to_file program from within the uhd directory ~/uhd-4.x/host/build/examples (where x is 3 or 4)

Here is the command I used. The identical command works with v4.3 and fails with v4.4
./rx_samples_to_file --duration 10 --ref internal --spb 204800 --rate 20000000 --freq 763000000 --gain 70 --file ./my_samples.dat

Additional Information

I attempted to specify a channel, but the results were exactly the same. Also, I inadvertently forgot to specify a --gain value one time, and execution in v4.4 worked as normal. Problem is the default gain value is 0, so that in itself is an issue if not specified.

@manderseck
Copy link
Contributor

@gwkraus Thanks for reporting this issue. I have created a fix that'll run through our internal procedures and will be pushed public in the next weeks.
Some background: The example was changed between UHD 4.3 and 4.4 in commit d91c86d. The line that reads usrp->set_rx_gain(gain, uhd::usrp::multi_usrp::ALL_CHANS); calls into set_rx_gain() with the ALL_CHANS argument which until now was only valid in multi_usrp_rfnoc (used for RFNoC devices), but not in multi_usrp (used for B2xx). Therefore the author of the change might not have captured it in his testing.
My change fixes this in multi_usrp.cpp. If you want to use the example until my change gets published you can either do the change yourself or adapt the example to loop through the given channels like it is done for the rx_bandwidth further down.
With the change on its way I'll close this bug. Feel free to re-open if necessary.

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