Skip to content

Forward native GameStream microphone audio on Android - #1632

Open
Bargs wants to merge 1 commit into
moonlight-stream:masterfrom
Bargs:native-microphone-forwarding
Open

Bargs wants to merge 1 commit into
moonlight-stream:masterfrom
Bargs:native-microphone-forwarding

Conversation

@Bargs

@Bargs Bargs commented Nov 7, 2026

Copy link
Copy Markdown

Add microphone forwarding from Android to a compatible NVIDIA GameStream host. Android 6 or later is required for this capture path.

The streaming setting starts off for each app process. Explicit opt-in requests Android's recording permission. Capture starts only after native negotiation succeeds and shows an in-stream indicator. Activity pause or disconnect stops capture and joins the worker before shared connection teardown. Reconnect after returning to the foreground to start a new capture session.

AudioRecord supplies mono 48 kHz PCM. The JNI adapter encodes fixed 5 ms Opus frames and uses the sender in common-c PR173. The Windows host companion documents exact NVIDIA compatibility, the host changes, source build and manual recovery. Android's existing video and playback paths remain available when capture cannot start.

Validation includes the complete non-root arm64 debug app build with SDK 37, NDK 29.0.14206865 and Gradle 9.7.1. The native library built and linked, Java and resource compilation passed, and the APK contains the arm64 library. Permission prompts, physical recording, device loss, activity pause and live Windows input still need a device pass.

Native GameStream uses legacy AES-CBC without packet authentication, with repeated IVs and overlapping playback/microphone domains. This route requires private IPv4 on a trusted network or a secured tunnel. The Foundation/Sunshine microphone work is separate.

Add per-run consent and recording permission, AudioRecord capture with Opus/JNI transport, an active indicator, and joined shutdown on activity pause and connection teardown.
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