Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Multimedia
  • Search

digicam usb permission problems

Help with creation, editing, or playback of sounds, images, or video. Amarok, audacious, mplayer, grip, cdparanoia and anything else that makes a sound or plays a video.
Post Reply
Advanced search
43 posts
  • 1
  • 2
  • Next
Author
Message
El_Presidente_Pufferfish
Veteran
Veteran
User avatar
Posts: 1179
Joined: Thu Jul 11, 2002 11:46 pm
Location: Seattle

digicam usb permission problems

  • Quote

Post by El_Presidente_Pufferfish » Thu Jun 01, 2006 3:40 pm

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: Select all

$ 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: Select all

# 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: Select all

# 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: Select all

$ 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)
Top
batistuta
Veteran
Veteran
User avatar
Posts: 1384
Joined: Fri Jul 29, 2005 3:54 pm
Location: Aachen

  • Quote

Post by batistuta » Fri Jun 02, 2006 8:21 am

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.
Top
El_Presidente_Pufferfish
Veteran
Veteran
User avatar
Posts: 1179
Joined: Thu Jul 11, 2002 11:46 pm
Location: Seattle

  • Quote

Post by El_Presidente_Pufferfish » Fri Jun 02, 2006 10:27 am

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
Top
batistuta
Veteran
Veteran
User avatar
Posts: 1384
Joined: Fri Jul 29, 2005 3:54 pm
Location: Aachen

  • Quote

Post by batistuta » Fri Jun 02, 2006 11:32 am

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:
Top
Kabuto
l33t
l33t
Posts: 701
Joined: Thu Aug 01, 2002 7:19 pm

  • Quote

Post by Kabuto » Fri Jun 02, 2006 3:02 pm

Very, very few Canon cameras are mass storage capable. They all use the ptp standard or the older canon protocol.
Top
batistuta
Veteran
Veteran
User avatar
Posts: 1384
Joined: Fri Jul 29, 2005 3:54 pm
Location: Aachen

  • Quote

Post by batistuta » Fri Jun 02, 2006 4:29 pm

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?
Top
El_Presidente_Pufferfish
Veteran
Veteran
User avatar
Posts: 1179
Joined: Thu Jul 11, 2002 11:46 pm
Location: Seattle

  • Quote

Post by El_Presidente_Pufferfish » Fri Jun 02, 2006 5:49 pm

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
Top
batistuta
Veteran
Veteran
User avatar
Posts: 1384
Joined: Fri Jul 29, 2005 3:54 pm
Location: Aachen

  • Quote

Post by batistuta » Fri Jun 02, 2006 10:44 pm

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?
Top
El_Presidente_Pufferfish
Veteran
Veteran
User avatar
Posts: 1179
Joined: Thu Jul 11, 2002 11:46 pm
Location: Seattle

  • Quote

Post by El_Presidente_Pufferfish » Fri Jun 02, 2006 10:52 pm

I pretty much followed http://www.gphoto.org/doc/manual/permissions-usb.html to the letter

Code: Select all

# /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: Select all

$ gphoto2 --auto-detect
Model                          Port                                            
----------------------------------------------------------
Canon Digital IXUS II (normal mode) usb:            
Canon Digital IXUS II (normal mode) usb:001,006 
Top
DeKay
n00b
n00b
Posts: 7
Joined: Sat Jul 02, 2005 4:41 pm

  • Quote

Post by DeKay » Sat Jun 03, 2006 10:48 pm

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: Select all

$ gphoto2 --auto-detect
Model                          Port                                            
----------------------------------------------------------
Canon Digital IXUS II (normal mode) usb:            
Canon Digital IXUS II (normal mode) usb:001,006 
Top
El_Presidente_Pufferfish
Veteran
Veteran
User avatar
Posts: 1179
Joined: Thu Jul 11, 2002 11:46 pm
Location: Seattle

  • Quote

Post by El_Presidente_Pufferfish » Sat Jun 03, 2006 11:48 pm

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: Select all

# 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
Top
evoweiss
Veteran
Veteran
User avatar
Posts: 1678
Joined: Sun Sep 07, 2003 10:40 am
Location: Edinburgh, UK

  • Quote

Post by evoweiss » Wed Jun 07, 2006 10:46 pm

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
Top
evoweiss
Veteran
Veteran
User avatar
Posts: 1678
Joined: Sun Sep 07, 2003 10:40 am
Location: Edinburgh, UK

  • Quote

Post by evoweiss » Thu Jun 08, 2006 7:13 am

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
Top
El_Presidente_Pufferfish
Veteran
Veteran
User avatar
Posts: 1179
Joined: Thu Jul 11, 2002 11:46 pm
Location: Seattle

  • Quote

Post by El_Presidente_Pufferfish » Thu Jun 08, 2006 9:55 am

I already am a member of the usb group :(
Top
kion
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 78
Joined: Sun Jan 09, 2005 8:41 pm
Location: Kończyce Wlk - Cieszyn PL

  • Quote

Post by kion » Sun Jun 11, 2006 10:19 am

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
Top
evoweiss
Veteran
Veteran
User avatar
Posts: 1678
Joined: Sun Sep 07, 2003 10:40 am
Location: Edinburgh, UK

  • Quote

Post by evoweiss » Sun Jun 11, 2006 10:21 am

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
Top
slano
n00b
n00b
Posts: 41
Joined: Sun Dec 07, 2003 12:12 am

  • Quote

Post by slano » Mon Jun 12, 2006 10:37 pm

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 :(
Top
pgrdsl
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 93
Joined: Thu Aug 29, 2002 8:51 pm
Location: Southampton, UK

  • Quote

Post by pgrdsl » Fri Jun 16, 2006 7:14 pm

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
Top
pgrdsl
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 93
Joined: Thu Aug 29, 2002 8:51 pm
Location: Southampton, UK

  • Quote

Post by pgrdsl » Fri Jun 16, 2006 7:28 pm

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: Select all

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
Top
astralbat
n00b
n00b
Posts: 33
Joined: Sun Jan 23, 2005 7:44 pm

  • Quote

Post by astralbat » Tue Jul 04, 2006 9:18 pm

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: Select all

lsusb -v
as root.
Top
dj-tj
n00b
n00b
Posts: 3
Joined: Fri Jul 21, 2006 3:14 pm
Location: Germany

  • Quote

Post by dj-tj » Fri Jul 21, 2006 3:22 pm

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: Select all

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: Select all

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?
Top
astralbat
n00b
n00b
Posts: 33
Joined: Sun Jan 23, 2005 7:44 pm

  • Quote

Post by astralbat » Fri Jul 21, 2006 6:32 pm

hmmm, the rule looks fine to me.
Are there any line breaks in the rule itself? Not sure if that would cause a problem
Top
dj-tj
n00b
n00b
Posts: 3
Joined: Fri Jul 21, 2006 3:14 pm
Location: Germany

  • Quote

Post by dj-tj » Fri Jul 21, 2006 7:03 pm

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: Select all

SYSFS{idVendor}="04a9", SYSFS{idProduct}="3073"
-part, it works.
But then I don't need the rule at all :wink:
Top
El_Presidente_Pufferfish
Veteran
Veteran
User avatar
Posts: 1179
Joined: Thu Jul 11, 2002 11:46 pm
Location: Seattle

  • Quote

Post by El_Presidente_Pufferfish » Fri Jul 21, 2006 7:08 pm

Code: Select all

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
Top
astralbat
n00b
n00b
Posts: 33
Joined: Sun Jan 23, 2005 7:44 pm

  • Quote

Post by astralbat » Fri Jul 21, 2006 7:12 pm

dj-tj wrote: No, the rule has no line-breaks.
When I write the rule without the

Code: Select all

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?
Top
Post Reply

43 posts
  • 1
  • 2
  • Next

Return to “Multimedia”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic