Current Dualsense support

Hi all. I have a question about the current support of the Dualsense (playstation 5) controller.

I noticed the PS5 driver currently reports no support for Joystick LED, in spite of having a working implementation for setting the LED. I tried changing the reporting to true, and it works.

There already is a function for “rumble triggers” (which is the xbox one feature) but there is no implementation to control the adaptive triggers from there.

The mic light has an implementation but is unused.

Is there any dev branch or fork that is working on these mssing features at the moment? I might even be able to contribute, since I am doing development for JoyShockMapper and wish to use those features through SDL2 as much as possible.

AFAIK features you mentioned are not implemented. Contributions are welcomed.

Welp, I created my own fork to start working on some of this stuff.

How do I go about with negotiating the interface of the library?

I want to expand on the existing GameControllerTriggerRumble( ) system in place to add other trigger effects, rumble being on of them. And I would like to have all the parameters passed through a structure filled by the caller so that the structure can be expanded as needed without changing the signature of the interface.

Can I change the name of the existing function to TriggerEffect instead of TriggerRumble? Or should I create a parallel system? Or should I get TriggerRumble to call my own TriggerEffect under the hood?

I fixed the PS5 reporting LED support, thanks!

If you want a generic interface for PS5 trigger support, you probably want a way for the application to submit a full effects block and have the driver update it with the internal state as needed. I haven’t done that because it would probably be more useful for game developers to have a more descriptive way to identify trigger effects and parameters, but I’m not sure what that should look like yet.

1 Like

Hi @slouken, thanks for your answer. I’ve refined my fork quite a bit and documented my interface. Would you like to comment on my design (maybe I should create a pull request?). I’ll try to find default values for trigger rumble on the dualsense.

I created a PR #4393

Hi @Slouklen. I am making use of the added JoystickSendEffect method from the commit d135c0762f11c29eb9cce377648f25e5a91b4522 and reusing the DS5EffectsState_t structure(SDL_hidapi_ps5.c L107). It does allow me to make use of the adaptive triggers as I need. Not only that but it also give me access to the microphone LED that isn’t accessible otherwise.

I am however running into some issues when I try to use the legacy rumbling and the adaptive triggers at the same time (I did not have this issue with my version). Basically, when I send the adaptive trigger data through SendEffect, any rumbling stops immediately. I believe this is because the driver keeps a context object (SDL_hidapi_ps5.c L152) that contains some data related to rumbling and more that I do not have access to anymore, and sending the adaptive trigger command overrides some commands.

I tried keeping track of the rumlbing data myself and sending it with the adaptive trigger data, but it didn’t fix the issue, so I suspect there’s more to it.

I don’t have a suggestion for a fix at this point. I’m just informing you of this problem with my usage of SDL2 and the SendEffect method to use Adaptive Triggers.

Nevermind, I forgot to set the enable bit flag… :man_facepalming:
I do have to track every feature: rumble, mic light and adaptive triggers to make sure using one doesn’t undo the others, so that’s a known issue / behaviour of the SendEffect function.

Hi, is this merged? Looking to use the dualsense features too.

Edit: I guess it’s possible to use your @Electronicks fork, though I have no idea how to do that yet

It is merged and I make use of it in JoyShockMapper if you would like a usage example of SendEffect.