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

Add libusb check for known ADALM-Pluto VID:PID #50

Merged
merged 1 commit into from
Jul 1, 2022
Merged

Conversation

zuckschwerdt
Copy link
Contributor

Some filtering and delay before letting IIO scan a USB context so we don't interfere with other drivers USB enumeration.
This should close #24.

@zuckschwerdt
Copy link
Contributor Author

zuckschwerdt commented Feb 21, 2022

With newer libiio (version 0.24+, unreleased currently) this likely isn't needed and we add the desired VID/PID to the usb backend scan.
Since strstr() is used in older versions the VID/PID parameter is backwards compatible without the need to feature detect at runtime.
See analogdevicesinc/libiio#764 and analogdevicesinc/libiio#791

@zuckschwerdt zuckschwerdt force-pushed the feat-libusb branch 2 times, most recently from c6263e8 to 043bcfe Compare February 21, 2022 09:43
@zuckschwerdt
Copy link
Contributor Author

To anyone able reproduce the discovery bug #24: this PR needs community testing, and some feedack, please ;)

@alphafox02
Copy link

alphafox02 commented Jun 28, 2022

I'll pulled and did a git checkout of this PR. This is on 20.04 and I am using the latest libad9361 and libiio pulled last night. It would appear my results are the same as master.

Here's what iio_info shows with no PlutoSDR plugged in using #50.

dragon@dragon-ROCK-Pi-X:/usr/src/SoapyPlutoSDR/build$ iio_info
Library version: 0.23 (git tag: fc3dc48)
Compiled with backends: local xml ip usb
IIO context created with local backend.
Backend version: 0.23 (git tag: fc3dc48)
Backend description string: Linux dragon-ROCK-Pi-X 5.15.0-33-generic #34~20.04.1-Ubuntu SMP Thu May 19 15:51:16 UTC 2022 x86_64
IIO context has 2 attributes:
local,kernel: 5.15.0-33-generic
uri: local:
IIO context has 1 devices:
iio:device0: axp288_adc
6 channels found:
voltage5: (input)
1 channel-specific attributes found:
attr 0: raw value: 4080
temp0: (input)
1 channel-specific attributes found:
attr 0: raw value: 976
temp1: (input)
1 channel-specific attributes found:
attr 0: raw value: 2976
current3: (input)
1 channel-specific attributes found:
attr 0: raw value: 0
temp2: (input)
1 channel-specific attributes found:
attr 0: raw value: 464
current4: (input)
1 channel-specific attributes found:
attr 0: raw value: 624
No trigger on this device
dragon@dragon-ROCK-Pi-X:/usr/src/SoapyPlutoSDR/build$

Here's SoapySDRUtil --find still seeing as though a Pluto is plugged in.

`dragon@dragon-ROCK-Pi-X:/usr/src/SoapyPlutoSDR/build$ SoapySDRUtil --find
######################################################

Soapy SDR -- the SDR abstraction library

######################################################

[INFO] [UHD] linux; GNU C++ version 9.2.1 20200304; Boost_107100; UHD_3.15.0.0-2build5
Found device 0
device = PlutoSDR
driver = plutosdr
label = PlutoSDR #0 local:
uri = local:
`

@alphafox02
Copy link

The suggestion mentioned in the other ticket about recompiling libiiio with cmake -DWITH_LOCAL_BACKEND=NO -DWITH_IIOD=NO ../) worked, SoapySDRUtil no longer sees the onboard sensor as a Pluto. That doesn't really relate to this ticket, but it works for now. I would be happy to test more suggestions or changes to this pull request, or try out different versions of libad9361 and libiio.

@zuckschwerdt
Copy link
Contributor Author

Thanks for the detailed feedback. We'll need both PRs then. I'll update and merge #42 soon.

@alphafox02
Copy link

Would it help if I tested #42?

@zuckschwerdt
Copy link
Contributor Author

I think #42 doesn't fit in the current source. I'll need to rewrite.

@rgetz
Copy link

rgetz commented Jul 1, 2022

This was added to libiio as analogdevicesinc/libiio#791

@zuckschwerdt
Copy link
Contributor Author

Thanks, yes, I assume we are using that feature if available: https://github.com/pothosware/SoapyPlutoSDR/blob/master/PlutoSDR_Registration.cpp#L23-L24

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

Successfully merging this pull request may close these issues.

Driver discovery method sometimes is incompatible with SoapyRTLSDR
3 participants