我遇到了一个奇怪的问题,我的 USB 操纵杆被正确检测到,然后被内核很好地删除。
插入 USB 连接器时 dmesg 输出:
[ 2319.770016] usb 1-1.5: new full-speed USB device number 7 using ehci-pci
[ 2319.880607] usb 1-1.5: New USB device found, idVendor=0483, idProduct=5750
[ 2319.880609] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2319.880611] usb 1-1.5: Product: FALENCI
[ 2319.880613] usb 1-1.5: Manufacturer: FALENCI
[ 2319.880615] usb 1-1.5: SerialNumber: 206739655233
[ 2319.882481] input: FALENCI FALENCI as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.0009/input/input26
[ 2319.942381] hid-generic 0003:0483:5750.0009: input,hiddev0,hidraw0: USB HID v1.11 Gamepad [FALENCI FALENCI] on usb-0000:00:1a.0-1.5/input0
然而在系统日志中我发现:
Oct 17 23:25:51 Axe kernel: [ 2319.770016] usb 1-1.5: new full-speed USB device number 7 using ehci-pci
Oct 17 23:25:51 Axe kernel: [ 2319.880607] usb 1-1.5: New USB device found, idVendor=0483, idProduct=5750
Oct 17 23:25:51 Axe kernel: [ 2319.880609] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Oct 17 23:25:51 Axe kernel: [ 2319.880611] usb 1-1.5: Product: FALENCI
Oct 17 23:25:51 Axe kernel: [ 2319.880613] usb 1-1.5: Manufacturer: FALENCI
Oct 17 23:25:51 Axe kernel: [ 2319.880615] usb 1-1.5: SerialNumber: 206739655233
Oct 17 23:25:51 Axe kernel: [ 2319.882481] input: FALENCI FALENCI as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.0009/input/input26
Oct 17 23:25:51 Axe kernel: [ 2319.942381] hid-generic 0003:0483:5750.0009: input,hiddev0,hidraw0: USB HID v1.11 Gamepad [FALENCI FALENCI] on usb-0000:00:1a.0-1.5/input0
Oct 17 23:25:51 Axe mtp-probe: checking bus 1, device 7: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5"
Oct 17 23:25:51 Axe mtp-probe: bus: 1, device: 7 was not an MTP device
Oct 17 23:25:51 Axe acpid: input device has been disconnected, fd 16
并使用udevadm monitor
我得到:
KERNEL[2849.850516] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5 (usb)
KERNEL[2849.850688] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
KERNEL[2849.851478] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A (hid)
KERNEL[2849.852165] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27 (input)
KERNEL[2849.912343] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27/event2 (input)
KERNEL[2849.912420] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27/js0 (input)
KERNEL[2849.912565] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/usbmisc/hiddev0 (usbmisc)
KERNEL[2849.912616] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/hidraw/hidraw0 (hidraw)
UDEV [2849.934209] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5 (usb)
UDEV [2849.936100] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
UDEV [2849.937515] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A (hid)
UDEV [2849.938171] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/usbmisc/hiddev0 (usbmisc)
UDEV [2849.940255] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/hidraw/hidraw0 (hidraw)
KERNEL[2849.992217] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27/event2 (input)
KERNEL[2850.008233] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27/js0 (input)
KERNEL[2850.032209] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27 (input)
KERNEL[2850.032252] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/usbmisc/hiddev0 (usbmisc)
KERNEL[2850.032317] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/hidraw/hidraw0 (hidraw)
KERNEL[2850.032347] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A (hid)
UDEV [2850.033024] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/hidraw/hidraw0 (hidraw)
UDEV [2850.033116] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/usbmisc/hiddev0 (usbmisc)
UDEV [2850.033273] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27 (input)
UDEV [2850.034723] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27/event2 (input)
UDEV [2850.035337] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27/event2 (input)
UDEV [2850.036645] add /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27/js0 (input)
UDEV [2850.037334] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27/js0 (input)
UDEV [2850.037954] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A/input/input27 (input)
UDEV [2850.038398] remove /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/0003:0483:5750.000A (hid)
我确实很欣赏系统自动清理的功能,但我还是想在使用间隙稍微用一下 :-(
该设置之前运行没有问题,我认为这是在运行 16.04 而不是 17.04 时发生的
有人能建议可能出了什么问题或该如何调试这个问题吗?
编辑:
我进行了更多调试,找到了导致我痛苦/困惑的可能原因。使用导出 udev 数据库时,udevadm info -e
我发现有关我的设备的以下信息:
P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5
N: bus/usb/001/011
E: BUSNUM=001
E: DEVNAME=/dev/bus/usb/001/011
E: DEVNUM=011
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_MODEL=FALENCI
E: ID_MODEL_ENC=FALENCI
E: ID_MODEL_ID=5750
E: ID_REVISION=0200
E: ID_SERIAL=FALENCI_FALENCI_206739655233
E: ID_SERIAL_SHORT=206739655233
E: ID_USB_INTERFACES=:030000:
E: ID_VENDOR=FALENCI
E: ID_VENDOR_ENC=FALENCI
E: ID_VENDOR_FROM_DATABASE=STMicroelectronics
E: ID_VENDOR_ID=0483
E: MAJOR=189
E: MINOR=10
E: PRODUCT=483/5750/200
E: SUBSYSTEM=usb
E: TYPE=0/0/0
E: USEC_INITIALIZED=8384101306
P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0
E: DEVTYPE=usb_interface
E: DRIVER=usbfs
E: ID_VENDOR_FROM_DATABASE=STMicroelectronics
E: INTERFACE=3/0/0
E: MODALIAS=usb:v0483p5750d0200dc00dsc00dp00ic03isc00ip00in00
E: PRODUCT=483/5750/200
E: SUBSYSTEM=usb
E: TYPE=0/0/0
E: USEC_INITIALIZED=8384114545
但是 usbfs 是一个过时的驱动程序,不是我系统上的模块。由于该驱动程序不存在,因此无法将其列入黑名单。我检查了 lib 等现有 udev 规则中是否有提到此驱动程序,但没有。使用清理数据库udevadm info -c
将其从列表中删除,但当我重新尝试插入设备时,它又回到了列表中。
那么,这个 usbfs 从何而来,更重要的是如何将其从 hwdb 中删除?
答案1
虽然这似乎是一个解决方法,但无论如何我都会发布我的(临时?)解决方案,因为现在它解决了我的问题。
我用来usb_modeswitch
分离无功能的驱动程序并重置 USB:
usb_modeswitch -v VID -p PID -d -R
交换VID
并PID
分配给您 的值lsusb
。ID 后面的数字是VID:PID