我正在尝试让一款廉价的 USB 游戏手柄在我的 Arm Chromebook 上运行的 Ubuntu 12.04 下工作(使用 chroot)。插入游戏手柄后,dmesg 显示:
[ 5879.411510] usb 2-1: new low-speed USB device number 8 using exynos-ohci
[ 5879.610530] usb 2-1: New USB device found, idVendor=0079, idProduct=0011
[ 5879.610560] usb 2-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 5879.610584] usb 2-1: Product: USB Gamepad
lsusb 的输出是:
Bus 001 Device 003: ID 0424:3503 Standard Microsystems Corp.
Bus 002 Device 008: ID 0079:0011 DragonRise Inc. Gamepad
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 2232:1037
我没有/dev/input/ls0
ls -l /dev/input
:
drwxr-xr-x 2 root root 120 May 31 17:24 by-path
crw-rw---- 1 root 222 13, 64 May 31 17:24 event0
crw-rw---- 1 root 222 13, 65 May 31 17:24 event1
crw-rw---- 1 root 222 13, 66 May 31 17:24 event2
crw-rw---- 1 root 222 13, 67 May 31 17:24 event3
crw-rw---- 1 root 222 13, 68 May 31 17:24 event4
crw-rw---- 1 root 222 13, 69 May 31 17:24 event5
有任何想法吗?
编辑:如果它有帮助,以下是我在 usb 设备中看到的内容:
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0
D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0079 ProdID=0011 Rev=01.06
S: Product=USB Gamepad
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
编辑2:这是 lsusb -v 的输出(游戏手柄部分)
Bus 002 Device 002: ID 0079:0011 DragonRise Inc. Gamepad
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0079 DragonRise Inc.
idProduct 0x0011 Gamepad
bcdDevice 1.06
iManufacturer 0
iProduct 2
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 33 US
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 101
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
答案1
DragonRise 游戏手柄使用 hid_dr 模块,可以使用 加载modprobe hid_dr
。如果该模块不可用,则必须通过启用HID_DRAGONRISE
内核选项来编译它(在 menuconfig 中,您可以在设备驱动程序 -> HID 支持 -> HID 总线支持 -> 特殊 HID 驱动程序 -> DragonRise Inc. 游戏控制器中找到它)。
加载模块后,设备将被正确识别并创建 /dev/input/js0。
[19229.563797] usb 3-3: new low-speed USB device number 11 using xhci_hcd
[19229.706682] usb 3-3: New USB device found, idVendor=0079, idProduct=0011
[19229.706688] usb 3-3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[19229.706692] usb 3-3: Product: USB Gamepad
[19229.706915] usb 3-3: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
[19229.710302] input: USB Gamepad as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:0079:0011.000C/input/input13
[19229.710638] dragonrise 0003:0079:0011.000C: input,hidraw0: USB HID v1.10 Joystick [USB Gamepad ] on usb-0000:00:14.0-3/input0
答案2
除了缺失之外,js0
它看起来不错。尝试modprobe joydev
看看是否能给你一个/dev/input/js0
。如果失败,请安装evtest
,然后执行以下操作:
evtest /dev/input/event1
evtest /dev/input/event2
evtest /dev/input/event3
...
直到您找到游戏手柄。发布evtest
启动时打印的信息,因为当无法将其检测为操纵杆时,按钮名称可能存在问题。