Eu tenho um PS3/PC NETWAY GAMING ARCADE FIGHTER. Este dispositivo funciona bem no Windows e também no recalbox 4.1, mas não funciona em nenhum Linux atual que eu tentei.
Tentei recompilar o hid-sony com várias versões mais antigas, incluindo a mesma que funciona no recalbox 4.1 (v4.4.13). Ao usar essa versão no Ubuntu recente, parece melhorar a detecção, mas ainda falha.
Aqui estão os registros do dispositivo:
RECALBOX user.info kernel: [ 99.858844] usb 1-1.4: new full-speed USB device number 5 using dwc_otg
RECALBOX user.info kernel: [ 99.980280] usb 1-1.4: New USB device found, idVendor=054c, idProduct=0268
RECALBOX user.info kernel: [ 99.980789] usb 1-1.4: Mew USB device strings: Mfr=0, Product=2, SerialNunmber=0
RECALBOX user.info kernel: [ 99.960296] usb 1-1.4: Product: USB Controller
RECALBOX user.info kernel: [ 100.135534] usb 1-1.4: USB disconnect, device number 5
RECALBOX user.info kernel: [ 100.135955] input: USB Controller as /devices/platform/soc/3f980000.usb/usb1/1—1/1-1.4/1-1.4:1.0/0003:054C:0268.0003/input/input2
RECALBOX user.info kernel: [ 100.136001] sony 0003:054C:0268.0003: input,hiddev0,hidraw2: USB HID v1.11 Joystick [USB Controller! on ush—3f980000.usb—1.4/input0
RECALBOX user.err kernel: [ 100.136022] sony 0003:054C:0268.0003: can’t set operational mode: step 1
RECALBOX user.info kernel: [ 101.138844] usb 1-1.4: new full-speed USB device number 6 using dwc_otg
RECALBOX user.info kernel: [ 101.253950] usb 1-1.4: New USB device found, idVendor=1345, idProduct=3008
RECALBOX user.info kernel: [ 101.253959] usb 1-1.4: New USB device strings: Mfr=0, Product=2, SerialNumber=0
RECALBOX user.info kernel: [ 101.253965] usb 1-1.4: Product: USB Controller
RECALBOX user.info kernel: [ 101.275011] input: USB Controller as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:1345:3008.0004/input/input3
RECALBOX user.info kernel: [ 101.275358] hid-generic 0003:1345:3008.0004: input,hidraw2: USB HID v1.10 Gamepad [USB Controller] on usb—3f980000.usb—1.4/inputO
(recalbox 4.1, funcionando)
ubuntu kernel: [ 4639.424468] usb 1-8: new full-speed USB device number 32 using xhci_hcd
ubuntu kernel: [ 4639.758139] usb 1-8: New USB device found, idVendor=054c, idProduct=0268, bcdDevice= 1.00
ubuntu kernel: [ 4639.758142] usb 1-8: New USB device strings: Mfr=0, Product=2, SerialNumber=0
ubuntu kernel: [ 4639.758145] usb 1-8: Product: USB Controller
ubuntu kernel: [ 4639.919303] sony 0003:054C:0268.0023: failed to retrieve feature report 0xf2 with the Sixaxis MAC address
ubuntu kernel: [ 4639.919558] sony 0003:054C:0268.0023: hiddev3,hidraw5: USB HID v81.11 Joystick [USB Controller] on usb-0000:15:00.0-8/input0
ubuntu kernel: [ 4639.919560] sony 0003:054C:0268.0023: failed to claim input
ubuntu kernel: [ 4639.919678] usb 1-8: USB disconnect, device number 32
ubuntu kernel: [ 4640.892687] usb 1-8: new full-speed USB device number 33 using xhci_hcd
ubuntu kernel: [ 4641.225377] usb 1-8: New USB device found, idVendor=1345, idProduct=3008, bcdDevice= 1.00
ubuntu kernel: [ 4641.225381] usb 1-8: New USB device strings: Mfr=0, Product=2, SerialNumber=0
ubuntu kernel: [ 4641.225383] usb 1-8: Product: USB Controller
ubuntu kernel: [ 4641.252351] sony 0003:1345:3008.0024: failed to retrieve feature report 0xf2 with the Sixaxis MAC address
ubuntu kernel: [ 4641.252760] sony 0003:1345:3008.0024: hiddev4,hidraw6: USB HID v81.10 Gamepad [USB Controller] on usb-0000:15:00.0-8/input0
ubuntu kernel: [ 4641.252762] sony 0003:1345:3008.0024: failed to claim input
(módulo padrão do Ubuntu 18.10, não funciona)
ubuntu kernel: [20957.230577] usb 1-9: new full-speed USB device number 14 using xhci_hcd
ubuntu kernel: [20957.563354] usb 1-9: New USB device found, idVendor=054c, idProduct=0268, bcdDevice= 1.00
ubuntu kernel: [20957.563358] usb 1-9: New USB device strings: Mfr=0, Product=2, SerialNumber=0
ubuntu kernel: [20957.563360] usb 1-9: Product: USB Controller
ubuntu kernel: [20957.597896] input: USB Controller as /devices/pci0000:00/0000:00:01.2/0000:15:00.0/usb1/1-9/1-9:1.0/0003:054C:0268.000D/input/input27
ubuntu kernel: [20957.598255] sony 0003:054C:0268.000D: input,hiddev1,hidraw3: USB HID v1.11 Joystick [USB Controller] on usb-0000:15:00.0-9/input0
ubuntu kernel: [20957.724424] sony 0003:054C:0268.000D: can't set operational mode: step 1
ubuntu kernel: [20957.810926] sony: probe of 0003:054C:0268.000D failed with error -71
ubuntu kernel: [20957.811129] usb 1-9: USB disconnect, device number 14
ubuntu kernel: [20958.702612] usb 1-9: new full-speed USB device number 15 using xhci_hcd
ubuntu kernel: [20959.033593] usb 1-9: New USB device found, idVendor=1345, idProduct=3008, bcdDevice= 1.00
ubuntu kernel: [20959.033597] usb 1-9: New USB device strings: Mfr=0, Product=2, SerialNumber=0
ubuntu kernel: [20959.033599] usb 1-9: Product: USB Controller
(módulo Ubuntu 18.10 v4.4.13, não funciona)
Bus 001 Device 035: ID 1345:3008 Sino Lite Technology Corp.
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1345 Sino Lite Technology Corp.
idProduct 0x3008
bcdDevice 1.00
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 500mA
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 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 112
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 0x0040 1x 64 bytes
bInterval 10
(lsusb-v)
O que posso notar é que com o recalbox o dispositivo finalmente é gerenciado pelo hid-generic, porém com a mesma versão do hid-sony compilada para o ubuntu ele não aciona o hid-generic e falha com o hid-sony.
Existe uma maneira de forçá-lo a ser gerenciado pelo hid-generic em vez do hid-sony, como parece acontecer com o recalbox? Pode ser através de alguma peculiaridade do USB?
Atualizar:
Acho que esse patch é o que faz a diferença entre trabalhar no recalbox 4.1 e não trabalhar no ubuntu com a mesma versão do driver hid-sony.c.
https://patchwork.kernel.org/patch/8026101/
Parece-me que desde a adição de
#define USB_VENDOR_ID_SINO_LITE 0x1345
#define USB_DEVICE_ID_SINO_LITE_CONTROLLER 0x3008
o gamepad é gerenciado por hid-sony.c, já que hid-core.c verifica hid_have_special_driver e a combinação fornecedor/dispositivo corresponde.
Então, além de recompilar todo o kernel com o identificador do dispositivo substituído, existem outras soluções?
Posso fazer com que o gamepad relate um ID de dispositivo diferente para o sistema operacional usando hid quirks ou udev, talvez?
Obrigado por qualquer ideia!
Responder1
Eu descobri que oescondidomódulo tem o parâmetroignore_special_driversque faz exatamente isso, ignore todos os drivers especializados e use o hid-generic para lidar com o dispositivo.
Como o módulo hid-sony não suporta corretamente meu stick de arcade clone do PS3, adicionar o parâmetro ao módulo hid resolve o problema.
$ sudo vi /etc/modprobe.d/hid.conf
options hid ignore_special_drivers=1
$ sudo update-initramfs -u
$ reboot
$ tail /var/log/kern.log
ubuntu kernel: [ 119.966133] usb 1-8: new full-speed USB device number 5 using xhci_hcd
ubuntu kernel: [ 120.299429] usb 1-8: New USB device found, idVendor=054c, idProduct=0268, bcdDevice= 1.00
ubuntu kernel: [ 120.299433] usb 1-8: New USB device strings: Mfr=0, Product=2, SerialNumber=0
ubuntu kernel: [ 120.299435] usb 1-8: Product: USB Controller
ubuntu kernel: [ 120.333900] input: USB Controller as /devices/pci0000:00/0000:00:01.2/0000:15:00.0/usb1/1-8/1-8:1.0/0003:054C:0268.0004/input/input18
ubuntu kernel: [ 120.334403] hid-generic 0003:054C:0268.0004: input,hidraw3: USB HID v1.11 Joystick [USB Controller] on usb-0000:15:00.0-8/input0
ubuntu kernel: [ 120.459845] usb 1-8: USB disconnect, device number 5
ubuntu kernel: [ 121.434688] usb 1-8: new full-speed USB device number 6 using xhci_hcd
ubuntu kernel: [ 121.765665] usb 1-8: New USB device found, idVendor=1345, idProduct=3008, bcdDevice= 1.00
ubuntu kernel: [ 121.765669] usb 1-8: New USB device strings: Mfr=0, Product=2, SerialNumber=0
ubuntu kernel: [ 121.765671] usb 1-8: Product: USB Controller
ubuntu kernel: [ 121.791046] input: USB Controller as /devices/pci0000:00/0000:00:01.2/0000:15:00.0/usb1/1-8/1-8:1.0/0003:1345:3008.0005/input/input19
ubuntu kernel: [ 121.851274] hid-generic 0003:1345:3008.0005: input,hidraw3: USB HID v1.10 Gamepad [USB Controller] on usb-0000:15:00.0-8/input0
Ainda assim, eu preferiria uma solução que permitisse ignorar o driver especial apenas para a combinação específica de VendorID/ProductID, caso eu tivesse um controlador de jogo original da Sony e quisesse usar ambos.