Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
camera works only as root
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
blibbleage
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2004
Posts: 84
Location: Cambridge, UK

PostPosted: Mon Mar 07, 2005 5:17 pm    Post subject: camera works only as root Reply with quote

Hi

I know there's a few threads around with the above title, but I've read all that I could find with no success. As stated, my Kodak DX3600 camera only works (using gphoto2 --shell) as root. I've tried editing /etc/hotplug/usb/usbcam to use "chmod 0666" instead of "0600" but that doesn't help. Any ideas on what to try next would be great.

I'm using kernel 2.6 and udev, and the camera was working fine until about a week ago. It might have been an update to udev that caused the problems, but I'm not sure about that. If you want me to run further tests, I'm happy to - just say what you need.

Thanks!
Back to top
View user's profile Send private message
blaster999
l33t
l33t


Joined: 09 May 2004
Posts: 902
Location: Between keyboard and chair

PostPosted: Mon Mar 07, 2005 5:26 pm    Post subject: Reply with quote

Are you a part of the "usb" group? Type "groups" to find out.
_________________
60s: sex, drugs, rock'n'roll
90s: sux, bugs, drag'n'drop
---
Some multimedia keys refuse to work? See my mini-howto:
https://forums.gentoo.org/viewtopic.php?p=1896734#1896734
Back to top
View user's profile Send private message
blibbleage
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2004
Posts: 84
Location: Cambridge, UK

PostPosted: Mon Mar 07, 2005 6:27 pm    Post subject: Reply with quote

Yes, I am:

Code:

tew24@beast ~ $ groups
wheel floppy audio cdrom video games cdrw usb users tew24 speech
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Mon Mar 07, 2005 6:42 pm    Post subject: Reply with quote

no debug messages? perhaps gphoto2 has a --verbose option or similar
pls show us a ` dmesg | tail -n 15 ` :wink:
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
blibbleage
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2004
Posts: 84
Location: Cambridge, UK

PostPosted: Mon Mar 07, 2005 7:03 pm    Post subject: Reply with quote

Sorry! I knew there was something I forgot to put in the post. There are debug messages:

Code:

tew24@beast ~ $ gphoto2 --shell
gphoto2: {/home/tew24} /> ls                                                   

*** 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') ***
gphoto2: {/home/tew24} />


but as root, I get:
Code:

beast tew24 # gphoto2 --shell
gphoto2: {/home/tew24} /> ls                                                   
store_00010001/     store_00020001/                                           
gphoto2: {/home/tew24} />



also, dmesg reports:
Code:

[fglrx] max   Inv = 134217728
[fglrx] total Inv = 134217728
[fglrx] total TIM = 0
[fglrx] total FB  = 0
[fglrx] total AGP = 8192
TCP: Treason uncloaked! Peer 209.225.0.34:80/37039 shrinks window 2956757772:2956759228. Repaired.
TCP: Treason uncloaked! Peer 209.225.0.34:80/37039 shrinks window 2956757772:2956759228. Repaired.
TCP: Treason uncloaked! Peer 209.225.0.34:80/37039 shrinks window 2956757772:2956759228. Repaired.
usb 3-1: new full speed USB device using ohci_hcd and address 11
usb 3-1: USB disconnect, address 11
usb 3-1: new full speed USB device using ohci_hcd and address 12
usb 3-1: USB disconnect, address 12
usb 3-1: new full speed USB device using ohci_hcd and address 13
usb 3-1: USB disconnect, address 13
usb 3-1: new full speed USB device using ohci_hcd and address 14
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Tue Mar 08, 2005 10:56 pm    Post subject: Reply with quote

hmm, because the debug messages doesn't show which /dev files are used by the program, run it as root, and then use lsof to see which files are opened by gphoto2.
-> emerge lsof
better, use
/usr/sbin/lsof -p $(pidof gphoto2)

and then, close gphoto2 and run
lsof | grep <interface name you got by the above command>
to see if any programs are still using this dev, for some weird reasons ^^

cya
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
blibbleage
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2004
Posts: 84
Location: Cambridge, UK

PostPosted: Wed Mar 09, 2005 8:34 am    Post subject: Reply with quote

Here's the relevant output text. I wasn't sure if I should check for the /dev items or the /proc/bus/usb so I did both.

gphoto2 running at this stage....

Code:

beast tew24 # lsof -p $(pidof gphoto2)
COMMAND  PID USER   FD   TYPE DEVICE    SIZE     NODE NAME
gphoto2 3101 root  cwd    DIR   33,1    4096  3194947 /home/tew24
gphoto2 3101 root  rtd    DIR   33,1    4096        2 /
gphoto2 3101 root  txt    REG   33,1   74152 14632425 /usr/bin/gphoto2
gphoto2 3101 root  mem    REG   33,1   62432 15028605 /usr/lib/gphoto2/2.1.5/libgphoto2_ptp2.so
gphoto2 3101 root  mem    REG   33,1   38172 15026890 /usr/lib/gphoto2_port/0.5.1/libgphoto2_port_usb.so
gphoto2 3101 root  mem    REG   33,1   10904 22822976 /lib/libdl-2.3.4.so
gphoto2 3101 root  mem    REG   33,1 1229232   950415 /lib/tls/libc-2.3.4.so
gphoto2 3101 root  mem    REG   33,1   26180 14762301 /usr/lib/libpopt.so.0.0.0
gphoto2 3101 root  mem    REG   33,1   24616 15027937 /usr/lib/libgphoto2_port.so.0.5.1
gphoto2 3101 root  mem    REG   33,1  111616 15026964 /usr/lib/libgphoto2.so.2.0.3
gphoto2 3101 root  mem    REG   33,1  182968 14828780 /lib/libreadline.so.5.0
gphoto2 3101 root  mem    REG   33,1   78436 14811568 /usr/lib/libexif.so.9.1.2
gphoto2 3101 root  mem    REG   33,1  123778   950409 /lib/tls/libpthread-2.3.4.so
gphoto2 3101 root  mem    REG   33,1  120732 15124201 /usr/lib/libjpeg.so.62.0.0
gphoto2 3101 root  mem    REG   33,1  383060 14550915 /usr/lib/libslang-utf8.so.1.4.9
gphoto2 3101 root  mem    REG   33,1   19588 14697872 /lib/libgpm.so.1.19.0
gphoto2 3101 root  mem    REG   33,1  949282 21037985 /usr/lib/libX11.so.6.2
gphoto2 3101 root  mem    REG   33,1  161816   950403 /lib/tls/libm-2.3.4.so
gphoto2 3101 root  mem    REG   33,1  104532 14713076 /usr/lib/libaa.so.1.0.4
gphoto2 3101 root  mem    REG   33,1  308012 15220860 /lib/libncursesw.so.5.4
gphoto2 3101 root  mem    REG   33,1  210112 14700335 /usr/lib/libcdk.so.1.0.0
gphoto2 3101 root  mem    REG   33,1   91392 22822972 /lib/ld-2.3.4.so
gphoto2 3101 root    0u   CHR  136,3                5 /dev/pts/3
gphoto2 3101 root    1u   CHR  136,3                5 /dev/pts/3
gphoto2 3101 root    2u   CHR  136,3                5 /dev/pts/3
gphoto2 3101 root    3r   DIR   33,1    8192  1688556 /usr/lib/gphoto2/2.1.5
gphoto2 3101 root    4r   REG   33,1      45  4391811 /root/.gphoto/settings
gphoto2 3101 root    5u   REG   0,11      57 55083635 /proc/bus/usb/002/004
beast tew24 #



closed gphoto2 at this stage...


Code:

beast tew24 # lsof |grep /dev/pts
bash       3089 tew24    0u      CHR      136,3                    5 /dev/pts/3
bash       3089 tew24    1u      CHR      136,3                    5 /dev/pts/3
bash       3089 tew24    2u      CHR      136,3                    5 /dev/pts/3
bash       3089 tew24  255u      CHR      136,3                    5 /dev/pts/3
su         3093  root    0u      CHR      136,3                    5 /dev/pts/3
su         3093  root    1u      CHR      136,3                    5 /dev/pts/3
su         3093  root    2u      CHR      136,3                    5 /dev/pts/3
bash       3096  root    0u      CHR      136,3                    5 /dev/pts/3
bash       3096  root    1u      CHR      136,3                    5 /dev/pts/3
bash       3096  root    2u      CHR      136,3                    5 /dev/pts/3
bash       3096  root  255u      CHR      136,3                    5 /dev/pts/3
bash       3104 tew24    0u      CHR      136,5                    7 /dev/pts/5
bash       3104 tew24    1u      CHR      136,5                    7 /dev/pts/5
bash       3104 tew24    2u      CHR      136,5                    7 /dev/pts/5
bash       3104 tew24  255u      CHR      136,5                    7 /dev/pts/5
su         3108  root    0u      CHR      136,5                    7 /dev/pts/5
su         3108  root    1u      CHR      136,5                    7 /dev/pts/5
su         3108  root    2u      CHR      136,5                    7 /dev/pts/5
bash       3111  root    0u      CHR      136,5                    7 /dev/pts/5
bash       3111  root    1u      CHR      136,5                    7 /dev/pts/5
bash       3111  root    2u      CHR      136,5                    7 /dev/pts/5
bash       3111  root  255u      CHR      136,5                    7 /dev/pts/5
lsof       3123  root    0u      CHR      136,5                    7 /dev/pts/5
lsof       3123  root    2u      CHR      136,5                    7 /dev/pts/5
grep       3124  root    1u      CHR      136,5                    7 /dev/pts/5
grep       3124  root    2u      CHR      136,5                    7 /dev/pts/5
kded       4695 tew24   14u      CHR      136,0                    2 /dev/pts/0
opera      4783 tew24    0u      CHR      136,1                    3 /dev/pts/1 (deleted)
opera      4783 tew24    1u      CHR      136,1                    3 /dev/pts/1 (deleted)
opera      4783 tew24    2u      CHR      136,1                    3 /dev/pts/1 (deleted)
operaplug  4800 tew24    1u      CHR      136,1                    3 /dev/pts/1 (deleted)
operaplug  4800 tew24    2u      CHR      136,1                    3 /dev/pts/1 (deleted)
operamoti  4802 tew24    0u      CHR      136,1                    3 /dev/pts/1 (deleted)
operamoti  4802 tew24    1u      CHR      136,1                    3 /dev/pts/1 (deleted)
operamoti  4802 tew24    2u      CHR      136,1                    3 /dev/pts/1 (deleted)
bash      19864 tew24    0u      CHR      136,4                    6 /dev/pts/4
bash      19864 tew24    1u      CHR      136,4                    6 /dev/pts/4
bash      19864 tew24    2u      CHR      136,4                    6 /dev/pts/4
bash      19864 tew24  255u      CHR      136,4                    6 /dev/pts/4
gaim      20080 tew24    0u      CHR      136,2                    4 /dev/pts/2 (deleted)
gaim      20080 tew24    1u      CHR      136,2                    4 /dev/pts/2 (deleted)
gaim      20080 tew24    2u      CHR      136,2                    4 /dev/pts/2 (deleted)
operamoti 29238 tew24    0u      CHR      136,1                    3 /dev/pts/1 (deleted)
operamoti 29238 tew24    1u      CHR      136,1                    3 /dev/pts/1 (deleted)
operamoti 29238 tew24    2u      CHR      136,1                    3 /dev/pts/1 (deleted)
beast tew24 #


Code:

beast tew24 # lsof |grep /proc/bus/usb/002/004
beast tew24 #
Back to top
View user's profile Send private message
blibbleage
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2004
Posts: 84
Location: Cambridge, UK

PostPosted: Wed Mar 09, 2005 8:36 am    Post subject: Reply with quote

If it's any help, I've now tried it with another camera (the Sony DSC-W1) with exactly the same results (works as root, not as user)
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Wed Mar 09, 2005 2:39 pm    Post subject: Reply with quote

hmm, alright
/dev/pts are the device files for your shell (you have three opened: stdin, stdout, stderr)
/proc/bus/usb/002/004 is the only file that seems to me being the one.
what showes ls -l /proc/bus/usb/002/004 ?
if only root can read/write, that's the trick, i guess.
perhaps lsof has another output when gphoto2 is just downloading pics from the camera.
if you can write at /proc/bus/usb/002/004 as normal user and the error occurs again, try lsof when downloading a pic.
otherwise just change the perms with 'chmod o+wr /proc/bus/usb/002/<current file>' or, if you are in the 'root' group(i hope you don't ^^) chmod g+rw ...

another idea is to start gphoto2 as normal user with xtrace...but let us first try the stuff above.
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
blibbleage
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2004
Posts: 84
Location: Cambridge, UK

PostPosted: Wed Mar 09, 2005 4:46 pm    Post subject: Reply with quote

Here's the results of ls (it was assigned to a different number this time I plugged it in).

Code:

beast tew24 # ls -l /proc/bus/usb/002/007
-rw-r--r--  1 root root 57 Mar  9 16:37 /proc/bus/usb/002/007
beast tew24 #


I then did this:

Code:

beast tew24 # chmod a+rw /proc/bus/usb/002/007
beast tew24 # ls -l /proc/bus/usb/002/007
-rw-rw-rw-  1 root root 57 Mar  9 16:37 /proc/bus/usb/002/007
beast tew24 #


and can now access it as a normal user, so thank you, it works! However, I'd like a way to make this permanent, so that each time I plug a camera in, it has permissions set like this - any idea what I should do?
Back to top
View user's profile Send private message
all-inc.
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138
Location: Darmstadt.Germany.EU

PostPosted: Wed Mar 09, 2005 5:55 pm    Post subject: Reply with quote

yeah, this is a job for the hotplug usb agent :)
/etc/hotplug/usb.agent, line 102-110 wrote:
# used to run config scripts for user mode drivers (jPhoto, gPhoto2,
# rio500 tools, etc) ... instead of naming kernel modules, it names
# config scripts. those could change $DEVICE permissions, etc.
#
# for purely user mode drivers, scripts $HOTPLUG_DIR/usb/NAME should be
# installed with usermap files in $HOTPLUG_DIR/usb/NAME.usermap instead
# of continuing to use/modify $MAP_USERMAP
#
MAP_USERMAP=$HOTPLUG_DIR/usb.usermap

when the camera is plugged in, make a cat /proc/bus/usb/devices to see the values you have to enter in usb/<camname>.usermap...
have a look at this for a detailed description how to set up hotplug to change the perm's.
_________________
# make config; not war
registered linux user # 265707
Back to top
View user's profile Send private message
blibbleage
Tux's lil' helper
Tux's lil' helper


Joined: 19 Aug 2004
Posts: 84
Location: Cambridge, UK

PostPosted: Thu Mar 10, 2005 11:33 am    Post subject: Reply with quote

Excellent, that works. Thank you!
Back to top
View user's profile Send private message
one-bit
n00b
n00b


Joined: 11 Mar 2005
Posts: 6

PostPosted: Sun Mar 13, 2005 7:10 am    Post subject: Reply with quote

Add group"camera" to gentoo box and your user to this group.
Utilize usbcam.group scripts

Code:

$> cp /usr/share/doc/libgphoto2-2.1.5/linux-hotplug/usbcam.group /etc/hotplug/usb/usbcam
$> chmod +x  /etc/hotplug/usb/usbcam


If you want utilize other group than "camera" edit GROUP in /etc/hotplug/usb/usbcam
Back to top
View user's profile Send private message
safeness
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jul 2004
Posts: 105
Location: Eastside, WA

PostPosted: Sat Apr 09, 2005 10:23 pm    Post subject: Reply with quote

Thanks for the tip one-bit. This worked great for me!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
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