Skip to contentSkip to conversation

USB camera not hotplugging because SYSFS{ID_VENDOR} etc. not available

DISCUSSION Moshe Yudkowsky 2 participants 3 messages Apr 10, 2006

lore
Share & tools
lore
#0 lore raw

In *both* the patched version of udev that I was running, and in the new official release of 0.089, I don't have SYSFS{ID_VENDOR} available when the device is plugged in. This in turn means that the libgphoto2.rules do not execute and the camera group is not set.

HOWEVER, the SYSFS variables for the MP3 player *are* available!

libgphoto2.rules:

Quoted 1 line

SYSFS{idVendor}="04a9", SYSFS{idProduct}="3051", MODE="0660", GROUP="camera"

udevmonitor --evn output for plugin of camera:

Quoted 55 lines

UEVENT[1144681428.413283] add@/devices/pci0000:00/0000:00:10.0/usb1/1-1 ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:10.0/usb1/1-1 SUBSYSTEM=usb
SEQNUM453
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb

UDEV [1144681428.414601] add@/devices/pci0000:00/0000:00:10.0/usb1/1-1 UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:10.0/usb1/1-1 SUBSYSTEM=usb
SEQNUM453
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
UDEVD_EVENT=1

UEVENT[1144681428.421787] add@/devices/pci0000:00/0000:00:10.0/usb1/1-1/1-1:1.0 ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:10.0/usb1/1-1/1-1:1.0 SUBSYSTEM=usb
SEQNUM454
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/008
PRODUCTJ9/3051/1
TYPE%5/255/255
INTERFACE%5/255/255 MODALIAS=usb:v04A9p3051d0001dcFFdscFFdpFFicFFiscFFipFF

UEVENT[1144681428.430368] add@/class/usb_device/usbdev1.8 ACTION­d
DEVPATH=/class/usb_device/usbdev1.8 SUBSYSTEM=usb_device
SEQNUM455 PHYSDEVPATH=/devices/pci0000:00/0000:00:10.0/usb1/1-1 PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR9
MINOR=7

UDEV [1144681428.486187] add@/devices/pci0000:00/0000:00:10.0/usb1/1-1/1-1:1.0 UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:10.0/usb1/1-1/1-1:1.0 SUBSYSTEM=usb
SEQNUM454
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/008
PRODUCTJ9/3051/1
TYPE%5/255/255
INTERFACE%5/255/255 MODALIAS=usb:v04A9p3051d0001dcFFdscFFdpFFicFFiscFFipFF UDEVD_EVENT=1

Quoted 13 lines

UDEV [1144681428.584855] add@/class/usb_device/usbdev1.8 UDEV_LOG=3
ACTION­d
DEVPATH=/class/usb_device/usbdev1.8 SUBSYSTEM=usb_device
SEQNUM455 PHYSDEVPATH=/devices/pci0000:00/0000:00:10.0/usb1/1-1 PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR9
MINOR=7
UDEVD_EVENT=1
DEVNAME=/dev/bus/usb/001/008

And the device /dev/bus/usb/001/008 has group set to root, and that's the problem.

If I plug in the USB-based mp3 player, I get in part:

Quoted 14 lines

UDEV [1144681853.831681] add@/block/sdb
UDEV_LOG=3
ACTION­d
DEVPATH=/block/sdb
SUBSYSTEM=block
SEQNUM464
MINOR
MAJOR=8 PHYSDEVPATH=/devices/pci0000:00/0000:00:10.3/usb4/4-4/4-4:1.0/host24/target24:0:0/24:0:0:0 PHYSDEVBUS=scsi
PHYSDEVDRIVER=sd
UDEVD_EVENT=1
ID_VENDOR=iriver
ID_MODEL=MassStorage_Disc

Quoted 8 lines

ID_REVISION01
ID_SERIAL=iriver_MassStorage_Disc
ID_TYPE=disk
ID_BUS=usb
ID_PATH=pci-0000:00:10.3-usb-0:4:1.0-scsi-0:0:0:0
REMOVE_CMD=/etc/hotplug/usb/iriver remove
DEVNAME=/dev/scsi/host24/bus0/target0/lun0/disc
DEVLINKS=/dev/sdb /dev/discs/disc2/disc /dev/disk/by-id/usb-iriver_MassStorage_Disc /dev/disk/by-path/pci-0000:00:10.3-usb-0:4:1.0-scsi-0:0:0:0 /dev/iriver

and the rules based on SYSFS{ID_VENDOR} work as expected. (Well, there's one bug that I'm chasing down -- REMOVE_CMD did *not* execute, and neither did the other remove rules. I don't know why just yet.)

So, in summary, SYSFS is available but only for some USB items.

Please let me know if you need any further information.

Signature · 14 lines
  Moshe Yudkowsky
  work: http://www.Disaggregate.com
  book: http://www.PebbleAndAvalanche.com


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Moshe Yudkowsky

In *both* the patched version of udev that I was running, and in the new official release of 0.089, I don't have SYSFS{ID_VENDOR} available when the device is plugged in.

This does not exist and has never existed.

Quoted 9 lines

This in turn means that the libgphoto2.rules
do not execute and the camera group is not set.

HOWEVER, the SYSFS variables for the MP3 player *are* available!

libgphoto2.rules:

Quoted 2 lines

SYSFS{idVendor}="04a9", SYSFS{idProduct}="3051", MODE="0660", GROUP="camera"

If this is full rule it won't work.
[...]

Quoted 1 line

Please let me know if you need any further information.

please show full rule in question.

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEOo+sR6LMutpd94wRAtaeAKCqJa5LswqmrjyGXuSxiJ9nwN008wCfaS+W 3FPkEd5Zk86jtAc8AcKL5eo=BOLb
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw

Re: USB camera not hotplugging because SYSFS{ID_VENDOR} etc. not

In reply to Moshe Yudkowsky

Andrey,

Thanks for responding.

Quoted 5 lines · Andrey Borzenkov
Quoted 3 lines

libgphoto2.rules:

Quoted 2 lines

SYSFS{idVendor}="04a9", SYSFS{idProduct}="3051", MODE="0660", GROUP="camera"

If this is full rule it won't work.

That's the full rule. I'm pretty sure it used to work.

Quoted 2 lines · I wrote:
Quoted 2 lines

I don't have SYSFS{ID_VENDOR} available when

Quoted 1 line

the device is plugged in.

Quoted 1 line · You

This does not exist and has never existed.

But I see from udevmonitor --env that:

Quoted 6 lines

ID_VENDOR=iriver
ID_MODEL=MassStorage_Disc
ID_REVISION01
ID_SERIAL=iriver_MassStorage_Disc
ID_TYPE=disk
ID_BUS=usb

And the rule

Quoted 2 lines

SUBSYSTEM="block", ACTION="add", ENV{ID_VENDOR}="iriver", ENV{ID_SERIAL}="iriver_MassStorage_Disc", SYMLINK+="iriver", RUN+="/etc/hotplug/usb/iriver", ENV{REMOVE_CMD}="/etc/hotplug/usb/iriver remove"

does work as expected.

Oh, I see. One's ENV and the other is SYSFS. As always, it's impossible to tell from the printout if you don't know the SYSFS variables by heart.

And, for the record, I suspect that ID_VENDOR got into the environment via a usb_id() function call -- am I correct?

For the camera, I get

Quoted 1 line

PRODUCTJ9/3051/1

And inside the rule for the camera I see SYSFS{idVendor}="04a9", SYSFS{idProduct}="3051". It looks to me as if they are very similar. Has there been a recent change of some sort in udev that made idVendor stop working? Or did this never work, and I am remembering wrong, and it's time to write ghoto2 and ask them to update their rules?

Signature · 14 lines
  Moshe Yudkowsky
  work: http://www.Disaggregate.com
  book: http://www.PebbleAndAvalanche.com


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel