Digikam, I can only access camera as root user; openSuse 11.4 KDE

This showed up when I tried with Digikam, but I think the problem is system wide. With digikam I get “Failed to connect to the camera,” warnings if I add the camera manually and try to connect to it. I get nothing at all if I try to connect to “auto detected camera”.

I can access my Fuji Finepix S2000HD camera with DigiKam if I start Digikam as root user.

I tried accessing camera through Dolphin as ordinary user and the camera folder showed up, but clicking it produced “Unknown error code 150 Bad parameters Please send a full bug report…” I also get the same error code if I try to access the camera with Gwenview.

I did a couple of hours of searching for the answer on the Internet, and found “solutions” with other linux distros that ranged from changing an entry in /etc/fstab, to building a set of rules for udev to use when someone attaches a camera. I do suspect that this is a “permissions” problem, but don’t know where to set things up in openSuse.

Any help you can give would be very much appreciated.

Does this camera have a actual HD?

If you open a terminal and become su -
and do

fdisk -l

does the camera show?
Show us the result:

Hi caf4926,
Thanks for your quick reply. The camera has no actual HD, I think that the “HD” in it’s name refers to the HD video that it can take. I did an fdisk -l as requested (results below) and also an lsusb. You will see the camera listed (last item) with the lsusb

fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x8f800000

Device Boot Start End Blocks Id System
/dev/sda1 * 63 21703814 10851876 83 Linux
/dev/sda2 21703815 25912844 2104515 82 Linux swap / Solaris
/dev/sda3 25912845 46893167 10490161+ 83 Linux
/dev/sda4 46893735 625137344 289121805 83 Linux

lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 058f:6362 Alcor Micro Corp. Flash Card Reader/Writer
Bus 002 Device 002: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 001 Device 013: ID 04cb:01e8 Fuji Photo Film Co., Ltd

I’ll have to come back to this
I have to run
Others can help in the mean time

Hi Ceramics

I’ve had something similar happen on occasion with my digital camera (KDE4.6.1, openSUSE 11.3) when I think I selected Dolphin via the notifier and was prompted with a password. I usually click ‘Ignore’ which then allows me to view photos via Dolphin as user. Anyway, try rebooting with a clean KDE session, reconnect the camera, and see if that fixes things for you. I would also check System Settings>>Device Actions (same as device notifier settings) and check that 'Open with File Manager for 'Camera" exists and contains ‘kioclient exec camera:/’

Try entering ‘camera:/’ in Dolphin’s location bar. Any error reported?

This may be a particular KDE update that resulted in this behaviour. I’m sure this has happened with 11.3 updates as well. Maybe check the Novell or KDE bug reports.

Another quick experiment: With your camera plugged in, execute the following (as user)

gphoto2 --auto-detect

Is your camera detected ok? Mine for reference (reported as generic PTP camera)

USB PTP Class Camera           usb:            
USB PTP Class Camera           usb:002,003   

If detected ok, now type the following

cd ~/
mkdir test
cd test
gphoto2 --get-all-files

Does that work ok?

As user, what groups are you a member of?

groups

Thankyou deano_ferrari for your suggestions.

I tried all the ones in your first reply, and camera:/ in Dolphin’s location bar gives the following error “Unknown error code 150 Bad parameters Please send a full bug report at http://bug.kde.org

I checked System Settings>>Device Actions, and 'Open with File Manager for 'Camera" exists and contains ‘kioclient exec camera:/’

I did the reboot and reconnected the camera with the same results.

Your second “experiments” look promising. Here follow the results:

> groups
users video vboxusers

> gphoto2 --auto-detect
libusb couldn’t open USB device /dev/bus/usb/001/003: Permission denied.
libusb requires write access to USB device nodes.
Model Port

The same command as root gave the following:

gphoto2 --auto-detect

Model Port

Fuji FinePix S2000HD usb:001,007

My guess is that I need permissions for gphoto2 to do its detective work?

I just checked that I can access my usb memory stick as my ordinary non root self, and that does work OK.

Out of interest,… I have been running Windows and Ubuntu via the marvellous VirtualBox, and both can happily download photos from my camera, which is at least a little amusing seeing as their host system can’t!

I have /etc/udev/rules.d/90-libgphoto2.rules, and this has entries assigning camera devices ‘lp’ group ownership. So, try adding the relevant user to this group via

YaST >> Security and Users >> User and Group Management

Out of interest,… I have been running Windows and Ubuntu via the marvellous VirtualBox, and both can happily download photos from my camera, which is at least a little amusing seeing as their host system can’t!

Yes, but they’ll be accessing the usb interface with root permissions via the host.

Ah, I think you may have found the problem… I have looked in /etc/udev/rules.d/ and I have no entry at all for “90-libgphoto2.rules” .

I had a search and came across this from "old nabble"Old Nabble - gphoto-user - Re: generating missing udev rules to sense all supported cameras OR why do I have to be root to use gphoto2

"Under Ubuntu Hardy Heron I was missing the udev rules to needed
to use my Nikon D50. This forced me to be root to use gphoto2 with
the Nikon D50. The permanent fix for this problem is to generate
and install the required udev rules via the following command sequence:

1)>./print-camera-list udev-rules version 0.98 mode 0666 > ./90-libgphoto2.rules
2)>sudo cp ./90-libgphoto2.rules /etc/udev/rules.d/.
3)>sudo /etc/init.d/udev restart

The program print-camera-list is part of the libgphoto2 source."

I am tempted to try that, but don’t know if the version or mode that he uses for udev-rules would be correct for our system as he was writing a year ago about a Ubuntu issue.
I wondered if you would mind printing your 90-libgphoto2.rules so that I could see what we should be aiming for?

Anyway, many thanks for progress thus far.

Something like this should work (as root):

/usr/lib/libgphoto2/print-camera-list udev-rules mode 0660 version 0.98 group lp > /etc/udev/rules.d/90-libgphoto2.rules

Some distros use other group names eg ‘camera’.

My 90-libgphoto2.rules entries look like (first and last few lines shown):

# udev rules file for libgphoto2 devices (for udev 0.98 version)
# Created from this library:
#   libgphoto2      2.4.9          gcc, ltdl, EXIF
#   libgphoto2_port 0.8.0          gcc, ltdl, USB, serial lockdev locking
#
# this file is autogenerated, local changes will be LOST on upgrades
ACTION!="add", GOTO="libgphoto2_rules_end"
SUBSYSTEM!="usb|usb_device", GOTO="libgphoto2_usb_end"

ATTRS{idVendor}=="0553", ATTRS{idProduct}=="0202", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0403", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0404", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="04fc", ATTRS{idProduct}=="504b", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="0553", ATTRS{idProduct}=="0202", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="04fc", ATTRS{idProduct}=="504a", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="0553", ATTRS{idProduct}=="0202", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="08ca", ATTRS{idProduct}=="0111", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="04fc", ATTRS{idProduct}=="504a", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="04fc", ATTRS{idProduct}=="504b", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="0402", ATTRS{idProduct}=="5668", ENV{ID_MEDIA_PLAYER}="1", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="0979", ATTRS{idProduct}=="0224", MODE="0660", GROUP="lp"
#
#
#
#
ATTRS{idVendor}=="0d64", ATTRS{idProduct}=="1001", MODE="0660", GROUP="lp"
PROGRAM="check-ptp-camera 06/01/01", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="2770", ATTRS{idProduct}=="9120", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="2770", ATTRS{idProduct}=="9120", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="093a", ATTRS{idProduct}=="010e", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="093a", ATTRS{idProduct}=="010f", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="0c45", ATTRS{idProduct}=="800a", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="2770", ATTRS{idProduct}=="905c", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="0c45", ATTRS{idProduct}=="8001", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="041e", ATTRS{idProduct}=="6000", ENV{ID_MEDIA_PLAYER}="1", MODE="0660", GROUP="lp"
ATTRS{idVendor}=="2770", ATTRS{idProduct}=="905c", MODE="0660", GROUP="lp"

LABEL="libgphoto2_usb_end"

KERNEL=="sg[0-9]*", ATTRS{idVendor}=="1908", ATTRS{idProduct}=="1315", MODE="0660", GROUP="lp"
KERNEL=="sg[0-9]*", ATTRS{idVendor}=="1908", ATTRS{idProduct}=="1320", MODE="0660", GROUP="lp"
KERNEL=="sg[0-9]*", ATTRS{idVendor}=="1908", ATTRS{idProduct}=="0102", MODE="0660", GROUP="lp"
KERNEL=="sd[a-z]*", ATTRS{idVendor}=="1403", ATTRS{idProduct}=="0001", MODE="0660", GROUP="lp"

LABEL="libgphoto2_rules_end"

BTW, to reload the rules (for openSUSE) without restarting udev:

udevadm control --reload-rules

Thanks deano_ferrari for your help.

I followed your instructions, and the code “/usr/lib/libgphoto2/print-camera-list udev-rules mode 0660 version 0.98 group lp > /etc/udev/rules.d/90-libgphoto2.rules” worked nicely, producing a set of udev-rules in the right place. I added myself to the lp group, and rebooted the computer, but… sadly, no luck. Still the same problems and “unknown error code 150” warnings.

I had a look at my other computer which has openSuse 11.4 LXDE on board. This has no problems with connecting to cameras. I looked into the udev-rules, and it was the same on that computer as it had been on this computer before adding the libgphoto2.rules.

I looked at /etc/fstab on my other computer, and this has an extra line in it that this computer doesn’t have, “usbfs /proc/bus/usb usbfs noauto 00”. So I added the line to /etc/fstab on this computer, but this has not made any difference.

To help rule out KDE from the equation, I installed the LXDE desktop on this computer and rebooted, then logged into LXDE instead of my usual KDE session. Sadly, just the same problems.

When I boot up I do notice messages such as these at one stage in the process:
“Apr 5 12:17:08 linux-5v1a udevd-work[1064]: kernel-provided name ‘bus/usb/001/004’ and NAME= ‘vboxusb/1/4’ disagree, please use SYMLINK+= or change the kernel to provide the proper name”

Probably has nothing to do with the problem, but I do note it because it concerns bus/usb and udev.
(I took the above out of /var/log/warn).

I am a bit tempted to do a fresh install and to see if the problem goes away. It might have been a read error of the dvd that has muddled something up. I would have expected lots of posts relating to not being able to connect to cameras if it were a common bug. It is encouraging that the other computer I have here works well with openSuse LXDE.

I’ll try running openSuse KDE off a live CD and see if there are issues, but I suspect that it will be OK.

When I boot up I do notice messages such as these at one stage in the process:
“Apr 5 12:17:08 linux-5v1a udevd-work[1064]: kernel-provided name ‘bus/usb/001/004’ and NAME= ‘vboxusb/1/4’ disagree, please use SYMLINK+= or change the kernel to provide the proper name”

Are you running openSUSE within vbox?

I’ll try running openSuse KDE off a live CD and see if there are issues, but I suspect that it will be OK.

That is a good idea.

One more thing that I’ve just become aware of via this thread, are potential polkit issues. Now, I don’t have a good handle on this yet, but lets have a look at your camera policies:

sudo cat /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.hal.device-access.camera.pkla

For reference, I get

[org.freedesktop.hal.device-access.camera]
Identity=unix-user:*
Action=org.freedesktop.hal.device-access.camera
ResultAny=auth_admin_keep
ResultInactive=yes
ResultActive=yes

How does yours compare?

Just to confirm, I am not running openSuse within virtualBox (sorry if I have confused things with my mentioning of virtualBox).

I ran the “cat /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.hal.device-access.camera.pkla”

and I notice one difference; in the line beginning “Identity” I have “Identity=unix-group:*” and I notice that yours is “unix-user”…, which is interesting. All the other lines are identical with yours. I wonder if “group” needs to become “user” somewhere?

I did hop over and look at the thread regarding polkit issues, and I will do some more reading about that.

I’ll give my live cd a whirl too.

PS. as a rough and ready experiment I changed “group” to “user” in /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.hal.device-access.camera.pkla

Sadly…, the problem has not gone away!

Problem Solved

It was all my fault, and I am very sorry to have taken up so much of your time. It turns out that the problem was caused by something that I changed in /etc/udev/rules.d/60-vboxdrv.rules. When I first installed virtualBox, I found that the usb ports were greyed out. This was a problem that many people experienced, and many “fixes” were posted all over the place on the net. Whilst trying to sort it out, I stumbled upon two lines that are commented out in 60-vboxdrv.rules.

They are the ones that begin “SUBSYSTEM” as follows:
KERNEL==“vboxdrv”, NAME=“vboxdrv”, OWNER=“root”, GROUP=“root”, MODE=“0600”
#these two lines give access permission to vboxusers to properly work with usb nodes, this could be security risk (bnc#664520) !!
#SUBSYSTEM==“usb_device”, ATTR{devnum}=="?", ATTR{busnum}=="?",NAME=“vboxusb/$attr{busnum}/$attr{devnum}”, GROUP=“vboxusers”
#SUBSYSTEM==“usb”, ENV{DEVTYPE}==“usb_device”, ATTR{devnum}=="?", ATTR{busnum}=="?",NAME=“vboxusb/$attr{busnum}/$attr{devnum}”, GROUP=“vboxusers”

When these two lines are uncommented, then the usb connections from virtualBox work correctly. I was so pleased with this, that I nearly posted it as a “fix” and I am so glad that I did not!

What I did not realise was that this change would muck up my host system!

Anyway, with these lines commented again, I now have full access to my camera. The only downside is that I will probably have to solve the virtualBox USB problem again!

Please accept my apologies for what has been a bit of a “wild goose chase”. It has been interesting for me finding a bit more out about the system though, and I have appreciated your efforts very much.

How do I put “Solved” at the beginning of this thread??

USB in virtual box should work fine if you use the version from here
VirtualBox
Virtual Box (Sun Version) Install HowTo

Thanks caf4926,
I’ll take a look at it. I guess that there must be a fix to the one I used from the repositories though, as, with the change to the file that I outlined above, it all went really well, but it is well beyond my knowledge to sort it.

Thanks for the update ceramics. You’ve learnt a lot in the process, and the info in this thread is bound to be of value to others with respect to usb access. :slight_smile: