Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Playstation 4 controllers don't work #7270

Closed
TellowKrinkle opened this issue Feb 9, 2023 · 13 comments
Closed

Some Playstation 4 controllers don't work #7270

TellowKrinkle opened this issue Feb 9, 2023 · 13 comments

Comments

@TellowKrinkle
Copy link

I've gotten two reports for this on PCSX2 and two on Dolphin now

One of the Dolphin ones can be seen here, on an 8bitdo SN30 Pro, which apparently identifies as a PS4 controller. The rest were support requests that never got issues, with people who claimed to be using actual DS4s. Three of the four were on macOS, one on Windows.

One of the PCSX2 reporters helped me bisect it to 2ccdd06, but they disappeared before I could get a log with DEBUG_PS4_PROTOCOL enabled. Removing the CRC check didn't help, and reverting a larger portion of the commit didn't until I removed the HIDAPI_DriverPS4_IsPacketValid call, so my best guess would be something in the k_EPS4ReportIdUsbState case, but I'm still waiting for someone with the issue to reappear...

@slouken
Copy link
Collaborator

slouken commented Feb 9, 2023

I just tested with the 8BitDo SN30 Pro in PS4 mode on Windows and macOS and it worked fine for me. If you can get a report with a log with DEBUG_PS4_PROTOCOL enabled, that would be very helpful.

Thanks!

@Balderick
Copy link

Balderick commented Feb 14, 2023

How to enable DEBUG_PS4_PROTOCOL for Steam?

I have 8BitDo Pro 2 controller that used to be detected as ps3 type controller when set to dinput mode and used define layout ui from large mode to save layout as ps4 type controller. config.vdf and log controller.txt confirms the server was not found when uploading the ps4 layout config so is still pending upload.

The old ps3 type controller layout that Steam Input used to load is available in config.vdf but steam is now loading generic gamepad config which i cant see as being defined in config.vdf.

Valve just pushed hotfix to Steam stable client to fix ps4 controller support in SDL as gyro was still being switched on even when steam input/sdl was disabled for game.

Bug Report for broken ps4 and ps3 controller types when using 8BitDo Pro 2 controller in Steam for windows can be found at https://steamcommunity.com/groups/SteamClientBeta/discussions/3/3763356482614563631/
and i also have another open issue regarding ps type controller in Steam. Steam input/ SDL seems to be blacklisting steering wheel and pedals which is not listed in blacklist section of config.vdf and yet no controller ever gets detected in controller settings.
https://steamcommunity.com/groups/SteamClientBeta/discussions/0/3763356923841756034/
I dont expect sdl to work for wheel and pedals in games. Just want steam input/sdl to detect usb devices so i can use sdl_gamecontroller to map wheel base and wheel buttons for big picture navigation so i do not need to have kb + m anywhere near my race sim rig when using VR. Like i used to be able to do. Saving detected controller as ps3 type after creating layout so in game prompts match physical device as it is licenced ps3 device helps a lot too outwith VR

@TellowKrinkle
Copy link
Author

Got access to a PS4 controller
Looks like the main issue is when the controller is in not-enhanced mode, it sends usb packets of size 10

PS4 non-enhanced packets
2023-02-14 19:20:02.320 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:09.520 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x48 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:09.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:10.420 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x28 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:10.519 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:10.920 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7c 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:10.920 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7a 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:11.020 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7b 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:11.020 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:11.819 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x02 0x00
08:       0x00 0x00
2023-02-14 19:20:12.020 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:12.319 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x01 0x00
08:       0x00 0x00
2023-02-14 19:20:12.520 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:12.719 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x08 0x00
08:       0x00 0x22
2023-02-14 19:20:12.719 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x08 0x00
08:       0x00 0x87
2023-02-14 19:20:12.819 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x08 0x00
08:       0x00 0xcd
2023-02-14 19:20:12.820 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x08 0x00
08:       0x00 0xf8
2023-02-14 19:20:12.820 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x08 0x00
08:       0x00 0xff
2023-02-14 19:20:12.920 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x08 0x00
08:       0x00 0xf6
2023-02-14 19:20:12.920 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x08 0x00
08:       0x00 0xcc
2023-02-14 19:20:12.920 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x08 0x00
08:       0x00 0x87
2023-02-14 19:20:12.920 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:13.420 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x04 0x00
08:       0x3a 0x00
2023-02-14 19:20:13.420 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x04 0x00
08:       0xff 0x00
2023-02-14 19:20:13.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x04 0x00
08:       0xef 0x00
2023-02-14 19:20:13.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x04 0x00
08:       0xa2 0x00
2023-02-14 19:20:13.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x04 0x00
08:       0x4d 0x00
2023-02-14 19:20:13.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x04 0x00
08:       0x1c 0x00
2023-02-14 19:20:13.720 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:14.019 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x02 0x00
08:       0x00 0x00
2023-02-14 19:20:14.220 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:14.919 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x02
08:       0x00 0x00
2023-02-14 19:20:15.220 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:15.420 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x02
08:       0x00 0x00
2023-02-14 19:20:15.420 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x02
08:       0x00 0x00
2023-02-14 19:20:15.420 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x02
08:       0x00 0x00
2023-02-14 19:20:15.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:16.020 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:16.021 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:16.021 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:16.021 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:16.119 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:16.120 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:16.619 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:16.619 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:17.819 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:17.819 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:18.419 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:18.419 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:18.519 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:18.519 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:19.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7e 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:19.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:20.820 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x02
08:       0x00 0x00
2023-02-14 19:20:21.020 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:21.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x28 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:21.719 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:22.020 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x18 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:22.219 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:22.419 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x88 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:22.620 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:22.820 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x48 0x00 0x00
08:       0x00 0x00
2023-02-14 19:20:23.020 PCSX2[44704:696708] INFO: PS4 packet: size = 10
00:       0x01 0x80 0x80 0x80 0x7d 0x08 0x00 0x00
08:       0x00 0x00

Setting enhanced mode (SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE) fixes the issue by making the controller report acceptable packets.

@slouken
Copy link
Collaborator

slouken commented Feb 15, 2023

Ah, good find, thanks!

slouken added a commit that referenced this issue Feb 15, 2023
Fixes #7270

(cherry picked from commit 5925cd4)
slouken added a commit that referenced this issue Mar 8, 2023
Fixes #7270

(cherry picked from commit 5925cd4)
(cherry picked from commit 2c69957)
@burnerbots
Copy link

this issue still exists in both pcsx2 and dolphin in the latest builds with the 8bitdo SN30 Pro. reopen?

@slouken
Copy link
Collaborator

slouken commented Mar 9, 2023

This fix is in for 2.28 and 3.0. Have you tested the latest code on GitHub?

@burnerbots
Copy link

I've only tested through the latest pcsx2 and dolphin builds, so probably not? Not sure how to test otherwise. I'm on macos.

@slouken
Copy link
Collaborator

slouken commented Mar 9, 2023

Okay, yeah, this fix will be in 2.26.5, released at the beginning of next month.

@TellowKrinkle
Copy link
Author

@burnerbots PCSX2 uses SDL releases, but Dolphin is using the SDL2 branch, and should have the fix already, so the 8bitdo's might have a separate issue.

Can you take this SDL dylib (unzip it), then right click on your PCSX2.app, Show Package Contents, then place it in Contents/Frameworks/ (it should overwrite an existing SDL dylib). Then run PCSX2 from the terminal with /path/to/PCSX2.app/Contents/MacOS/PCSX2 (if you're not sure where your PCSX2.app is, drag it onto the terminal and it'll insert everything up to the PCSX2.app/ part for you) and open up the controller configuration settings pane. If your controller works, it'll be fixed in 2.26.5. If not, you should see lots of messages similar to the "PS4 non-enhanced packets" one I posted. Post that here.

You can use

<details>
<summary>8bitdo Packets</summary>

`‌``
packets
`‌``
</details>

to hide it by default so it doesn't take up too much space.

@burnerbots
Copy link

@TellowKrinkle Yeah, it's still not working. Here's some of the stuff I got:

8bitdo Packets

2023-03-13 17:26:29.079 PCSX2[51936:2531542] INFO: CRC MISMATCH: 36492fa9 != CRC(78 bytes) => 9052b162
2023-03-13 17:26:29.079 PCSX2[51936:2531542] INFO: PS4 packet: size = 78
00: 0x11 0xc0 0x00 0x80 0x80 0x80 0x80 0x08
08: 0x00 0x00 0x00 0x00 0x23 0x74 0x0b 0xfb
16: 0xff 0xf7 0xff 0x13 0x00 0x43 0x00 0xa0
24: 0x1f 0xf2 0x06 0x00 0x00 0x00 0x00 0x00
32: 0x09 0x00 0x00 0x00 0x00 0x80 0x00 0x00
40: 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00
48: 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80
56: 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
64: 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00
72: 0x00 0x00 0xa9 0x2f 0x49 0x36
2023-03-13 17:26:29.079 PCSX2[51936:2531542] INFO: CRC MISMATCH: 36492fa9 != CRC(78 bytes) => 17bd29bc
2023-03-13 17:26:29.079 PCSX2[51936:2531542] INFO: PS4 packet: size = 78
00: 0x11 0xc0 0x00 0x80 0x80 0x80 0x80 0x08
08: 0x00 0x08 0x00 0x00 0x23 0x74 0x0b 0xfb
16: 0xff 0xf7 0xff 0x13 0x00 0x43 0x00 0xa0
24: 0x1f 0xf2 0x06 0x00 0x00 0x00 0x00 0x00
32: 0x09 0x00 0x00 0x00 0x00 0x80 0x00 0x00
40: 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00
48: 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80
56: 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
64: 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00
72: 0x00 0x00 0xa9 0x2f 0x49 0x36
2023-03-13 17:26:29.079 PCSX2[51936:2531542] INFO: CRC MISMATCH: 36492fa9 != CRC(78 bytes) => cbc9ab0a
2023-03-13 17:26:29.079 PCSX2[51936:2531542] INFO: PS4 packet: size = 78
00: 0x11 0xc0 0x00 0x80 0x80 0x80 0x80 0x08
08: 0x00 0x10 0x00 0x00 0x23 0x74 0x0b 0xfb
16: 0xff 0xf7 0xff 0x13 0x00 0x43 0x00 0xa0
24: 0x1f 0xf2 0x06 0x00 0x00 0x00 0x00 0x00
32: 0x09 0x00 0x00 0x00 0x00 0x80 0x00 0x00
40: 0x00 0x80 0x00 0x00 0x00 0x00 0x80 0x00
48: 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x80
56: 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00
64: 0x80 0x00 0x00 0x00 0x80 0x00 0x00 0x00
72: 0x00 0x00 0xa9 0x2f 0x49 0x36
2023-03-13 17:26:29.079 PCSX2[51936:2531542] INFO: CRC MISMATCH: 36492fa9 != CRC(78 bytes) => 74252a91

Does that help? Cause I have no idea what it all means, haha.

@TellowKrinkle
Copy link
Author

TellowKrinkle commented Mar 14, 2023

Yeah, looks like the 8bitdo controllers don't send valid CRCs, and instead sends 36492fa9 as the "crc" no matter what (though who knows where that's coming from and whether it's consistent across all 8bitdo controllers)

I'll let @slouken decide what they want to do about that

@burnerbots
Copy link

@TellowKrinkle interesting. I wonder why it worked with previous builds. I'm guessing it's a similar issue with the new dolphin builds that have SDL2 then?

@slouken
Copy link
Collaborator

slouken commented Mar 14, 2023

I upgraded my SN30 Pro to firmware version 2.00 and now I can reproduce this as well, thanks!

@slouken slouken reopened this Mar 14, 2023
slouken added a commit that referenced this issue Mar 14, 2023
This fixes handling the 8BitDo SN30 Pro with the 2.00 firmware in PS4 mode

Fixes #7270

(cherry picked from commit 3951cae)
slouken added a commit that referenced this issue Mar 14, 2023
This fixes handling the 8BitDo SN30 Pro with the 2.00 firmware in PS4 mode

Fixes #7270

(cherry picked from commit 3951cae)
(cherry picked from commit 57ae9f4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants