batocera-linux / batocera.linux

batocera.linux
https://batocera.org
Other
2.05k stars 528 forks source link

PDP CO.,LTD. Faceoff Wired Pro Controller no longer working via USB #5696

Open Hew-ux opened 2 years ago

Hew-ux commented 2 years ago

Issue: Nintendo Switch controllers are not registering any inputs when connected via USB. They still work fine via Bluetooth. This is also affecting third-party Switch controllers as well, and across multiple platforms (x86_64, s905x3, etc.)

Logs: Running evtest shows that the controller itself is being detected, but after selecting it and going in, no events are being fired off when pressing buttons. This seems to be the direct cause.

Using evtest to test the controller:

[root@BATOCERA /userdata/system]# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      Power Button
/dev/input/event1:      Power Button
/dev/input/event2:      HDA Intel PCH Front Mic
/dev/input/event3:      Logitech K400 Plus
/dev/input/event4:      PDP CO.,LTD. Faceoff Wired Pro Controller fo
/dev/input/event6:      HDA NVidia HDMI/DP,pcm=3
/dev/input/event7:      HDA NVidia HDMI/DP,pcm=7
/dev/input/event8:      HDA NVidia HDMI/DP,pcm=8
/dev/input/event9:      HDA NVidia HDMI/DP,pcm=9
/dev/input/event10:     HDA NVidia HDMI/DP,pcm=10
/dev/input/event11:     HDA NVidia HDMI/DP,pcm=11
/dev/input/event12:     HDA NVidia HDMI/DP,pcm=12
/dev/input/event13:     HDA Intel PCH Rear Mic
/dev/input/event14:     HDA Intel PCH Line
/dev/input/event15:     HDA Intel PCH Line Out
/dev/input/event16:     HDA Intel PCH Front Headphone
Select the device event number [0-16]: 4
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0xe6f product 0x180 version 0x111
Input device name: "PDP CO.,LTD. Faceoff Wired Pro Controller fo"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 304 (BTN_SOUTH)
    Event code 305 (BTN_EAST)
    Event code 306 (BTN_C)
    Event code 307 (BTN_NORTH)
    Event code 308 (BTN_WEST)
    Event code 309 (BTN_Z)
    Event code 310 (BTN_TL)
    Event code 311 (BTN_TR)
    Event code 312 (BTN_TL2)
    Event code 313 (BTN_TR2)
    Event code 314 (BTN_SELECT)
    Event code 315 (BTN_START)
    Event code 316 (BTN_MODE)
    Event code 317 (BTN_THUMBL)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max      255
      Flat      15
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max      255
      Flat      15
    Event code 16 (ABS_HAT0X)
      Value      0
      Min       -1
      Max        1
    Event code 17 (ABS_HAT0Y)
      Value      0
      Min       -1
      Max        1
    Event code 40 (ABS_MISC)
      Value      0
      Min        0
      Max      255
      Flat      15
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)

No matter which buttons/sticks are pressed, this screen never changes. Nothing is detected.

sdl2-jstest --list info:

[root@BATOCERA /userdata/system]# sdl2-jstest --list
Found 1 joystick(s)

Joystick Name:     'PDP CO.,LTD. Faceoff Wired Pro Controller foNintendo Switch̞H'
Joystick Path:     '/dev/input/event4'
Joystick GUID:     030000006f0e00008001000011010000
Joystick Number:    0
Number of Axes:     2
Number of Buttons: 14
Number of Hats:     1
Number of Balls:    0
GameController:
  not a gamepad
Axis code  0:    0
Axis code  1:    1
Button code  0:   304
Button code  1:   305
Button code  2:   306
Button code  3:   307
Button code  4:   308
Button code  5:   309
Button code  6:   310
Button code  7:   311
Button code  8:   312
Button code  9:   313
Button code 10:   314
Button code 11:   315
Button code 12:   316
Button code 13:   317
Hat code  0:   -1

dmesg output when the device is plugged in:

[ 7970.265482] usb 3-3: new full-speed USB device number 5 using xhci_hcd
[ 7970.410096] usb 3-3: New USB device found, idVendor=0e6f, idProduct=0180, bcdDevice= 5.72
[ 7970.410100] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7970.410101] usb 3-3: Product: Faceoff Wired Pro Controller fo
[ 7970.410102] usb 3-3: Manufacturer: PDP CO.,LTD.
[ 7970.410103] usb 3-3: SerialNumber: KC8261B A07
[ 7970.413113] input: PDP CO.,LTD. Faceoff Wired Pro Controller fo as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:0E6F:0180.0006/input/input26
[ 7970.468982] hid-generic 0003:0E6F:0180.0006: input,hidraw2: USB HID v1.11 Gamepad [PDP CO.,LTD. Faceoff Wired Pro Controller fo] on usb-0000:00:14.0-3/input0
[ 7971.700005] usb 3-3: input irq status -75 received
[ 7971.708003] usb 3-3: input irq status -75 received
[ 7971.716002] usb 3-3: input irq status -75 received
[...]

The usb 3-3: input irq status -75 received keeps getting sent indefinitely for as long as the controller is plugged in. This is irrelevant of whether the controller is plugged into a USB 3.0 port or a USB 2.0 port.

Additional info: This was working correctly in v32. I also noticed that in v33, the controller name seems to appear slightly corrupted when connected, and it takes about ten or so seconds to connect, whereas in v32 the name appeared fine and it connected instantly.

First connection (note the weird square and H at the end of the name): screenshot-2022 03 02-12h33 46

Disconnect and reconnect (note how the name has changed now from when it was first connected): screenshot-2022 03 02-12h34 51

Again, in v32 the name appeared correctly, without either the square and H or "fo" at the end of the name.

AshSinc commented 2 years ago

I am having the same issue. An old 360 controller is working but using the Nintendo Switch Pro wired doesn't detect any input. It shows the controller is connected, but I can't operate the menu. Controller configuration doesn't detect any input when holding a button on that screen either.

Had the same issue with an 8bitdo pro 2 controller set to Switch mode as well. Although that controller also had really strange behaviour in dinput and xinput in wine games so might be something else there. But certainly no wired input in Switch mode at all.

[root@BATOCERA /userdata/system]# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:  Power Button
/dev/input/event1:  Power Button
/dev/input/event2:  Video Bus
/dev/input/event3:  Microsoft X-Box 360 pad
/dev/input/event4:  HDA Intel PCH Front Mic
/dev/input/event5:  HDA Intel PCH Rear Mic
/dev/input/event6:  HDA Intel PCH Line Out
/dev/input/event7:  HDA Intel PCH Front Headphone
/dev/input/event8:  HDA Intel PCH HDMI/DP,pcm=3
/dev/input/event9:  HDA Intel PCH HDMI/DP,pcm=7
/dev/input/event10: HDA Intel PCH HDMI/DP,pcm=8
/dev/input/event11: Nintendo Co., Ltd. Pro Controller
Select the device event number [0-11]: 11
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x57e product 0x2009 version 0x111
Input device name: "Nintendo Co., Ltd. Pro Controller"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 288 (BTN_TRIGGER)
    Event code 289 (BTN_THUMB)
    Event code 290 (BTN_THUMB2)
    Event code 291 (BTN_TOP)
    Event code 292 (BTN_TOP2)
    Event code 293 (BTN_PINKIE)
    Event code 294 (BTN_BASE)
    Event code 295 (BTN_BASE2)
    Event code 296 (BTN_BASE3)
    Event code 297 (BTN_BASE4)
    Event code 298 (BTN_BASE5)
    Event code 299 (BTN_BASE6)
    Event code 300 (?)
    Event code 301 (?)
    Event code 302 (?)
    Event code 303 (BTN_DEAD)
    Event code 704 (BTN_TRIGGER_HAPPY1)
    Event code 705 (BTN_TRIGGER_HAPPY2)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max    65535
      Fuzz     255
      Flat    4095
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max    65535
      Fuzz     255
      Flat    4095
    Event code 2 (ABS_Z)
      Value      0
      Min        0
      Max    65535
      Fuzz     255
      Flat    4095
    Event code 5 (ABS_RZ)
      Value      0
      Min        0
      Max    65535
      Fuzz     255
      Flat    4095
    Event code 16 (ABS_HAT0X)
      Value      0
      Min       -1
      Max        1
    Event code 17 (ABS_HAT0Y)
      Value      0
      Min       -1
      Max        1
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Joystick Name:     'Nintendo Co., Ltd. Pro Controller'
Joystick Path:     '/dev/input/event11'
Joystick GUID:     030000007e0500000920000011010000
Joystick Number:    1
Number of Axes:     4
Number of Buttons: 18
Number of Hats:     1
Number of Balls:    0
GameController:
  not a gamepad
Axis code  0:    0
Axis code  1:    1
Axis code  2:    2
Axis code  3:    5
Button code  0:   288
Button code  1:   289
Button code  2:   290
Button code  3:   291
Button code  4:   292
Button code  5:   293
Button code  6:   294
Button code  7:   295
Button code  8:   296
Button code  9:   297
Button code 10:   298
Button code 11:   299
Button code 12:   300
Button code 13:   301
Button code 14:   302
Button code 15:   303
Button code 16:   704
Button code 17:   705
Hat code  0:   -1
[   61.285907] hid-generic 0003:057E:2009.0005: input,hidraw0: USB HID v1.11 Joystick [Nintendo Co., Ltd. Pro Controller] on usb-0000:00:1d.0-1.4/input0
[   80.124113] usb 2-1.4: USB disconnect, device number 8
[   81.351805] usb 2-1.4: new full-speed USB device number 9 using ehci-pci
[   81.451331] usb 2-1.4: New USB device found, idVendor=057e, idProduct=2009, bcdDevice= 2.10
[   81.451340] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   81.451343] usb 2-1.4: Product: Pro Controller
[   81.451346] usb 2-1.4: Manufacturer: Nintendo Co., Ltd.
[   81.451347] usb 2-1.4: SerialNumber: 000000000001
[   81.453047] input: Nintendo Co., Ltd. Pro Controller as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0/0003:057E:2009.0006/input/input16
[   81.453149] hid-generic 0003:057E:2009.0006: input,hidraw0: USB HID v1.11 Joystick [Nintendo Co., Ltd. Pro Controller] on usb-0000:00:1d.0-1.4/input0
[   93.692021] usb 2-1.4: USB disconnect, device number 9
[   97.995099] usb 2-1.4: new full-speed USB device number 10 using ehci-pci
[   98.094594] usb 2-1.4: New USB device found, idVendor=057e, idProduct=2009, bcdDevice= 2.10
[   98.094605] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   98.094608] usb 2-1.4: Product: Pro Controller
[   98.094610] usb 2-1.4: Manufacturer: Nintendo Co., Ltd.
[   98.094612] usb 2-1.4: SerialNumber: 000000000001
[   98.096203] input: Nintendo Co., Ltd. Pro Controller as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0/0003:057E:2009.0007/input/input17
[   98.155247] hid-generic 0003:057E:2009.0007: input,hidraw0: USB HID v1.11 Joystick [Nintendo Co., Ltd. Pro Controller] on usb-0000:00:1d.0-1.4/input0

Note that I am not getting the repeating usb 3-3: input irq status -75 received message though. And the name appears to be fine for me. I did notice there is no corresponding entry for Switch Pro controller in the in share/system/configs/emulationstation/ es_input.cfg.

dmanlfc commented 2 years ago

@Hew-ux Can you re-try the v34 beta please?

Hew-ux commented 2 years ago

@dmanlfc Was there meant to be a PR in particular that fixes it? Because I'm not seeing any.

The issue still remains on the latest beta.

dmanlfc commented 2 years ago

@dmanlfc Was there meant to be a PR in particular that fixes it? Because I'm not seeing any.

The issue still remains on the latest beta.

Err a lot, like the kernel & SDL upgrade :-) With dmesg do you still get - input irq status -75 received messages?

dmanlfc commented 2 years ago

@AshSinc can you try v34 beta please?

Basically - the 'Switch' controller HID driver was added to kernel 5.16 We are on 5.17 for v34 & I enabled the HID driver, judging by your USB ID, it should now work with v34.

Hew-ux commented 2 years ago

@dmanlfc Still receiving the usb 3-1: input irq status -75 received message on repeat.

Hew-ux commented 2 years ago

To keep track, what has been discovered so far:

dmanlfc commented 2 years ago

@Hew-ux try the latest build please

dmanlfc commented 2 years ago

@AshSinc can you test v34 beta please?

Only 'official' Nintendo Switch controllers will work using the Nintendo driver in the Linux kernel. For the 8bitdo Pro 2, use D-Input mode (wired or bluetooth).

Hew-ux commented 2 years ago

Update: Wired 3rd party switch controller still not working in the v34 beta.

dmanlfc commented 2 years ago

@Hew-ux try adding the new hid_nintendo via modprobe. Alternatively blacklist it & reboot.

Hew-ux commented 2 years ago

@dmanlfc Tried that, still no dice.

After running modprobe hid_nintendo: image

When plugging in controller the dmesg spam still present and button inputs are still not being seen by evtest: image

dmanlfc commented 2 years ago

What happens when you blacklist?

Hew-ux commented 2 years ago

You'll have to provide instructions on how to do that, googling it has shown me many different methods and I'm not sure which is applicable to Batocera.

dmanlfc commented 2 years ago

create a conf file in /etc/modprobe.d the contents of which contains blacklist hid_nintendo save the overlay & reboot

Hew-ux commented 2 years ago

Still the same unfortunately.

dmanlfc commented 2 years ago

Can you do a dmesg & upload to pastebin?

Hew-ux commented 2 years ago

@dmanlfc SSH session was could not capture all events from the start as the IRQ spam is huge, but this should give you everything that's relevant to the event: dmesg output when connecting switch controller.txt

dmanlfc commented 2 years ago

@Hew-ux please use the version here, from last night expanded Nintendo controller support has been added. Note: This MAY help with your PDP controller...

https://drive.google.com/drive/folders/1_bqmR7CoZ78i7DolYt5b-RRqB5c-LPyN

Hew-ux commented 2 years ago

Nice, this works great. However I noticed on the PRs that this change got reverted for whatever reason, so I'll upgrade to the newest beta and let you know.

dmanlfc commented 2 years ago

Just changes related to expanded SBC support which has settled down now.

Hew-ux commented 2 years ago

Yep, it's no longer working in the latest beta (2022/07/19) again.

lbrpdx commented 1 year ago

Any update on this?

Hew-ux commented 1 year ago

I test this controller every once in a while, it's still broken. Technically, this is a regression, so I'd be hesitant to choose it in case other users begin to report the same regression.