hald não enviando remover evento quando a câmera é desconectada durante a reprodução

1

No meu sistema, se eu desconectar a câmera USB durante a reprodução da câmera, nem todos os eventos de remoção acontecerão. Isso causa problemas quando o nome do dispositivo associado (/ dev / input / event *) é reutilizado por outro dispositivo.

Por fim, se você desconectar a câmera durante a reprodução, conecte um teclado, o teclado não funcionará. Estou feliz com a maioria das soluções que evitariam esse problema. Eu realmente não entendo porque o hald não está emitindo os eventos de remoção, já que ele está limpando as entradas / dev.

Sistema: CentOS 6, pacotes mais recentes do kernel e hal:

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

A câmera é um See-3CAM_11CUG ou um Philips SPC 900NC da Philips. Ambos são câmeras UVC USB, o e-con muito mais novo que o Philips.

lshal -m output quando o e-con é conectado e removido enquanto não estiver em uso:

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

Aqui está a saída lshal -m quando o e-con é desconectado durante a reprodução 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

O if0_logicaldev_input é o que não recebe o evento de remoção. O Xorg acha que é um teclado, e quando ele não obtém a remoção, ele decide que adiciona mais para o / dev / input / event ?? name são inválidos e os ignoram.

lsof indica que ambos, hald-addon-input e Xorg, ainda têm o antigo / dev / input / event * aberto, mesmo embora tenha sido excluído:

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)

Eu adicionei "--verbose = yes --use-syslog" ao / etc / sysconfig / haldaemon, e este é o trecho de / var / log / messages ao fazer a remoção durante a reprodução:

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
    
por Michael Kohne 13.02.2018 / 13:32

0 respostas

Tags