SDL icon indicating copy to clipboard operation
SDL copied to clipboard

DualShock 3: SDL_SetGamepadLED -> That operation is not supported

Open Megamouse opened this issue 6 months ago • 2 comments

Hi,

I'm using a DualShock 3 on SDL 3.2.14 on Win11 and the properties report SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN and SDL_PROP_GAMEPAD_CAP_MONO_LED_BOOLEAN.

But whenever I call SDL_SetGamepadLED (generic call when the LEDs are available) it will return an error "That operation is not supported".

I'm using SDL_HINT_JOYSTICK_HIDAPI_PS3_SIXAXIS_DRIVER "1".

Is this a bug or an unsupported driver ? Why is it reporting the LED but then fails the call ?

The DS3 only has red player LED indicators, so the properties are clearly wrong in my opinion.

Megamouse avatar May 25 '25 16:05 Megamouse

The mono LED property is only set by the Logitech driver, so I'm surprised that it's showing true for the DualShock 3 controller. Can you provide your full code?

slouken avatar May 26 '25 18:05 slouken

https://github.com/RPCS3/rpcs3/blob/2d9a24d1d6ef0682cfed9ee04d411a8caac9f15a/rpcs3/Input/sdl_pad_handler.cpp#L815

https://github.com/RPCS3/rpcs3/blob/2d9a24d1d6ef0682cfed9ee04d411a8caac9f15a/rpcs3/Input/sdl_pad_handler.cpp#L268

Megamouse avatar May 28 '25 05:05 Megamouse

Oh, I see the problem. You're checking SDL_HasProperty(), and that returns true, because the property exists, but is set to false.

Those calls should be:

info.has_led = SDL_GetBooleanProperty(property_id, SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN, false);

slouken avatar Sep 07 '25 22:09 slouken

Ah ... I remember. This code was part of the port from SDL2 to SDL3. The guide didn't say how to use the new properties, so I must've found that function instead

Megamouse avatar Sep 08 '25 19:09 Megamouse