Forzar que el gamepad arcade clonado de PS3 se oculte de forma genérica

Forzar que el gamepad arcade clonado de PS3 se oculte de forma genérica

Tengo una PS3/PC de NETWAY GAMING ARCADE FIGHTER. Este dispositivo funciona bien en Windows y también en Recalbox 4.1, pero no en ningún Linux actual que haya probado.

Intenté recompilar hid-sony con varias versiones anteriores, incluida la misma que funciona en recalbox 4.1 (v4.4.13). Al usar esa versión en ubuntu reciente parece mejorar la detección pero aún falla.

Aquí están los registros del 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 predeterminado de ubuntu 18.10, no 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, no 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)

Lo que puedo notar es que con recalbox el dispositivo finalmente es administrado por hid-generic, sin embargo con la misma versión de hid-sony compilada para ubuntu no activa hid-generic y falla con hid-sony.

¿Hay alguna manera de forzar que sea administrado por hid-generic en lugar de hid-sony como parece suceder con recalbox? ¿Puede ser a través de alguna peculiaridad USB?

Actualizar:

Creo que este parche es lo que marca la diferencia entre trabajar en recalbox 4.1 y no trabajar en ubuntu con la misma versión del controlador hid-sony.c.

https://patchwork.kernel.org/patch/8026101/

Me parece que desde la adición de

#define USB_VENDOR_ID_SINO_LITE             0x1345
#define USB_DEVICE_ID_SINO_LITE_CONTROLLER  0x3008

el gamepad es administrado por hid-sony.c, ya que hid-core.c verifica las coincidencias de hid_have_special_driver y la combinación de proveedor/dispositivo.

Entonces, además de recompilar todo el kernel con el identificador de dispositivo de mi dispositivo reemplazado, ¿existen otras soluciones?

¿Puedo hacer que el gamepad informe una identificación de dispositivo diferente al sistema operativo usando peculiaridades ocultas o tal vez udev?

¡Gracias por cualquier idea!

Respuesta1

Descubrí que elescondidoEl módulo tiene el parámetro.ignorar_controladores_especialesque hace precisamente eso, ignora todos los controladores especializados y usa hid-generic para manejar el dispositivo.

Dado que el módulo hid-sony no es compatible correctamente con mi arcade stick clonado de PS3, agregar el parámetro al módulo hid resuelve el 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

Aún así, preferiría una solución que permita ignorar el controlador especial solo para el combo VendorID/ProductID específico en caso de que tuviera un controlador de juegos Sony original y quisiera usar ambos.

información relacionada