moonlight-stream / moonlight-qt

GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
GNU General Public License v3.0
10.31k stars 603 forks source link

(Linux) Support all Playstation Dualsense features with Sunshine's new virtual gamepad library #1329

Open MwenDavo opened 3 months ago

MwenDavo commented 3 months ago

Is your feature request related to a problem? Please describe. Right now, Moonlight only exposes either an Xbox 360 controller or a Dualshock 4. With the upcoming changes to Sunshine's virtual gamepad library (link) implementing new virtual controllers (like Xbox One, Switch Pro Controller, Joycons and Dualsense), Moonlight should detect the current controllers and map them accordingly, including all of their special features.

Describe the solution you'd like Moonlight should be able to detect a specific controller along with its features and map it to the virtual one on the host so that it acts like it were connected directly to the host.

Describe alternatives you've considered Using usbip to directly send USB data over IP works correctly, but having this implemented directly to Moonlight would be much simpler and user-friendly.

Additional context Dualsense features: Lightbar (similar to Dualshock 4 but with aditional leds on the bottom for player number), Touchpad (equal to Dualshock 4), Adaptive Triggers (HID device that controls the trigger motors), Haptic Feedback (sound device that is always named "Wireless Device" and has a 4.0 output, with the front 2 channels being for the 3.5mm jack and the rear ones for the Haptic Feedback itself).

Xbox One features: Impulse Triggers (vibration motors for the triggers, but unlike the Dualsense's Adaptive Triggers they don't modify the force needed to push the trigger itself).

Switch Pro Controller / Joycon: HD Rumble (similar to Dualsense's Haptic Feedback, though I haven't tested how they work on PC), player number lights

cgutman commented 3 months ago

Dualsense features: Lightbar (similar to Dualshock 4 but with aditional leds on the bottom for player number), Touchpad (equal to Dualshock 4), Adaptive Triggers (HID device that controls the trigger motors), Haptic Feedback (sound device that is always named "Wireless Device" and has a 4.0 output, with the front 2 channels being for the 3.5mm jack and the rear ones for the Haptic Feedback itself).

Everything here is already supported except sound and adaptive triggers (which SDL doesn't support, so that blocks us)

Xbox One features: Impulse Triggers (vibration motors for the triggers, but unlike the Dualsense's Adaptive Triggers they don't modify the force needed to push the trigger itself).

Trigger rumble is also already supported.

Switch Pro Controller / Joycon: HD Rumble (similar to Dualsense's Haptic Feedback, though I haven't tested how they work on PC), player number lights

HD rumble should work, I think. Player number lights aren't (for Xbox 360 either). Plumbing player numbers through the protocol would be easy, but I'm still not totally sold on the idea because of weirdness that would happen when mixing controller types (especially those with and without player number indicators) and when exceeding the predefined player number limits between potentially multiple concurrent Moonlight streams.

MwenDavo commented 3 months ago

Everything here is already supported except sound and adaptive triggers (which SDL doesn't support, so that blocks us)

Is the use of SDL for this features necessary? They could be implemented on a per-OS basis since how each OS handles it varies differently. If not, then it will have to wait until support for this is implemented on SDL.

HD rumble should work, I think. Player number lights aren't (for Xbox 360 either). Plumbing player numbers through the protocol would be easy, but I'm still not totally sold on the idea because of weirdness that would happen when mixing controller types (especially those with and without player number indicators) and when exceeding the predefined player number limits between potentially multiple concurrent Moonlight streams.

I hadn't thought of this use case, and I totally agree with you on the weirdness that these situations could bring, so it would make sense to not implement it at all.