libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10.23k stars 1.87k forks source link

Unable to enable Enhanced Reports on DualSense over Bluetooth #10086

Open timoschwarzer opened 5 months ago

timoschwarzer commented 5 months ago

In SDL3 it is currently impossible to enable Enhanced Reports over Bluetooth for DualSense controllers. By default, DualSense controllers are in a "basic" mode when connected over bluetooth. In this mode, it doesn't send sensor and touchpad data, nor can you use advanced controller features such as setting LED lights or rumble.

In SDL2 one could set the SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE hint for SDL to put the controller into enhanced mode. In SDL3 the crucial part was removed, leaving the code for enabling enhanced mode unable to be called ever.

SDL2: https://github.com/libsdl-org/SDL/blob/6a2dd96ac7ce5c0575e91290a983048c0e5e6d2c/src/joystick/hidapi/SDL_hidapi_ps5.c#L400-L427 SDL3: https://github.com/libsdl-org/SDL/blob/ba188e7555b873cbb57c9c5ee7ae6dc5a7bd872e/src/joystick/hidapi/SDL_hidapi_ps5.c#L416-L435

On that note, I want to suggest a different name for the hint in SDL3, since I find SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE rather confusing. Since I think most library end users would want to enable the enhanced mode anyways to be able to use all SDL gamepad features, I'd propose enabling enhanced mode by default and adding a hint to disable it specifically: SDL_HINT_JOYSTICK_HIDAPI_PS5_DISABLE_ENHANCED_BLUETOOTH

I'm willing to do the necessary work, but I wanted to gather some opinions about it first.

slouken commented 4 months ago

FYI, I haven't forgotten about this. I think it's a good idea, and I am going to see if we can default these features on in Steam.

timoschwarzer commented 4 months ago

Did you mean SDL? :sweat_smile: