SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Before I am told to search the forum, I have tried and it keep failing. Anyhow, the questions remains the same. Gphoto and digikam will only work as root. How do I fix it? Thanks
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152
Rep:
when something only works as root usually its a permission problem. they are trying to access something that your user doesn't have access to. try running these programs from inside an xterm and maybe it'll spit out an error that you couldn't see running them by clicking.
digikam works. As a user and as root. Same with gphoto. Both wil detect the camera as root and a user. But neither will access the camera as a normal user. with digikam there is no output as the gui just says "Failed to connect to camera". This is the output of gphoto:
justin@lola:~$ gphoto2 -P
*** 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 -P
Please make sure there is sufficient quoting around the arguments.
I know it is a permissions issue. My question is, how do i fix it?
I used to have this problem. If I remember right, the fix was to make sure that you have /etc/hotplug/usb/usbcam and that it looks like this:
Code:
#!/bin/bash
# $Id: usbcam.console,v 1.4 2002/09/12 16:50:18 hun Exp $
#
# /etc/hotplug/usb/usbcam
#
# Sets up newly plugged in USB camera so that the user who owns
# the console according to pam_console can access it from user space
#
# 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 setup using pam_console creates the respective lock files
# containing the name of the respective user. You can check for that
# by executing "echo `cat /var/{run,lock}/console.lock`" and
# verifying the appropriate user is mentioned somewhere there.
# 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
# New code, using lock files instead of copying /dev/console permissions
# This also works with non-gdm logins (e.g. on a virtual terminal)
# Idea and code from Nalin Dahyabhai <nalin@redhat.com>
if [ -f /var/run/console/console.lock ]
then
CONSOLEOWNER=`cat /var/run/console/console.lock`
elif [ -f /var/lock/console.lock ]
then
CONSOLEOWNER=`cat /var/lock/console.lock`
else
CONSOLEOWNER=
fi
if [ -n "$CONSOLEOWNER" ]
then
chmod 0000 "${DEVICE}"
chown "$CONSOLEOWNER" "${DEVICE}"
chmod 0600 "${DEVICE}"
fi
fi
If I remember right, hte file I had before was pointing to the wrong location for console.lock.
What should the permission be set at in /etc/hotplug/usb/usbcam?
With the usbcam file that I have, the permissions of the camera are set to 600, witrh the owner being whoever is listed in /var/run/console/console.lock. You plug in the camera, you have the console.lock, you are able to use the camera.
It's possible that this is only able to work because of PAM. I am running Dropline.
What is the output of:
Code:
echo `cat /var/run/console/console.lock`
For me, it is the name of the user currently on the desktop.
Quote:
Also, I tried to chnage the permission of the usb devices in proc. Still no luck.
Did you have the right one? This works every time for me. There is no reason it shouldn't.
here's what worked for me but i give no guarantees if this would work for you or not. but try it anyways.
1. Create a group called "camera" (without the quotes...)
2. Still as root - add your user to that group (the non-root user)
3. Log out and then back in (to reset your groups).
4. Either rename /etc/hotplug/usb.usermap.new to usb.usermap or copy its contents across (cat usb.usermap.new >> usb.usermap).
Now, when you plug in the camera it should appear under /proc/bus/usb/devices and you should be able to access it through gphoto2/digikam/whatever other front-end you choose.
Actually I changed them both, the permissions on the usb devices in proc. But you both are right, I need to make sure that things are set the correct way incase I elect not run KDE in the future. I'll keep plugging away at it. Thanks for the help.
Having the same problem. Works fine as root, not as user. Tried all of the suggestions here but still can't get it to work. Can someone please tell me what permissions you had to change?
In reference to Shilo's post on usbcam in hotplug the base Slackware install does not come with PAM. There are a total of 4 usbcam scripts available in Gphoto2.
I make a camera group and add myself to it.
Then use the usbcam.group script which I copy to /etc/hotplug/usb and rename usbcam. There are also usbcam.user and usbcam.X11_app scripts.
The instructions are available on the gphoto2 website.
Thank you shepper. Worked great. I know I should have done a little more research and found the answer myself, but I think my brain had left for the 4th of July weekend before I did. lol.
MagicMan
P.S. I hope everyone enjoyed their 4th as much as I did.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.