Skip to content

SDL2: Fix PDP Afterglow Wireless Controller for Nintendo Switch #13308

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

Open
wants to merge 1 commit into
base: SDL2
Choose a base branch
from

Conversation

SupergiantDexter
Copy link

Description

I received a few reports from players that the PDP Afterglow Wireless Controller caused Hades II to lock up and become nearly unresponsive. After acquiring the controller, this was readily reproducible by plugging it into a PC via cable. I noticed the same behavior on macOS, but not on Linux (via Proton).

The controller is intended for wireless use only according to the product manual. When connected over USB, BReadDeviceInfo() fails to get a response. This kicks the can down the road to SDL_JoystickOpen, where the controller is equally unresponsive and procs the Couldn't load stick calibration error. However, the SDL_JOYDEVICEADDED event continues firing, which is the source of the lock-up. Early-outing in HIDAPI_DriverSwitch_InitDevice() seemed reasonable in this case.

It might be better to simply return false if BReadDeviceInfo() also returns false, but I don't know if that'll work with all controllers. This is similar to the PowerA controller that's ignored in SDL_joystick.c, which is also a "Lic Wireless Controller" in Windows. I tried ignoring the PDP controller too, but that prevented it from working over Bluetooth, which how I ended up with this fix.

(I found a similar report on the Factorio support forum, but I was unable to repro this on the latest Steam build.)

This controller is primarily designed for wireless use. When connected
over USB, BReadDeviceInfo() fails to get a response. This kicks the can
down the road to SDL_JoystickOpen, where the controller is equally
unresponsive. SDL_JOYDEVICEADDED continues firing, leading certain
games to lock up as long as the controller is plugged in. Early-outing
in HIDAPI_DriverSwitch_InitDevice() seems reasonable in this case.

Factorio support forum: https://forums.factorio.com/viewtopic.php?t=116336
Product Guide: https://support.turtlebeach.com/s/article/Afterglow-Wireless-Deluxe-Controller-for-Nintendo-Switch-Setup?language=en_US&co=en_US
@slouken
Copy link
Collaborator

slouken commented Jul 2, 2025

Unfortunately this is too broad. We should instead use the VID/PID to mark this as unsupported.

@slouken
Copy link
Collaborator

slouken commented Jul 2, 2025

I assume the device has a different VID/PID over Bluetooth?

@SupergiantDexter
Copy link
Author

I double-checked this morning and the VID/PID are the same between Bluetooth mode and USB (all of this is on my Windows 11 machine):
vid: 0x0E6F device->vendor_id
pid: 0x0186 device->product_id

I tried adding an exclusion here, but this prevents the controller from connecting in Bluetooth mode. That may still be the best course of action, though.

static Uint32 initial_blacklist_devices[] = {
// ...
MAKE_VIDPID(0x0e6f, 0x0186),

Looks like this doesn't occur on SDL3 in part due to this line in HIDAPI_AddDevice:
device->is_bluetooth = (info->bus_type == SDL_HID_API_BUS_BLUETOOTH);

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

Successfully merging this pull request may close these issues.

2 participants