Description
I have a DualShock 4 connected through the official Sony DUALSHOCK 4 USB Wireless Adaptor on Windows.
Added HIDAPI device 'PS4 Controller' VID 0x054c, PID 0x0ba0, bluetooth 0, version 256, serial f4-93-9f-c3-d5-fe, interface 3, interface_class 0, interface_subclass 0, interface_protocol 0, usage page 0x0001, usage 0x0005, path = \?\HID#VID_054C&PID_0BA0&MI_03#c&306d498d&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}, driver = SDL_JOYSTICK_HIDAPI_PS4 (ENABLED)
Since about version 3.4.10 and above the controller no longer automatically changes its light bar to blue (player 1) automatically on startup or when set manually via SDL_SetGamepadPlayerIndex().
This was working correctly with SDL 3.4.4.
Bug present in SDL 3.4.10 ... 3.4.16.
NB: Did not try SDL 3.4.6 and 3.4.8.
But setting it to the 2nd player
SDL_SetGamepadPlayerIndex(gamepad, 1);
does change the LED to red (expected behavior).
Expected behavior
When the DS4 is assigned to player 1 (player_index = 0), the light bar should turn blue.
This was the behavior I had with SDL 3.4.4.
Actual behavior
With SDL 3.4.16:
SDL_SetGamepadPlayerIndex(gamepad, 0);
does not change the light bar.
The player index is nevertheless correctly reported as 0:
SDL_Log("player index = %d", SDL_GetGamepadPlayerIndex(gamepad));
// player index = 0
Interestingly assigning the controller to player 2 does work correctly:
SDL_SetGamepadPlayerIndex(gamepad, 1);
The player index becomes 1 and the light bar changes to red, as expected.
Additional testing
- I verified that the underlying LED functionality works correctly with
SDL_SetGamepadLED().
- I tried changing the hint
SDL_HINT_JOYSTICK_ENHANCED_REPORTS but this had no effect on the issue.
Description
I have a DualShock 4 connected through the official Sony DUALSHOCK 4 USB Wireless Adaptor on Windows.
Since about version
3.4.10and above the controller no longer automatically changes its light bar to blue (player 1) automatically on startup or when set manually viaSDL_SetGamepadPlayerIndex().This was working correctly with SDL
3.4.4.Bug present in SDL
3.4.10...3.4.16.NB: Did not try SDL
3.4.6and3.4.8.But setting it to the 2nd player
does change the LED to red (expected behavior).
Expected behavior
When the DS4 is assigned to player 1 (player_index = 0), the light bar should turn blue.
This was the behavior I had with SDL
3.4.4.Actual behavior
With SDL
3.4.16:does not change the light bar.
The player index is nevertheless correctly reported as 0:
Interestingly assigning the controller to player 2 does work correctly:
The player index becomes 1 and the light bar changes to red, as expected.
Additional testing
SDL_SetGamepadLED().SDL_HINT_JOYSTICK_ENHANCED_REPORTSbut this had no effect on the issue.