Fix navigation audio capture via AudioPolicy loopback; remove local-mute setting#47
Merged
Merged
Conversation
PrivilegedService (shell UID 2000) now registers an AudioPolicy loopback mix covering media + assistance/navigation/alarm/notification usages so Tesla mirroring receives all system audio, not just music. AudioRecord construction is wrapped with Binder.clearCallingIdentity() and a temporary Application.mBase swap so AttributionSource reports shell uid + com.android.shell, satisfying AudioFlinger's ValidatedAttributionSource checks. With real loopback capture, the prior "mute local audio" setting (which silenced stream volumes and therefore silenced REMOTE_SUBMIX too) is incompatible. Removed the toggle, preference key, MirrorForegroundService stream-volume manipulation, Shizuku `media volume --set 0` shell calls, and the muteLocalAudio input on AudioPolicy/AudioCaptureOrchestrator. Expanded scrcpy attribution in README (all locales) and NOTICE to specifically call out the SurfaceControl panel-power and fillAppInfo/FakeContext patterns this PR now extends to audio capture. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
PrivilegedService(Shizuku shell UID 2000) now registers an AudioPolicy loopback mix covering media, assistance/navigation, alarm, notification, voice-communication usages — so Tesla mirroring receives navigation prompts + system sounds, not just music.AudioRecordconstruction is wrapped withBinder.clearCallingIdentity()+ a temporaryApplication.mBaseswap soAttributionSourcereports shell uid (2000) +com.android.shell, satisfying AudioFlinger'sValidatedAttributionSourceStatechecks.muteMediaVolume/restoreMediaVolume, Shizukumedia volume --set 0shell calls,muteLocalAudioonAudioPolicy/AudioCaptureOrchestrator). The old approach silenced stream volumes, which also silencedREMOTE_SUBMIXcapture under the new loopback path — incompatible with real audio streaming.SurfaceControlpanel power control (existing) andfillAppInfo/FakeContextforAttributionSourcespoofing (new, for audio capture).Test plan
./gradlew :app:testDebugUnitTest—AudioPolicyTest+AudioCaptureOrchestratorTestpass after removingmuteLocalAudioinputs./gradlew :app:assembleDebug— compiles cleanly🤖 Generated with Claude Code