Skip to content

feat(input): DualSense firmware passthrough, player LED and mic LED forwarding#1854

Open
hkirste wants to merge 1 commit into
moonlight-stream:masterfrom
hkirste:feat/dualsense-firmware-passthrough
Open

feat(input): DualSense firmware passthrough, player LED and mic LED forwarding#1854
hkirste wants to merge 1 commit into
moonlight-stream:masterfrom
hkirste:feat/dualsense-firmware-passthrough

Conversation

@hkirste
Copy link
Copy Markdown

@hkirste hkirste commented Apr 5, 2026

Summary

Three DualSense streaming enhancements:

Firmware version passthrough:

  • Reads HID feature report 0x20 from the physical DualSense on controller arrival
  • Sends the raw 64-byte firmware blob to the host as a TLV metadata extension
  • Host uses it to configure the virtual DualSense with matching firmware, preventing "firmware update required" prompts from Steam/Windows
  • Uses Windows HID API (CreateFile + HidD_GetFeature) with shared access since SDL's game controller backend holds the device exclusively
  • Gracefully skips if the device can't be opened or the report read fails

Player LED forwarding (protocol 0x5504):

  • Receives player indicator LED state from the host and applies it to the physical DualSense via SDL_GameControllerSendEffect
  • Standard values: P1=0x04, P2=0x0A, P3=0x15, P4=0x1B, all=0x1F

Mic LED forwarding (protocol 0x5505):

  • Receives mic mute LED state from the host (off/on/pulse) and applies it to the physical DualSense

All features are PS5-only (SDL_CONTROLLER_TYPE_PS5 check) and require SDL 2.0.16+. Firmware read requires SDL 2.0.18+ and is Windows-only (#ifdef _WIN32).

Dependencies

Test plan

  • Physical DualSense firmware Jul 4 2025 successfully passed through to virtual DualSense on host
  • Player LED indicators reflect on physical controller when set by host games
  • Mic LED state (off/on/pulse) reflects on physical controller
  • All existing controller features (rumble, lightbar, adaptive triggers, gyro) unaffected
  • Builds on Windows, macOS, Linux (AppImage), SteamLink — CI passes all platforms

When a DualSense (PS5) controller connects, read the raw HID firmware
report (feature report 0x20) from the physical controller and send it
to the host as a TLV metadata extension on the controller arrival event.

This allows the host to configure the virtual DualSense with the real
controller's firmware version, preventing firmware update prompts and
improving compatibility with applications that inspect firmware data.

On Windows, uses the native HID API (CreateFile + HidD_GetFeature) with
shared access since SDL's game controller backend holds the device
exclusively and SDL_hid_open cannot obtain a second handle.

Gracefully skips if the HID device can't be opened or the feature report
read fails. Requires SDL 2.0.18+ for SDL_hid_enumerate.

Bumps moonlight-common-c submodule for TLV metadata protocol extension.
@cgutman cgutman added this to the v7.0 milestone Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants