Skip to content

Add native GameStream microphone negotiation and shared transport - #173

Open
Bargs wants to merge 12 commits into
moonlight-stream:masterfrom
Bargs:native-mic-negotiation
Open

Bargs wants to merge 12 commits into
moonlight-stream:masterfrom
Bargs:native-mic-negotiation

Conversation

@Bargs

@Bargs Bargs commented Nov 6, 2026 •

Copy link
Copy Markdown

Add opt-in NVIDIA GameStream microphone negotiation and a reusable sender for client capture adapters. The default leaves the handshake unchanged.

The negotiated microphone port can be deferred by an SDP zero and resolved by optional SETUP. Strict parsing rejects malformed ports. A successful opted-in client can create a sender for the resolved private IPv4 endpoint in the negotiated encrypted-audio mode, then pass 20-byte mono Opus frames. Common-c handles the fixed UDP source port, RTP headers, legacy CBC and PINGs. Clients own permission, capture, Opus encoding and teardown. One sender belongs to each opted-in connection.

This is paired with desktop client PR2095 and the Windows host companion. The companion uses the existing receiver on an exact NVIDIA version set and discloses its local patch, registry flags, SYSTEM helper, source build, optional launcher and rollback.

Legacy CBC provides no packet authentication and has repeated IVs and overlapping playback/microphone domains. The private IPv4 restriction limits scope to a trusted network or separately secured tunnel. Sunshine microphone protocols are separate.

Common-c Debug/Release builds, 59 parser cases and 24 simulated SETUP state/reply cases plus seven gates passed locally. The portable sender built with the actual common-c crypto backend. The desktop SDL and Embedded SDL adapters each produced 300 independently decrypted and decoded frames from dummy capture on macOS. Full Windows/Linux and physical device checks remain pending. Historical speech from the Mac used the earlier helper. The distributed host build has public build and fixture evidence, with live installation/audio, reboot and rollback still to validate. Runtime patch atomicity and handle lifetime also need review.

Would maintainers prefer the optional source-built launcher with full manual instructions, the manual/source-build path, or another integration and distribution approach?

Bargs added 11 commits November 6, 2026 15:00
Added resetNativeMicState() calls to stop connection and decoder functions.
Added experimental support for NVIDIA GameStream microphone setup and querying.
Added documentation for microphone negotiation parser tests, including build instructions and usage notes.
This draft outlines the experimental native microphone negotiation for NVIDIA GameStream, detailing session behavior, compatibility, and future directions for implementation.
Add a step to test microphone negotiation parsers in CI workflow.
Support deferred NVIDIA ports, expose the resolved encrypted native endpoint, and document the paired opt-in client and experimental host scope.
Send fixed-size Opus frames through the negotiated private IPv4 endpoint. Reuse the platform socket and crypto layers for legacy CBC, RTP framing and periodic pings. Leave capture, consent and Opus encoding to the client.
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.

1 participant