sm-users AT lists.ibiblio.org
Subject: Sourcemage Users List
List archive
Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15
- From: Geoffrey Derber <gderber 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:32:11 -0500
--------- 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=="*", 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...
>
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.
Geoff
________________________________________________
Message sent using UebiMiau 2.7.9
-
[SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15,
Geoffrey Derber, 04/29/2006
- Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15, steve-e, 04/29/2006
- Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15, Flavien Bridault, 04/29/2006
- <Possible follow-up(s)>
-
Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15,
Geoffrey Derber, 04/29/2006
- Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15, steve-e, 04/29/2006
-
Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15,
Geoffrey Derber, 04/29/2006
- Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15, Flavien Bridault, 04/29/2006
-
Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15,
Geoffrey Derber, 04/30/2006
-
Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15,
Flavien Bridault, 04/30/2006
- Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15, Flavien Bridault, 04/30/2006
-
Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15,
Flavien Bridault, 04/30/2006
- Re: [SM-Users] udev 090, libgphoto 2.1.99, linux 2.6.15, Geoffrey Derber, 04/30/2006
Archive powered by MHonArc 2.6.24.