1

On my system, if I disconnect the USB camera while playing from the camera, not all of the removal events happen. This causes problems when the associated device name (/dev/input/event*) is re-used by another device.

Ultimately, if you unplug the camera while playing, then plug in a keyboard, the keyboard doesn't work. I'm happy with most any solution that would avoid this problem. I don't really understand why hald isn't issuing the remove events, since it IS cleaning up the /dev entries.

System: CentOS 6, latest kernel and hal packages:

kernel-2.6.32-696.16.1.el6.i686
hal-0.5.14-14.el6.i686

Camera is an e-con See3CAM_11CUG or a Philips SPC 900NC. Both are UVC USB cameras, the e-con much newer than the Philips.

lshal -m output when the e-con is connected and removed while not in use:

11:42:02.190: usb_device_2560_c112_22268801 added
11:42:02.192: usb_device_2560_c112_22268801_if2 added
11:42:02.292: usb_device_2560_c112_22268801_if0 added
11:42:02.296: usb_device_2560_c112_22268801_if1 added
11:42:02.324: usb_device_2560_c112_22268801_if0_video4linux added
11:42:02.331: usb_device_2560_c112_22268801_if0_logicaldev_input added

11:44:48.563: usb_device_2560_c112_22268801_if0_video4linux removed
11:44:48.567: usb_device_2560_c112_22268801_if0_logicaldev_input removed
11:44:48.575: usb_device_2560_c112_22268801_if1 removed
11:44:48.576: usb_device_2560_c112_22268801_if0 removed
11:44:48.577: usb_device_2560_c112_22268801_if2 removed
11:44:48.577: usb_device_2560_c112_22268801 removed

Here's the lshal -m output when the e-con is disconnected while playing via mplayer (mplayer tv:// -tv driver=v4l2:noaudio:device=/dev/video0)

11:47:34.230: usb_device_2560_c112_22268801 added
11:47:34.237: usb_device_2560_c112_22268801_if0 added
11:47:34.240: usb_device_2560_c112_22268801_if1 added
11:47:34.241: usb_device_2560_c112_22268801_if2 added
11:47:34.245: usb_device_2560_c112_22268801_if0_video4linux added
11:47:34.261: usb_device_2560_c112_22268801_if0_logicaldev_input added

11:48:00.417: usb_device_2560_c112_22268801_if1 removed
11:48:00.419: usb_device_2560_c112_22268801_if0_video4linux removed
11:48:00.419: usb_device_2560_c112_22268801_if0 removed
11:48:00.420: usb_device_2560_c112_22268801_if2 removed
11:48:00.420: usb_device_2560_c112_22268801 removed

The if0_logicaldev_input is the one that doesn't get the removal event. Xorg thinks that's a keyboard, and when it doesn't get the removal, it decides that further adds for that /dev/input/event?? name are invalid and ignores them.

lsof indicates that both hald-addon-input and Xorg both still have the old /dev/input/event* open, even though it's been deleted:

lsof | grep deleted
hald-addo 2484      root   12r      CHR      13,77      0t0      24238 /dev/input/event13 (deleted)
Xorg      2678      root   35u      CHR      13,77      0t0      23881 /dev/input/event13 (deleted)

I added "--verbose=yes --use-syslog" to /etc/sysconfig/haldaemon, and this is the snippet from /var/log/messages when doing the removal while playing:

Feb 12 08:47:58 Kohne-C22 kernel: usb 4-1: USB disconnect, device number 4
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.723 [I] osspec.c:256: SEQNUM=2497, ACTION=remove, SUBSYSTEM=usb, DEVPATH=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.1, DEVNAME=, IFINDEX=0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.723 [D] hotplug.c:478: checking REMOVE event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.1
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.723 [D] hotplug.c:397: event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.1: skip ourselves and all later events
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.723 [I] hotplug.c:121: /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.1 is a device (store)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.723 [I] device.c:5083: remove_dev: subsys=usb sysfs_path=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.1
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.723 [I] device.c:4864: Remove callouts completed udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801_if1
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.723 [D] device_store.c:528: removing 0x8dd2380 from (linux.sysfs_path,/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.1)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.723 [I] hald.c:143: Removed device from GDL; udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801_if1
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [I] osspec.c:256: SEQNUM=2499, ACTION=remove, SUBSYSTEM=hidraw, DEVPATH=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/0003:2560:C112.0006/hidraw/hidraw0, DEVNAME=/dev/hidraw0, IFINDEX=0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:478: checking REMOVE event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/0003:2560:C112.0006/hidraw/hidraw0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:397: event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/0003:2560:C112.0006/hidraw/hidraw0: skip ourselves and all later events
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [I] device.c:5083: remove_dev: subsys=hidraw sysfs_path=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/0003:2560:C112.0006/hidraw/hidraw0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [W] device.c:5087: Error removing device
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [I] osspec.c:256: SEQNUM=2498, ACTION=remove, SUBSYSTEM=usb, DEVPATH=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/usb/hiddev1, DEVNAME=/dev/usb/hiddev1, IFINDEX=0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:478: checking REMOVE event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/usb/hiddev1
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:397: event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/usb/hiddev1: skip ourselves and all later events
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [I] device.c:5083: remove_dev: subsys=usb sysfs_path=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/usb/hiddev1
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [W] device.c:5087: Error removing device
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [I] osspec.c:256: SEQNUM=2500, ACTION=remove, SUBSYSTEM=hid, DEVPATH=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/0003:2560:C112.0006, DEVNAME=, IFINDEX=0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:478: checking REMOVE event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/0003:2560:C112.0006
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:397: event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/0003:2560:C112.0006: skip ourselves and all later events
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [I] device.c:5083: remove_dev: subsys=hid sysfs_path=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2/0003:2560:C112.0006
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [W] device.c:5087: Error removing device
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [I] osspec.c:256: SEQNUM=2495, ACTION=remove, SUBSYSTEM=video4linux, DEVPATH=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0/video4linux/video0, DEVNAME=/dev/video0, IFINDEX=0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:478: checking REMOVE event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0/video4linux/video0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.724 [D] hotplug.c:397: event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0/video4linux/video0: skip ourselves and all later events
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] hotplug.c:121: /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0/video4linux/video0 is a device (store)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] device.c:5083: remove_dev: subsys=video4linux sysfs_path=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0/video4linux/video0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] device.c:4864: Remove callouts completed udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801_if0_video4linux
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] device_store.c:528: removing 0x8db1820 from (linux.sysfs_path,/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0/video4linux/video0)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] hald.c:143: Removed device from GDL; udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801_if0_video4linux
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] osspec.c:256: SEQNUM=2501, ACTION=remove, SUBSYSTEM=usb, DEVPATH=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2, DEVNAME=, IFINDEX=0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:478: checking REMOVE event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:397: event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2: skip ourselves and all later events
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] hotplug.c:121: /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2 is a device (store)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] device.c:5083: remove_dev: subsys=usb sysfs_path=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] device.c:4864: Remove callouts completed udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801_if2
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] device_store.c:528: removing 0x8dbf560 from (linux.sysfs_path,/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.2)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] hald.c:143: Removed device from GDL; udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801_if2
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] osspec.c:256: SEQNUM=2496, ACTION=remove, SUBSYSTEM=usb, DEVPATH=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0, DEVNAME=, IFINDEX=0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:478: checking REMOVE event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:397: event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0: skip ourselves and all later events
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] hotplug.c:121: /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0 is a device (store)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] device.c:5083: remove_dev: subsys=usb sysfs_path=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] device.c:4864: Remove callouts completed udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801_if0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] device_store.c:528: removing 0x8d7edd0 from (linux.sysfs_path,/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1/4-1:1.0)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] hald.c:143: Removed device from GDL; udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801_if0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] osspec.c:256: SEQNUM=2502, ACTION=remove, SUBSYSTEM=usb, DEVPATH=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1, DEVNAME=/dev/bus/usb/004/004, IFINDEX=0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:478: checking REMOVE event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [D] hotplug.c:397: event /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1: skip ourselves and all later events
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] hotplug.c:121: /sys/devices/pci0000:00/0000:00:14.0/usb4/4-1 is a device (store)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.725 [I] device.c:5083: remove_dev: subsys=usb sysfs_path=/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.726 [I] device.c:4864: Remove callouts completed udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.726 [D] device_store.c:528: removing 0x8d905b0 from (linux.sysfs_path,/sys/devices/pci0000:00/0000:00:14.0/usb4/4-1)
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.726 [I] hald.c:143: Removed device from GDL; udi=/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.726 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:58 Kohne-C22 hald[2418]: 08:47:58.726 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
Feb 12 08:47:59 Kohne-C22 put: Listening on /dev/input/event12 /dev/input/event1 /dev/input/event3 /dev/input/event0 /dev/input/event4: [2476]: 08:47:59.665 [D] addon-input.c:319: Input device '/org/freedesktop/Hal/devices/usb_device_2560_c112_22268801_if0_logicaldev_input' destroyed, free data.
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.666 [I] osspec.c:256: SEQNUM=2503, ACTION=remove, SUBSYSTEM=input, DEVPATH=/sys/4-1:1.0/input/input15/event4, DEVNAME=/dev/input/event4, IFINDEX=0
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.666 [D] hotplug.c:478: checking REMOVE event /sys/4-1:1.0/input/input15/event4
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.666 [D] hotplug.c:397: event /sys/4-1:1.0/input/input15/event4: skip ourselves and all later events
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.666 [I] device.c:5083: remove_dev: subsys=input sysfs_path=/sys/4-1:1.0/input/input15/event4
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.666 [W] device.c:5087: Error removing device
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.666 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.666 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.674 [I] osspec.c:256: SEQNUM=2504, ACTION=remove, SUBSYSTEM=input, DEVPATH=/sys/4-1:1.0/input/input15, DEVNAME=, IFINDEX=0
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.674 [D] hotplug.c:478: checking REMOVE event /sys/4-1:1.0/input/input15
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.674 [D] hotplug.c:397: event /sys/4-1:1.0/input/input15: skip ourselves and all later events
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.674 [I] device.c:5083: remove_dev: subsys=input sysfs_path=/sys/4-1:1.0/input/input15
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.674 [W] device.c:5087: Error removing device
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.674 [D] hotplug.c:500: events queued = 0, events in progress = 0
Feb 12 08:47:59 Kohne-C22 hald[2418]: 08:47:59.674 [D] hotplug.c:505: Hotplug-queue empty now ... no hotplug events in progress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.