Opening device with Soapy fails once every two times on Linux

Hi,

I can’t understand why opening the device with Soapy fails exactly once every two times on linux when my LimeSdr USB is plugged on USB 3.0 port. So SoapySDRDevice_make leads to “Undefined/Failure” and “Gateware version mismatch! … found version 0, revision 0” once every two times, but next times it succeeds and find the right gateware version 2 dot something.

In details:
I have a LimeSDR that I’ve been using for months without issue on Windows. Now I’m trying it on Linux (Linux Mint 19.3, based on Ubuntu 18.0.4 LTS) and exactly once every two times opening the device with Soapy is failing when plugged on USB 3 port (actually the call to SoapySDRDevice_make is failing).

To be sure it’s no related to my own program, I used a basic code from Soapy: https://github.com/pothosware/SoapySDR/wiki/C_API_Example

This issue is likely related to hardware or driver:

  • It is failing on two different PC/motherboards (MSI x370, Asus B450M) when plugged on USB 3.0 or USB 3.1Gen 2 (whatever the USB controller: CPU-based, chipset-based or Asmedia-based).
  • It is working on these PCs on USB 2 ports, but of course this is not what I want as USB 2.0 bandwidth is very limited.
  • On a laptop running on battery (still with same OS), it works on USB 3.0 port.
  • There is no other USB-connected device on these systems except a keyboard and mouse.

Do you have any idea? Try real Ubuntu OS and not Linux Mint? Try another SDR ? Any log or command I could issue to get more info?
Any help would be appreciated!

I’ve not used Mint 19.3 but my random guess would be that the default power management is configured to be optimized for maximum battery life and is aggressively autosuspending USB devices to achieve that goal.

On a desktop I’d plug “disable USB autosuspend udev” into your search engine of choice.
On a laptop I’d plug “sudo apt install tlp” into your search engine of choice.

Hi @mzs and thank you for the idea that I was not familiar with. Yet /sys/bus/usb/devices/[my SDR]/power/control contains ‘on’, so autosuspend looks disabled by default, doesn’t it? If so, any other idea?

PS: in the meantime, I tested with another LimeSDR USB => same effect. I also tested with Ubuntu 18.04.3 live cd (with /sys/bus/usb…/power/control also containing ‘on’) rather than Linux Mint => same effect.

PS2: one can reproduce the same bug just with SoapySDRUtil. Just use SoapySDRUtil --make twice, once it works, next it fails, then it works, then it fails, etc etc.

PS3: a few more info, just in case. I tried both Soapy 0.6 and 0.7 => same result (0.6 from ubuntu repo, 0.7 from myriadrf repo). The installed soapy packages are: soapysdr-module-lms7 (and its dependencies: libsoapysdr0.7, liblimesuite…), libsoapysdr-dev, soapysdr-tools, build-essential

May well be this bug: https://github.com/myriadrf/LimeSuite/issues/287

1 Like