Bug 189936 - Access to USB camera only as root user
Access to USB camera only as root user
Product: Fedora
Classification: Fedora
Component: gphoto2 (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Radek Vokal
Depends On:
  Show dependency treegraph
Reported: 2006-04-25 17:54 EDT by Richard Körber
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 2.1.99-14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-06-07 14:29:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Richard Körber 2006-04-25 17:54:22 EDT
Description of problem:
I connect a Canon EOS 300D by USB. When trying to access the camera as normal
user, I get an error message saying that the USB device could not be opened.
When I try this as root, it is working fine though.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Connect a digital camera (e.g. Canon EOS 300D) by USB
2. Try "gphoto2 -L" as normal user

Actual results:
I get the following error message:

*** Fehler ***
Ein Fehler trat in der IO-Bibliothek auf (»Konnte das USB-Gerät nicht
beanspruchen«): Konnte Schnittstelle 0 nicht reservieren (Die Operation ist
nicht erlaubt). Stellen Sie sicher, dass kein
anderes Programm oder Kernelmodul (z.B. sdc2xx, stv680, spca50x) das Gerät
verwendet und Sie
Lese- und Schreibrechte für das Gerät haben.
*** Fehler (-53: »Konnte das USB-Gerät nicht beanspruchen«) ***

Quick translation: "Could not claim USB device: Could not reserve device 0
(operation is not permitted)." ... "Error (-53: Could not claim USB device)"

Expected results:
Access to the camera. When I invoke "gphoto2 -L" as root, everything is as expected.

Additional info:
I assume that udev does not set proper rights to the USB device. There is no
kind of "gphoto2.rules" file in "/etc/udev/rules.d". I have tried the following
lines as "/etc/udev/rules.d/70-gphoto.rules":

# Canon EOS Kiss Digital (normal mode)
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="3084", MODE="0666"
# Canon EOS Kiss Digital (PTP mode)
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="3099", MODE="0666"

After that, gphoto2 was working as expected, even for a normal user.
Comment 1 Radek Vokal 2006-04-26 07:12:11 EDT
Can you try gphoto2-2.1.99-10 from rawhide? I did some fixes inside gphoto2
config scripts. Hal takes care of permissions, so this is not a udev rule
problem, but probably hal rule problem. 
Comment 2 Richard Körber 2006-04-26 12:27:32 EDT
Tried gphoto2-2.1.99-10, but it's still unchanged.
Comment 3 Andreas Heik 2006-06-07 10:03:37 EDT
There is a simple mismatch into hal-files from gphoto2-package:

is generated via /usr/lib/libgphoto2/print-usb-usermap --fdi.
This command create for every supported camera a entry with 
<merge key="camera.access_method" type="string">proprietary</merge>
but in the hal-policy-file
is no match for 
<match key="camera.access_method" string="proprietary"> defined.

Here is a diff with my  90-gphoto-camera-policy.fdi:

--- /usr/share/hal/fdi/policy/20thirdparty/90-gphoto-camera-policy.fdi.orig    
2006-06-07 15:50:30.000000000 +0200
+++ /usr/share/hal/fdi/policy/20thirdparty/90-gphoto-camera-policy.fdi 
2006-06-07 15:50:52.000000000 +0200
@@ -4,7 +4,7 @@

     <match key="info.capabilities" contains="camera">
-      <match key="camera.access_method" string="libgphoto2">
+      <match key="camera.access_method" string="proprietary">
         <append key="info.callouts.add"
       <match key="camera.access_method" string="ptp">
Comment 4 Radek Vokal 2006-06-07 14:29:37 EDT
Thanks, I've applied your patch on rawhide. Strange that this was all the time
working for me .. 
Comment 5 Andreas Heik 2006-06-08 02:43:49 EDT
I think your camera runs in ptp-mode. And there is another match in the

Note You need to log in before you can comment on or make changes to this bug.