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

Get wrong SDR when specifying serial #191

Closed
Heshyo opened this issue Nov 8, 2018 · 3 comments
Closed

Get wrong SDR when specifying serial #191

Heshyo opened this issue Nov 8, 2018 · 3 comments

Comments

@Heshyo
Copy link

Heshyo commented Nov 8, 2018

I'm not sure how much info we're supposed to provide when trying to connect to an SDR. Simply passing the index or driver and index may not be convenient if you have several boards.

I would have expected to be able to just specify the serial and get the proper board, but that's not the case.

With several Lime SDR connected, everything works as expected.

SoapySDRKwargs args = {};
SoapySDRKwargs_set(&args, "serial", limeSdrSerial);
sdr = SoapySDRDevice_make(&args);
SoapySDRKwargs_clear(&args);

But then if I connect a Lime Mini, it seems I always end up getting the Lime Mini, even when specifying the serial of a Lime SDR. Using the driver and index also always returns the Lime Mini.

Specifying both the serial and module fixes the problem:

SoapySDRKwargs args = {};
SoapySDRKwargs_set(&args, "module", "FX3");
SoapySDRKwargs_set(&args, "serial", limeSdrSerial);
sdr = SoapySDRDevice_make(&args);
SoapySDRKwargs_clear(&args);

But then if I plug a Blade RF 2, I can properly get 2 of my Lime SDR, but when trying to access the 3rd one with both module and serial, I'm getting the Blade RF 2 (this was tested with a very recent version of Pothos).

Adding the driver fixes the problem:

SoapySDRKwargs args = {};
SoapySDRKwargs_set(&args, "driver", "lime");
SoapySDRKwargs_set(&args, "module", "FX3");
SoapySDRKwargs_set(&args, "serial", limeSdrSerial);
sdr = SoapySDRDevice_make(&args);
SoapySDRKwargs_clear(&args);

I would expect the serial to be pretty unique, even between brands, so it would be nice to be able to just specify that.

@guruofquality
Copy link
Contributor

You should be fine with specifying only driver, and one unique identifier like serial. "driver" is special in that it actually is used inside of SoapySDR to filter out specific support modules. The rest of the keys are just passed on to be interpreted as the support module pleases.

You are right in that you should be able to do this with only serial, but some of the support modules wont respect that, and they will not be filtered out. But in the case of only installing support modules with serial, then this should work.

So I suspect there is an issue in SoapyBladeRF in regards to filtering based on serial: https://github.com/pothosware/SoapyBladeRF/blob/master/bladeRF_Registation.cpp#L81 Or libbladerf itself has a bug in the bladerf_devinfo_matches() implementation.

@Heshyo
Copy link
Author

Heshyo commented Nov 8, 2018

Thanks Josh, so I'll just specify the driver and serial.

I confirm I can get each board properly like that.

@guruofquality
Copy link
Contributor

I left an open bug on soapybladerf since it sounds like there is a problem: pothosware/SoapyBladeRF#23

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