Closed zuckschwerdt closed 2 years ago
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 https://github.com/analogdevicesinc/libiio/pull/764 and https://github.com/analogdevicesinc/libiio/pull/791
To anyone able reproduce the discovery bug #24: this PR needs community testing, and some feedack, please ;)
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 ######################################################
######################################################
[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: `
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.
Thanks for the detailed feedback. We'll need both PRs then. I'll update and merge #42 soon.
Would it help if I tested #42?
I think #42 doesn't fit in the current source. I'll need to rewrite.
This was added to libiio as https://github.com/analogdevicesinc/libiio/pull/791
Thanks, yes, I assume we are using that feature if available: https://github.com/pothosware/SoapyPlutoSDR/blob/master/PlutoSDR_Registration.cpp#L23-L24
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.