feat(protocol): TLV metadata on controller arrival, player LED and mic LED extensions#137
Open
hkirste wants to merge 2 commits intomoonlight-stream:masterfrom
Open
feat(protocol): TLV metadata on controller arrival, player LED and mic LED extensions#137hkirste wants to merge 2 commits intomoonlight-stream:masterfrom
hkirste wants to merge 2 commits intomoonlight-stream:masterfrom
Conversation
Add LiSendControllerArrivalEventWithMetadata() which appends optional TLV (Type-Length-Value) entries after the fixed controller arrival fields. This enables clients to pass through controller-specific metadata such as firmware version info to the host. The host can use this to configure the virtual controller more accurately (e.g., matching the real DualSense firmware version on the virtual device). The existing LiSendControllerArrivalEvent() is preserved as a thin wrapper for backwards compatibility. Old hosts that don't know about TLV extensions will simply ignore the extra trailing bytes since they only read the fixed fields they know about. Defined tags: - LI_CTRL_META_TAG_FIRMWARE_INFO (0x01): 64-byte raw HID feature report 0x20
Add Sunshine protocol extensions 0x5504 (player LED) and 0x5505 (mic LED) for forwarding DualSense indicator states from host to client. Player LED carries a 5-bit bitmask for the indicator LEDs. Mic LED carries a state byte: 0=off, 1=on, 2=pulse. Adds ConnListenerSetPlayerLed and ConnListenerSetMicLed callbacks to CONNECTION_LISTENER_CALLBACKS.
5 tasks
moyogii
added a commit
to moyogii/moonlight-common-c
that referenced
this pull request
Apr 5, 2026
Implements three Sunshine protocol extensions for DualSense controller support (based on moonlight-stream#137 by Heinz Kirste): - TLV metadata on controller arrival: LiSendControllerArrivalEventWithMetadata() appends optional TLV entries after the fixed arrival packet fields. LI_CTRL_META_TAG_FIRMWARE_INFO carries the raw 64-byte HID feature report 0x20 for firmware passthrough. Existing LiSendControllerArrivalEvent() preserved as a backwards-compatible wrapper. - Player LED (0x5504): forwards 5-bit player indicator LED bitmask from host to client via ConnListenerSetPlayerLed callback. - Mic LED (0x5505): forwards mic mute LED state from host to client (off/on/pulse) via ConnListenerSetMicLed callback. Original implementation by Heinz Kirste (hkirste@outlook.com). moonlight-stream#137 Co-Authored-By: Heinz Kirste <hkirste@outlook.com>
moyogii
added a commit
to moyogii/moonlight-common-c
that referenced
this pull request
Apr 5, 2026
Implements three Sunshine protocol extensions for DualSense controller support (based on moonlight-stream#137 by Heinz Kirste): - TLV metadata on controller arrival: LiSendControllerArrivalEventWithMetadata() appends optional TLV entries after the fixed arrival packet fields. LI_CTRL_META_TAG_FIRMWARE_INFO carries the raw 64-byte HID feature report 0x20 for firmware passthrough. Existing LiSendControllerArrivalEvent() preserved as a backwards-compatible wrapper. - Player LED (0x5504): forwards 5-bit player indicator LED bitmask from host to client via ConnListenerSetPlayerLed callback. - Mic LED (0x5505): forwards mic mute LED state from host to client (off/on/pulse) via ConnListenerSetMicLed callback. Original implementation by Heinz Kirste (hkirste@outlook.com). moonlight-stream#137 Co-Authored-By: Heinz Kirste <hkirste@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three Sunshine protocol extensions for DualSense controller support:
TLV metadata on controller arrival:
LiSendControllerArrivalEventWithMetadata()appends optional TLV (Type-Length-Value) entries after the fixed arrival packet fieldsLI_CTRL_META_TAG_FIRMWARE_INFO(0x01): carries the raw 64-byte HID feature report 0x20 from the client's physical controllerLiSendControllerArrivalEvent()preserved as a thin wrapper (backwards compatible)Player LED (0x5504):
Mic LED (0x5505):
Adds
ConnListenerSetPlayerLedandConnListenerSetMicLedtoCONNECTION_LISTENER_CALLBACKS.Context
These extensions support Sunshine's WinUHid-based virtual DualSense emulation on Windows (LizardByte/Sunshine#4948). The firmware passthrough prevents spurious "firmware update required" prompts, and the LED extensions enable full DualSense indicator fidelity during streaming.
Test plan