Linux – “Could not claim interface on camera: -6” when trying to connect usb camera (Kinect)

kinectlinuxusb

I have installed the freenect library from openkinect.org. With that library there is a demo application which you can run from the terminal to test out the Kinect. However when I run this command I get the following output:

richard@behemoth:~$ sudo freenect-glview 
Kinect camera test
Number of devices found: 1
Could not claim interface on camera: -6
Could not open device

This particular error is thrown by the library libusb by the function libusb_claim_interface and the error -6 corresponds to the LIBUSB_ERROR_BUSY. So my guess is that it has something to do with mounting the usb, rather than specifically the freenect library or the Kinect itself.

So my question is how can I find out what resource is using this interface and how can I free it so that I can access it?

Edit:

What I have tried so far (just to be sure):

  • Rebooted
  • Plugged-out, plugged-in
  • Tried different usb ports
  • Restarted udev

Additional information that might be useful:

/etc/fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=1c73f217-ac8d-451b-8390-7a680628a856 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=bb49bd29-07ec-45a0-bbab-46fb8362b06b none            swap    sw              0       0

sudo uname -r:

Linux behemoth 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686 i686 i386 GNU/Linux

cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION="Ubuntu 11.10"

Best Answer

I don't have your environment and cannot test, but this excerpt from the gphoto FAQ seems to say that this might be a matter of permissions, rather than some program monopolizing the interface.

The following quote contains a link to the Setting up permissions for USB ports chapter that you could check.

Why do I get the error message "Could not claim the USB device"?

You have to make sure that no such kernel module is loaded and that you have set up the permissions on your USB device correctly, such that you have (non-root) write access to the camera device. How to set this up, is described at Section 4.3, Setting up permissions for USB ports.

This can also happen with cameras that works as USB Mass Storage devices. A notable example is if you have an Olympus Camera that gets auto-detected as an Olympus C-2040Z. In this case, you can try, if you run Linux, to remove the usb-storage kernel module and attempt to use libgphoto2 with it. But, unless you want to control the camera (not all the model supports it), it is not a recommended solution. Keeps using USB Mass Storage. Some of these Olympus supports to be switched to "PC Control" mode in order to be remote controlled with an external program like one using libgphoto2.

Related Question