Ohjurot / DualSense-Windows

Windows API for the PS5 DualSense controller
Other
342 stars 38 forks source link

Question - Haptic feedback #18

Closed grill2010 closed 3 years ago

grill2010 commented 3 years ago

Hi,

I'm currently writing a library for Android which allows it to natively process inputs from Dualshock and Dualsense controller. I would like to use the haptic feedback instead of rumble emulation. I found your project and it seems quite nice :) The reason why I want to add haptic feedback is that I have a 3rd Party PlayStation Remote Play app and I receive haptic audio feedback data from the PS5 but I don't know what to do with this data. I guess I have to forward the data to the USB audio output endpoint of the Dualsense controller but unfortunately it doesn't do anything. Yesterday I found this interesting topic on reddit

https://www.reddit.com/r/PS5/comments/jnp8tu/heres_how_to_get_audio_haptic_feedback_with/

So it seems it works fine. Do you have any experience in regards to this topic (as you have it mentioned in your roadmap)? Or maybe even somewhere a proof of concept example? Any help would be appreciated, feel free to close this issue.

Ohjurot commented 3 years ago

Hey, nice library idea! You are right, you have to write the data to the DS5 audio device. I have only tested this on windows, but I assume that it should work an all other OSs the same way (using their native enumeration and audio features). The haptics are on the audio channels 3 and 4. I have a working example in my gists (you need to copy in the local device ID of your dual sense manually to make it work): https://gist.github.com/Ohjurot/b0c04dfbd25fb71bc0da50947d313d1b

grill2010 commented 3 years ago

Awesome thanks very much :) I will check it out in the next few days. 👍

Ohjurot commented 3 years ago

Closing this issue now. If you have any more questions, feel free to open a new one.

grill2010 commented 3 years ago

Sorry forgot to provide some feedback. I got it working with the some other 3rd Party library on Android which allows to send some isochronous audio messages to the controller. Unfortunately the haptic feedback feeling isn't correct but as I get the haptic feedback data from the PS5 via the remote play protocol I'm not sure if this is because of the haptic feedback data itself or the way I send the isochronous audio data to the device. It's currently on hold but I will definitely get back to it at some point.