Page 1 of 1

"usb_claim_interface error" occurred

Posted: Sat Mar 18, 2017 2:15 pm
by eightok
"rtl_test" does not work on Raspberry Pi3 properly.
I want to know how to solve this problem.

>Found 1 device(s):
> 0: Generic, RTL2832U, SN: ****************
>
>Using device 0: Generic RTL2832U
>usb_claim_interface error -6
>Failed to open rtlsdr device #0.

I installed rtl-sdr on Raspberry Pi3 in the way as described on the following link.
"https://gist.github.com/floehopper/99a0c8931f9d779b0998"

And I made "rtlsdr.conf" file at "/etc/modprobe.d/" as follows.

>blacklist dvb_usb_rtl28xxu
>blacklist rtl2830
>blacklist rtl2832
>blacklist dvb_usb_v2
>blacklist dvb_core

And I checked by "lsmod" command that there are no DVB related devices.

raspberrypi 4.4.50-v7+ #970
armv7l

Thanks.

Re: "usb_claim_interface error" occured

Posted: Sat Mar 18, 2017 10:11 pm
by rtlsdrblog
Does anything change if you run rtl_test as root?

Re: "usb_claim_interface error" occured

Posted: Sun Mar 19, 2017 5:10 am
by eightok
rtlsdrblog wrote:Does anything change if you run rtl_test as root?
Thanks for your reply.
I tried rtl_test as root, but nothing changed.

Re: "usb_claim_interface error" occurred

Posted: Sun Mar 19, 2017 5:14 pm
by hotpaw2
eightok wrote:"rtl_test" does not work on Raspberry Pi3 properly.
>usb_claim_interface error -6
>Failed to open rtlsdr device #0.
I got a similar error under the latest Raspian, I found I had to change the build script to use this line:

Code: Select all

cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
Not sure why...

Re: "usb_claim_interface error" occurred

Posted: Mon Mar 20, 2017 2:51 am
by eightok
hotpaw2 wrote:

Code: Select all

cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
Not sure why...
Thank you for your reply.
I also tested this one, but nothing changed...

Re: "usb_claim_interface error" occurred

Posted: Mon Mar 20, 2017 4:11 am
by eightok
It worked!

Only after reboot, it did not work.
But, once I disconnected the dongle hardware manually, and again connected it manually, it began to work.

But why?

Re: "usb_claim_interface error" occurred

Posted: Sat Aug 11, 2018 2:56 pm
by Husker84
I’m having the same issue.

I tried recompiling using

Code: Select all

cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
And don’t work.

Also tried to made a config file at "/etc/modprobe.d/" with.

>blacklist dvb_usb_rtl28xxu
>blacklist rtl2830
>blacklist rtl2832
>blacklist dvb_usb_v2
>blacklist dvb_core

Restarting, and still don’t works.

https://imgur.com/a/lpnuWuz



In a Windows system it works like a charm.

Any idea?

Re: "usb_claim_interface error" occurred

Posted: Sun Aug 12, 2018 12:14 pm
by rtlsdrblog
Can you try blacklisting

blacklist dvb_usb_rtl2832u

I know of at least one version of Linux where 'xx' didn't work for some reason.

Re: "usb_claim_interface error" occurred

Posted: Fri Feb 08, 2019 6:45 pm
by ab1jx
It would be useful to know where this message comes from (probably libusb). I wrote a program a year ago that uses librtlsdr, doesn't get this error. I copied the source of my dongle init routines into a new program just now, it gets the error. The old program still works (same computer), rtl_test works. I have the dvb drivers blacklisted. I've tried 2 dongles, this seems to work the same way. I just changed my makefile, I'm linking the libraries in the same order now, no difference.

dmesg | grep -i dvb returns nothing
lsmod | grep -i dvb also returns nothing

lsusb | grep -i dvb says
Bus 001 Device 017: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

The verbose form says

Code: Select all

Bus 001 Device 017: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x2838 RTL2838 DVB-T
  bcdDevice            1.00
  iManufacturer           1 Realtek
  iProduct                2 RTL2838UHIDIR
  iSerial                 3 00000001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          4 USB2.0-Bulk&Iso
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5 Bulk-In, Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5 Bulk-In, Interface
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      2
Device Status:     0x0000
  (Bus Powered)
This is on a Raspberry Pi 3B with Raspbian.

The routine (of mine) that fails is

Code: Select all

  rslt = rtlsdr_open(&mydev,(uint32_t) dongle.dev_index);
  if (rslt != 0) {
    printf("Dongle open failed.\n");
    perror("open ");
    exit(1);
  }
overall it says:
usb_claim_interface error -6
Dongle open failed.
open : Device or resource busy

Re: "usb_claim_interface error" occurred

Posted: Mon Feb 11, 2019 3:51 am
by ab1jx
Never mind, I found it. I hadn't worked on this in a year or so so in this new version I tried to init the dongle, and that worked so I called the function that starts up my threads and wham. I had forgotten that my thread starting function starts the RF thread, which inits the dongle. So I was doing it to myself, nothing to to with DVB.