"Konnte die Schnittstelle auf der Kamera nicht beanspruchen: -6" beim Versuch, eine USB-Kamera (Kinect) anzuschließen

5833
rzetterberg

Ich habe die Freenect-Bibliothek von openkinect.org installiert . Mit dieser Bibliothek gibt es eine Demoanwendung, die Sie vom Terminal aus starten können, um Kinect zu testen. Wenn ich diesen Befehl ausführen, erhalte ich jedoch folgende Ausgabe:

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

Dieser spezielle Fehler wird von der Bibliothek libusb durch die Funktion libusb_claim_interface ausgelöst und der Fehler -6 entspricht der LIBUSB_ERROR_BUSY. Meine Vermutung ist also, dass es etwas mit der Montage des USB zu tun hat und nicht speziell mit der freenectLibrary oder dem Kinect.

Meine Frage ist also, wie kann ich herausfinden, welche Ressource diese Schnittstelle verwendet und wie kann ich sie freigeben, damit ich darauf zugreifen kann?

Bearbeiten:

Was ich bisher ausprobiert habe (nur um sicher zu sein):

  • Neustart
  • Ausgesteckt, gesteckt
  • Versuchte verschiedene USB-Ports
  • Udev neu gestartet

Zusätzliche Informationen, die nützlich sein könnten:

/ 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 Version 3.0.0-14-generic-pae # 23-Ubuntu SMP Mo 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" 
5

4 Antworten auf die Frage

2
harrymc

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.

Vielen Dank! Ich werde das testen und mich bei Ihnen melden. Bei meinem ersten Test habe ich root- und nicht-root-Benutzer verwendet. Möglicherweise funktioniert es, wenn ich die Berechtigungen meines Benutzers ohne Rootberechtigung richtig einstelle. rzetterberg vor 12 Jahren 0
2
Manwe

It sounds very much like that another driver is holding or using your device. Run:

lsusb 

And try to find the line with kinetic

Bus 002 Device 004: ID 046d:0850 Logitech, Inc. QuickCam Web 

Copy'n'paste the string after ID (like 046d:0850) to google and see if you happen to come across matching linux kernel module.

If your lucky then add it to the blacklisted modules. Create your own file to /etc/modprobe.d/blacklist-kinetic.conf

blacklist MODULENAME 

run depmod -a reboot and try again

Just be careful not to blacklist any modules that you actually need.

2
Shonn E

Das war etwas verwirrend, aber ich habe es endlich herausgefunden.

Die neueren Linux-Kernel verfügen über einen Treiber, der die Kinect als Web-Cam verwendet, und es scheint, als würde die Kinect-Cam zuerst angezogen, was zu einer Fehlermeldung führt, wenn Sie versuchen, freenect-glview auszuführen: "Die Schnittstelle der Kamera konnte nicht beansprucht werden : -6 ".

Führen Sie ein lsmod aus und leiten Sie das zu einem grep auf der gspca-Zeichenfolge, sodass Sie nur die gspca-Einträge sehen:

 lsmod | grep gspca gspca_kinect 12792 0 gspca_main 27610 1 gspca_kinect videodev 85626 1 gspca_main  modprobe -r gspca_kinect modprobe -r gspca_main 

Dann sollte der Freenect-Glview funktionieren.

1
George

Neuere Linux-Kernel haben die MS-gspca-Treiber installiert und werden nicht getrennt. Sie geben dir nur die RGB-Kamera und IR ohne Tiefe, also töte sie!

lsmod 

Sollte sie alle auflisten. Suchen Sie die beiden gspca-Module. Ich glaube, Kinect und Main.

then modprobe -r gspca_kinect 

Dann töten Sie den anderen und versuchen Sie es erneut mit freenect-glview. Das leben ist gut!