私のシステムでは、カメラで再生中にUSBカメラを取り外すと、すべての削除イベントは発生しません。これにより、接続されているデバイス名(/ dev / input / event *)が他のデバイスで再利用されたときに問題が発生する可能性があります。
結局のところ、演奏中にカメラを外してキーボードを接続すると、キーボードが機能しなくなります。この問題を回避するほとんどのソリューションに満足しています。 haldが/ devエントリをクリーンアップしているため、削除イベントを発生させない理由を本当に理解していません。
システム: CentOS 6、最新のカーネルおよびhalパッケージ:
kernel-2.6.32-696.16.1.el6.i686
hal-0.5.14-14.el6.i686
カメラはe-con See3CAM_11CUGまたはPhilips SPC 900NCです。どちらも、フィリップスよりもはるかに最新のe-conを搭載したUVC USBカメラです。
lshal -m e-conが接続されているときに出力され、使用されていないときは削除されます。
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
mplayer でプレイ時 e-con 接続が切断されたときの lshal -m 出力( 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
if0_logicaldev_input
削除イベントを受信できませんでした。 Xorgはそれがキーボードだと思って削除されなかったときに/dev/input/event?を追加することにしました。名前は無効で無視されます。
lsofは、hald-addon-inputとXorgの両方が削除されたにもかかわらず、古い/dev/input/event*がまだ開いていることを示しています。
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)
/etc/sysconfig/haldaemon に "--verbose=yes --use-syslog" を追加しました。
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