Skip to Content.
Sympa Menu

sm-users - Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15

sm-users AT lists.ibiblio.org

Subject: Sourcemage Users List

List archive

Chronological Thread  
  • From: Flavien Bridault <vlaaad AT sourcemage.org>
  • To: sm-users AT lists.ibiblio.org
  • Subject: Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15
  • Date: Sat, 29 Apr 2006 16:22:14 +0200

Le samedi 29 avril 2006 à 04:48 -0500, Geoffrey Derber a écrit :
> I am having trouble accessing my camera with udev both the version from
> stable-rc and the version in test, along with the 2.6.15 kernel.
>
> Auto-detecting of the camera is not working. I found the note in FINAL for
> libgphoto2, however, I do not have any camera modules compiled in the
> kernel, so that did not help any.
>
> I did notice udev is creating a usb device in /dev, however, gphoto can not
> find the camera. I found the camera info in /sys.
>
> I've tried to find a solution, however I'm stumped. I tried both having
> hotplug installed, and not having it installed, either way, no difference.
>
> It was working with linux 2.6.14 and the older udev versions with hotplug
> installed.
>
> Anyone have any ideas on what I can do. I even tried to see if I could
> mount the node that udev creates, however I received an error message about
> the device not being a block device.
>
> Geoff

I'm currently working on that !
What is not working currently is if you use udev without hotplug. Then
you can't access the peripheral as a normal user (but that should work
as root). Note that libgphoto2 doesn't use the /dev/usbdev[0-9]*.[0-9]*
but the legacy usb
interface /proc/bus/usb/[0-9][0-9][0-9]/[0-9][0-9][0-9], so you need to
activate that option in the kernel. You can get it working for a normal
user manually with chgrp video this device.

I'm writing a udev rule to match the device along with a helper that try
to find if the product and vendor ids match something in the output
produced by /usr/lib/libgphoto2/print-usb-usermap (because this is the
only way I know to recognize a digital camera). All is fine far from
here except that I don't manage to get the /proc/bus/usb/... device with
my udev rule !

Here is the events recovered with udevmonitor --env when I
plug my camera :

UEVENT[1146218642.534402] add@/devices/pci0000:00/0000:00:1d.2/usb4/4-1
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.2/usb4/4-1
SUBSYSTEM=usb
SEQNUM=2221
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb

UEVENT[1146218642.543414]
add@/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1d.2/usb4/4-1/4-1:1.0
SUBSYSTEM=usb
SEQNUM=2222
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/004/085
PRODUCT=4a9/30bb/1
TYPE=0/0/0
INTERFACE=6/1/1
MODALIAS=usb:v04A9p30BBd0001dc00dsc00dp00ic06isc01ip01

UEVENT[1146218642.544978] add@/class/usb_device/usbdev4.85
ACTION=add
DEVPATH=/class/usb_device/usbdev4.85
SUBSYSTEM=usb_device
SEQNUM=2223
PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.2/usb4/4-1
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR=189
MINOR=468

I don't manage to get the DEVICE field ! I tried %s{device} or %
e{device} but that doesn't seem to work... Here is the udev rule I use :

KERNEL=="*", SUBSYSTEM=="usb_device", ACTION=="add", NAME="%k",
PROGRAM="gphoto2 %s{idVendor} %s{idProduct} %k", GROUP="%c"

I was thinking then that I chose the wrong subsystem and that I should
match "usb" instead of "usb_device" but then I can't get the product and
the vendor.

The %k gives me /dev/usbdev4.85 but libgphoto2 doesn't seem to access
the camera through this device, it uses the legacy /proc/bus/usb/*/*. I
could parse the device name to fill the * but that may be quite
complicated because of the number of digits (here it will
be /proc/bus/usb/004/085, but that could be /proc/bus/usb/012/001, and I
don't feel like dealing with this in bash ;-) ).

If anyone knows how to do that...

--
Flavien Bridault

Disk, Graphics, Graphics-libs sections Guru
Source Mage GNU/Linux - http://www.sourcemage.org

irc: vlaaad
jabber: vlaaad AT amessage.be

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée




Archive powered by MHonArc 2.6.24.

Top of Page