Skip to content

Fix missing rumble/LED/gyro for PS4/PS5 controllers over Bluetooth#1133

Open
crocchetto wants to merge 2 commits into
Kenix3:mainfrom
crocchetto:main
Open

Fix missing rumble/LED/gyro for PS4/PS5 controllers over Bluetooth#1133
crocchetto wants to merge 2 commits into
Kenix3:mainfrom
crocchetto:main

Conversation

@crocchetto

Copy link
Copy Markdown

Rumble, LED control, and gyro are unavailable when connected via Bluetooth because SDL2 gates them behind "extended input report" mode, off by default, which must be requested via hint before SDL_Init().

Tested on macOS 15.6.1, rumble/LED/gyro now work over Bluetooth.

@briaguya0 briaguya0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 of the hints aren't needed, the other 2 we shouldn't set unconditionally.

i don't want people with ps4/ps5 controllers to need to power cycle them whenever they open soh and then want to play another game.

if we add these, it should be done in an opt-in way

}

SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should already be set

from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI_PS4

The default is the value of SDL_HINT_JOYSTICK_HIDAPI

from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI

"1": HIDAPI drivers are used (the default)

SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5, "1");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as HIDAPI_PS4

from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI_PS5

The default is the value of SDL_HINT_JOYSTICK_HIDAPI


SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't come without side-effects

from https://wiki.libsdl.org/SDL2/SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE

Extended input reports allow rumble on Bluetooth PS4 controllers, but break DirectInput handling for applications that don't use SDL.

Once extended reports are enabled, they can not be disabled without power cycling the controller.

SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5, "1");
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as HIDAPI_PS4_RUMBLE

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