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: Sun, 30 Apr 2006 00:17:18 +0200

Le samedi 29 avril 2006 à 16:32 -0500, Geoffrey Derber a écrit :
> --------- Original Message --------
> From: Flavien Bridault <vlaaad AT sourcemage.org>
> To: sm-users AT lists.ibiblio.org <sm-users AT lists.ibiblio.org>
> Subject: Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15
> Date: 28/04/06 18:45
>
> <snip>
>
> >
> > 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==&quot;*&quot;, SUBSYSTEM==&quot;usb_device&quot;,
> ACTION==&quot;add&quot;, NAME=&quot;%k&quot;,
> > PROGRAM=&quot;gphoto2 %s{idVendor} %s{idProduct} %k&quot;,
> GROUP=&quot;%c&quot;
> >
> > I was thinking then that I chose the wrong subsystem and that I should
> > match &quot;usb&quot; instead of &quot;usb_device&quot; 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...
> >
>
> Found a solution. I simply copied the nomad.rules file, creating a
> camera.rules file and adding definitions for my camera in the product
> section. This does require the libusb in the test grimiore. It creates a
> /dev/bus/usb/*/* interface that libgphoto2 can recognize.
>
> I don't know if this will help.

That only solves the problem for you... ;-) We need a more generic way
to avoid that everybody has to write his rule for his own camera. If a
friend comes at home with his pictures on his camera, I would be quite
ashamed if I had to ask him to wait ten minutes while I create the
appropriate udev rule ;-)
However I'm interest in the nomad.rules file, where did you get that ? I
don't have any /dev/bus/usb/*/* device here, that may be interesting to
know how this decide is created.
--
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