Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
digicam usb permission problems
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Thu Jun 01, 2006 3:40 pm    Post subject: digicam usb permission problems Reply with quote

Hello, i'm trying to get my canon powershot sd100 working again( worked fine last time I used it )
It is connected via USB, and I am using gphoto2 and gtkam to access it.

as root gphoto2 works fine, but as my user it returns
Code:
$ gphoto2 --summary
                                                                               
*** Error ***             
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (Operation not permitted). Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') ***       

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <gphoto-devel@lists.sourceforge.net>, please run
gphoto2 as follows:

    env LANG=C gphoto2 --debug --summary

Please make sure there is sufficient quoting around the arguments.


I believe my /etc/hotplug/usb/usbcam script is set up right:
Code:
# cat /etc/hotplug/usb/usbcam
#!/bin/bash
# $Id: usbcam.group,v 1.3 2003/09/16 16:42:44 hun Exp $
#
# /etc/hotplug/usb/usbcam
#
# Sets up newly plugged in USB camera so that only members of the
# group

GROUP=plugdev

# can access it from user space. (Replace camera with the name of the
# group you want to have access to the cameras.)
#
# Note that for this script to work, you'll need all of the following:
# a) a line in the file /etc/hotplug/usermap that corresponds to the
#    camera you are using. You can get the correct lines for all cameras
#    supported by libgphoto2 by running "print-usb-usermap".
# b) a group "camera" where all users allowed access to the
#    camera are listed
# c) a Linux kernel supporting hotplug and usbdevfs
# d) the hotplug package (http://linux-hotplug.sourceforge.net/)
#
# In the usermap file, the first field "usb module" should be named
# "usbcam" like this script.
#

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
    chmod o-rwx "${DEVICE}"
    chgrp "${GROUP}" "${DEVICE}"
    chmod g+rw "${DEVICE}"
fi


The permissions seem proper:
Code:
# ls -lR /proc/bus/usb
...
-rw-rw---- 1 root plugdev 57 Jun  1 11:33 008
...


and my user seems to be in all the proper groups( usb, plugdev )
Code:
$ id
uid=1000(pufferfish) gid=100(users) groups=6(disk),10(wheel),16(cron),18(audio),19(cdrom),27(video),35(games),80(cdrw),85(usb),100(users),245(locate),250(portage),409(plugdev)
Back to top
View user's profile Send private message
batistuta
Veteran
Veteran


Joined: 29 Jul 2005
Posts: 1384
Location: Aachen

PostPosted: Fri Jun 02, 2006 8:21 am    Post subject: Reply with quote

can you access the camera memory as a normal usb-flash drive? If not, then it's something with the USB. If yes, it's something with the camera SW.
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Fri Jun 02, 2006 10:27 am    Post subject: Reply with quote

batistuta wrote:
can you access the camera memory as a normal usb-flash drive? If not, then it's something with the USB. If yes, it's something with the camera SW.


no, this camera can't be accessed like a flash drive, as far as I know, you must use gphoto2 to access it
Back to top
View user's profile Send private message
batistuta
Veteran
Veteran


Joined: 29 Jul 2005
Posts: 1384
Location: Aachen

PostPosted: Fri Jun 02, 2006 11:32 am    Post subject: Reply with quote

I find this hard to believe. Could you confirm this? Could you boot on Winblows or some liveCD like Ubuntu and check if you don't see your camera drive mounted? I really can't believe that you can't mount the SD card as a USB drive :roll:
Back to top
View user's profile Send private message
Kabuto
l33t
l33t


Joined: 01 Aug 2002
Posts: 701

PostPosted: Fri Jun 02, 2006 3:02 pm    Post subject: Reply with quote

Very, very few Canon cameras are mass storage capable. They all use the ptp standard or the older canon protocol.
Back to top
View user's profile Send private message
batistuta
Veteran
Veteran


Joined: 29 Jul 2005
Posts: 1384
Location: Aachen

PostPosted: Fri Jun 02, 2006 4:29 pm    Post subject: Reply with quote

OK, sorry for my ignorance :D
so the next thing I'd try is to make sure that your USB stuff is working fin. Can you access some other USB mass storage device? An ipod, a USB stick, or something?
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Fri Jun 02, 2006 5:49 pm    Post subject: Reply with quote

batistuta wrote:
OK, sorry for my ignorance :D
so the next thing I'd try is to make sure that your USB stuff is working fin. Can you access some other USB mass storage device? An ipod, a USB stick, or something?


my usb stick and mp3 player both work perfectly
Back to top
View user's profile Send private message
batistuta
Veteran
Veteran


Joined: 29 Jul 2005
Posts: 1384
Location: Aachen

PostPosted: Fri Jun 02, 2006 10:44 pm    Post subject: Reply with quote

I'm kind of walking on unknown terrain here. At least I know that I won't ever by a cannon... how do you backup your pictures to CD when you are on a long trip? Ok, that's an off-topic question

Back to your issue... the script /etc/hotplug/usb/usbcam says that you should add aline to /etc/hotplug/usermap and run the script print-usb-usermpa. Have you investigated that?
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Fri Jun 02, 2006 10:52 pm    Post subject: Reply with quote

I pretty much followed http://www.gphoto.org/doc/manual/permissions-usb.html to the letter
Code:
# /usr/lib/libgphoto2/print-usb-usermap > /etc/hotplug/usb/usbcam.usermap


i chmodded /etc/hotplug/usb/usbcam
and then i turned on the camera, which creates the appropriate nodes
the camera has permissions of -rw-rw---- 1 root plugdev, which as i understand should be read/writeable to anybody in the 'plugdev' group, which i am a part of. which is what stumps me.

edit - gphoto2 detects it as user, just cant access it
Code:
$ gphoto2 --auto-detect
Model                          Port                                           
----------------------------------------------------------
Canon Digital IXUS II (normal mode) usb:           
Canon Digital IXUS II (normal mode) usb:001,006
Back to top
View user's profile Send private message
DeKay
n00b
n00b


Joined: 02 Jul 2005
Posts: 7

PostPosted: Sat Jun 03, 2006 10:48 pm    Post subject: Reply with quote

I had the same problem where detect worked but access didn't on my Powershot A70. Updating libgphoto2 fixed it for me.

El_Presidente_Pufferfish wrote:

edit - gphoto2 detects it as user, just cant access it
Code:
$ gphoto2 --auto-detect
Model                          Port                                           
----------------------------------------------------------
Canon Digital IXUS II (normal mode) usb:           
Canon Digital IXUS II (normal mode) usb:001,006
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Sat Jun 03, 2006 11:48 pm    Post subject: Reply with quote

DeKay wrote:
I had the same problem where detect worked but access didn't on my Powershot A70. Updating libgphoto2 fixed it for me.


I have the latest in portage :(
Code:
# emerge libgphoto2 -vp

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] media-libs/libgphoto2-2.1.6-r2  USE="-doc -exif -nls -nousb" 0 kB

Total size of downloads: 0 kB
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1678
Location: Edinburgh, UK

PostPosted: Wed Jun 07, 2006 10:46 pm    Post subject: Reply with quote

Unfortunately, I'm suffering from the same problems and have tried many of the posted solutions. I also tried using the console method, but that's failed too. Again, accessing the camera works if I'm root.

Alex
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1678
Location: Edinburgh, UK

PostPosted: Thu Jun 08, 2006 7:13 am    Post subject: Reply with quote

Hey everybody,

I think I have this problem licked! Apparently, for some reason, you now also have to be a member of the usb group! I added myself and everything's working as before. Give it a shot, and, if it works out, change the subject header!

Alex
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Thu Jun 08, 2006 9:55 am    Post subject: Reply with quote

I already am a member of the usb group :(
Back to top
View user's profile Send private message
kion
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jan 2005
Posts: 78
Location: Kończyce Wlk - Cieszyn PL

PostPosted: Sun Jun 11, 2006 10:19 am    Post subject: Reply with quote

did U fix the problem?

I'm already a member of groups: usb and plugdev. The same problem. Maybe the problem is connected to udev?
_________________
pozdrawiam/best regards
JID: kion@chrome.pl
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1678
Location: Edinburgh, UK

PostPosted: Sun Jun 11, 2006 10:21 am    Post subject: Reply with quote

kion wrote:
did U fix the problem?

I'm already a member of groups: usb and plugdev. The same problem. Maybe the problem is connected to udev?


It's working fine for me now, so I am not having trouble with it.

Alex
Back to top
View user's profile Send private message
slano
n00b
n00b


Joined: 07 Dec 2003
Posts: 41

PostPosted: Mon Jun 12, 2006 10:37 pm    Post subject: Reply with quote

Having the same problem here, as a root I'm able to access photos, but as a normal user not. The usb node in /proc/bus/sub that belongs to camera is owned by group plugdev (which I'm member of) but no luck. Anybody found a solution? I guess I've tried everything :(
Back to top
View user's profile Send private message
pgrdsl
Tux's lil' helper
Tux's lil' helper


Joined: 29 Aug 2002
Posts: 93
Location: Southampton, UK

PostPosted: Fri Jun 16, 2006 7:14 pm    Post subject: Reply with quote

The problem isn't with the permissions for /proc/bus/usb/###/### (which the hotplug script sets correctly, btw), but with /dev/bus/usb/###/### (the same device numbers as under /proc).
Do an strace on gphoto2 and you'll see that libgphoto2 is trying to open /dev/bus/usb/###/### for writing - which it can't do as a normal user, but can as root. With the current udev, the permissions are set to 644 and owner is root.root.

I'm having a play with udev rules to try and sort it out, but my udev is a bit rusty :(
_________________
pihl
Back to top
View user's profile Send private message
pgrdsl
Tux's lil' helper
Tux's lil' helper


Joined: 29 Aug 2002
Posts: 93
Location: Southampton, UK

PostPosted: Fri Jun 16, 2006 7:28 pm    Post subject: Reply with quote

pgrdsl wrote:
I'm having a play with udev rules to try and sort it out, but my udev is a bit rusty :(

This is the best I can come up with - create /etc/udev/rules.d/10-local-camera.rules containing something like:
Code:
SUBSYSTEM=="usb_device", SYSFS{idVendor}="04a9", SYSFS{idProduct}="30ef", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0660", GROUP="plugdev"

The exact idVendor and idProduct can be got from /proc/bus/usb/devices (or under /sys). This is shamelessly stolen from 50-udev.rules, with just updates for selection on vendor and product, and setting the "correct" mode and group for the latest (~x86) udev/hotplug/gphoto2/libgphoto2. These values are correct for the Canon EOS350D.

It's rather better than the solution that sets these permissions for all usb devices :)
_________________
pihl
Back to top
View user's profile Send private message
astralbat
n00b
n00b


Joined: 23 Jan 2005
Posts: 33

PostPosted: Tue Jul 04, 2006 9:18 pm    Post subject: Reply with quote

Thanks!
Got this working for my Powershot A85.
Just what I was looking for. The other threads weren't of much help, and your right - your way is more secure :-)

TIP: To others out there who want to figure out your vendor and device IDs, just run
Code:
lsusb -v
as root.
Back to top
View user's profile Send private message
dj-tj
n00b
n00b


Joined: 21 Jul 2006
Posts: 3
Location: Germany

PostPosted: Fri Jul 21, 2006 3:22 pm    Post subject: Reply with quote

Hi.
I have the same problem with my Powershot A70 and tried that with the udev-rule ...
But it doesn't work here.

I get these errors in /var/log/messages:
Code:
Jul 21 17:18:31 thor udevd[1078]: add_to_rules: invalid SYSFS operation
Jul 21 17:18:31 thor udevd[1078]: add_to_rules: invalid rule '/etc/udev/rules.d/20-camera.rules:1'

And this is my rules-file:
Code:
SUBSYSTEM=="usb_device", SYSFS{idVendor}="04a9", SYSFS{idProduct}="3073", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0664", GROUP="plugdev"

idVendor and idProduct are correct .. no idea, why it's not working here.

Any idea what is causing the error?
Back to top
View user's profile Send private message
astralbat
n00b
n00b


Joined: 23 Jan 2005
Posts: 33

PostPosted: Fri Jul 21, 2006 6:32 pm    Post subject: Reply with quote

hmmm, the rule looks fine to me.
Are there any line breaks in the rule itself? Not sure if that would cause a problem
Back to top
View user's profile Send private message
dj-tj
n00b
n00b


Joined: 21 Jul 2006
Posts: 3
Location: Germany

PostPosted: Fri Jul 21, 2006 7:03 pm    Post subject: Reply with quote

astralbat wrote:
Are there any line breaks in the rule itself? Not sure if that would cause a problem

No, the rule has no line-breaks.
When I write the rule without the
Code:
SYSFS{idVendor}="04a9", SYSFS{idProduct}="3073"
-part, it works.
But then I don't need the rule at all :wink:
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Fri Jul 21, 2006 7:08 pm    Post subject: Reply with quote

Code:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="3072", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0660", GROUP="plugdev"


works for me
try to use ==(double equals) for idVendor and idProduct
Back to top
View user's profile Send private message
astralbat
n00b
n00b


Joined: 23 Jan 2005
Posts: 33

PostPosted: Fri Jul 21, 2006 7:12 pm    Post subject: Reply with quote

dj-tj wrote:

No, the rule has no line-breaks.
When I write the rule without the
Code:
SYSFS{idVendor}="04a9", SYSFS{idProduct}="3073"
-part, it works.
But then I don't need the rule at all :wink:


Are you running an up to date version of udev?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum