Running a setup with 3 receivers, and I've lost 1 due to a usb_claim_interface error

nvycat14

Member
Joined
Dec 5, 2006
Messages
37
Alas, I am typically a "keep searching, someone has had this problem before," type of troubleshooter, but I'm running low on close matches and even lower on patience, unfortunately...

I have a desktop PC (Acer, if it matters) running Ubuntu 22.04.4 LTS.

I have 3 SDR sticks plugged in; they're all connected to a single USB 3.0 hub, into the PC via 1 USB port (yes, yes, I wanted to fix this piece of the setup, but that's for a different time).

I have 3 instances of op25-rx and 3 instances of op25-liq services running at a time (i.e. op25-rx_main, op25-rx_backup1, and op25-rx_backup2.service, and then the same format for op25-liq_main.service, etc.) This was at the recommendation of Boatbod, who — in a thread here a long time ago — indicated that this was preferred over a single "multi-rx" setup for my particular use-case. It has run for a long time and produced exactly the results I wanted.

Until now. I had a power outage (that lasted longer than my UPS's did, and longer than it took me to get a borrowed generator hooked up).

The "rx" services for "main" and "backup1" are fine, but the op25-rx_backup2.service fails.

Code:
myname@scanner-desktop:~/op25/op25/gr-op25_repeater/apps$ sudo systemctl status op25-rx_backup2.service
× op25-rx_backup2.service - op25-rx
     Loaded: loaded (/etc/systemd/system/op25-rx_backup2.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2024-11-03 18:08:50 EST; 20h ago
    Process: 257647 ExecStart=/bin/bash -- op25_backup2.sh (code=exited, status=1/FAILURE)
   Main PID: 257647 (code=exited, status=1/FAILURE)
        CPU: 1.398s

Nov 03 18:08:50 scanner-desktop systemd[1]: op25-rx_backup2.service: Scheduled restart job, restart counter is at 5.
Nov 03 18:08:50 scanner-desktop systemd[1]: Stopped op25-rx.
Nov 03 18:08:50 scanner-desktop systemd[1]: op25-rx_backup2.service: Consumed 1.398s CPU time.
Nov 03 18:08:50 scanner-desktop systemd[1]: op25-rx_backup2.service: Start request repeated too quickly.
Nov 03 18:08:50 scanner-desktop systemd[1]: op25-rx_backup2.service: Failed with result 'exit-code'.
Nov 03 18:08:50 scanner-desktop systemd[1]: Failed to start op25-rx.

Checking the particular stderr output (here, it is stderr.3), I get:

Code:
myname@scanner-desktop:~/op25/op25/gr-op25_repeater/apps$ cat stderr.3
Using Python /usr/bin/python3
gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.10.1.1
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp
Using device #2 Realtek RTL2838UHIDIR SN: 00000001
usb_claim_interface error -5
Traceback (most recent call last):
  File "/home/scanner-admin/op25/op25/gr-op25_repeater/apps/./rx.py", line 1101, in <module>
    rx = rx_main()
  File "/home/scanner-admin/op25/op25/gr-op25_repeater/apps/./rx.py", line 1005, in __init__
    self.tb = p25_rx_block(self.options)
  File "/home/scanner-admin/op25/op25/gr-op25_repeater/apps/./rx.py", line 169, in __init__
    gain_names = self.src.get_gain_names()
AttributeError: 'NoneType' object has no attribute 'get_gain_names'

Previous threads related to similar "usb_claim_interface" errors suggested checking my "blacklisting." First, I confirmed the file exists:

Code:
myname@scanner-desktop:~/op25/op25/gr-op25_repeater/apps$ ls /etc/modprobe.d | grep blacklist
amd64-microcode-blacklist.conf
blacklist-ath_pci.conf
blacklist.conf
blacklist-firewire.conf
blacklist-framebuffer.conf
blacklist-modem.conf
blacklist-oss.conf
blacklist-rare-network.conf
blacklist-rtl.conf
intel-microcode-blacklist.conf

Then using nano to check the contents, I've got:

Code:
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
blacklist rtl2838

I've attempted to restart the processes individually and in a single "systemctl restart" command, to no avail. If it may be of note, the op25-liq_backup2.service is running without issue, producing a completely empty recording file.

What is my next step in this process, please? Thanks in advance!!!
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,867
usb_claim_interface error -5
This is a libusb library error (libusb_error) from the "usb_claim_interface" function which is called from the librtlsdr library in function "rtlsdr_open".

The error -5 enumerates (from the enum libusb_error) to:
LIBUSB_ERROR_NOT_FOUND Entity not found.
or from the "usb_claim_interface" function "returns" section:
LIBUSB_ERROR_NOT_FOUND if the requested interface does not exist

The dongle is only partially accessible/opened which is why you see dongle device info:
Using device #2 Realtek RTL2838UHIDIR SN: 00000001

I've only seen a -6 (LIBUSB_ERROR_BUSY) error, and to fix that I had to recompile librtlsdr at the cmake part with "-DDETACH_KERNEL_DRIVER=ON" flag added.

In don't remember the context of "Entity not found" or "the requested interface" in libusb.
You could research the "LIBUSB_ERROR_NOT_FOUND" to find a possible solution.
 

thewraith2008

Member
Joined
Nov 22, 2016
Messages
1,867
Maybe you should test the librtlsdr installation by itself.
Try using the rtl_test program to see if it works without op25. (see below output)

[user@user ~]$ rtl_test
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000008

Using device 0: Generic RTL2832U OEM
Detached kernel driver
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.

Info: This tool will continuously read from the device, and report if
samples get lost. If you observe no further output, everything is fine.

Reading samples in async mode...
Allocating 15 zero-copy buffers
lost at least 68 bytes
^CSignal caught, exiting! <--- CTRL-C here after about 10 seconds to exit

User cancel, exiting...
Samples per million lost (minimum): 1
Reattached kernel driver
[user@user ~]$

This thread here makes mention of a possible solution is by installing 'libusb-compat' package.
Information there is for Arch Linux but you should get the idea.

In my Manjaro (Arch) PC, I did not need to use 'libusb-compat' and my Debain PC, that package was not available to use.
 
Top