Skip to content

Fix navigation audio capture via AudioPolicy loopback; remove local-mute setting#47

Merged
Suprhimp merged 1 commit into
masterfrom
devplanningo/fix-audio-ui
Apr 24, 2026
Merged

Fix navigation audio capture via AudioPolicy loopback; remove local-mute setting#47
Suprhimp merged 1 commit into
masterfrom
devplanningo/fix-audio-ui

Conversation

@Suprhimp
Copy link
Copy Markdown
Owner

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.
  • AudioRecord construction is wrapped with Binder.clearCallingIdentity() + a temporary Application.mBase swap so AttributionSource reports shell uid (2000) + com.android.shell, satisfying AudioFlinger's ValidatedAttributionSourceState checks.
  • Removed the "로컬 오디오 음소거 / Mute local audio" setting (toggle, preference key, muteMediaVolume/restoreMediaVolume, Shizuku media volume --set 0 shell calls, muteLocalAudio on AudioPolicy/AudioCaptureOrchestrator). The old approach silenced stream volumes, which also silenced REMOTE_SUBMIX capture under the new loopback path — incompatible with real audio streaming.
  • Expanded scrcpy attribution in README (all locales) + NOTICE to specifically cite the two scrcpy patterns this project now uses: SurfaceControl panel power control (existing) and fillAppInfo/FakeContext for AttributionSource spoofing (new, for audio capture).

Test plan

  • ./gradlew :app:testDebugUnitTestAudioPolicyTest + AudioCaptureOrchestratorTest pass after removing muteLocalAudio inputs
  • ./gradlew :app:assembleDebug — compiles cleanly
  • Verified on device: navigation audio from Google Maps / T맵 reaches Tesla browser through Opus/PCM paths
  • Verified on device: media audio still streams and stops correctly when browser disconnects
  • Re-verify audio capture on a fresh Shizuku session after app reinstall

🤖 Generated with Claude Code

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>
@Suprhimp Suprhimp added the minor Version bump: minor (1.2.3 → 1.3.0) label Apr 24, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
website Ready Ready Preview, Comment Apr 24, 2026 4:25pm

@Suprhimp Suprhimp merged commit 498641a into master Apr 24, 2026
4 checks passed
@Suprhimp Suprhimp deleted the devplanningo/fix-audio-ui branch April 24, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Version bump: minor (1.2.3 → 1.3.0)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant