Skip to content

fix(android-auto): silent start, MODE resume, and search play - #16

Open
thecyberix wants to merge 198 commits into
maxrave-dev:mainfrom
thecyberix:fix/aa-silent-startup-audio-focus
Open

fix(android-auto): silent start, MODE resume, and search play#16
thecyberix wants to merge 198 commits into
maxrave-dev:mainfrom
thecyberix:fix/aa-silent-startup-audio-focus

Conversation

@thecyberix

Copy link
Copy Markdown

Summary

  • Route MediaSession play/pause through the crossfade adapter so audio focus is requested before ExoPlayer starts (fixes Android Auto showing playing with silence).
  • Arm playback resume across MODE/USB/radio audio source switches after transient focus loss.
  • Resolve Android Auto search selections that are not yet in Room before starting playback.

Test plan

  • Connect Android Auto; start playback from the app, then from AA home — audio should play (not silent).
  • While playing, switch audio source (e.g. MODE/USB/radio) and return — playback should resume when focus returns.
  • Use AA voice/search to play a track not in local library — playback should start after resolve.
  • Regression: normal phone playback, pause/resume, and Cast (if applicable) unchanged.

maxrave-dev and others added 29 commits June 3, 2026 00:19
…eriodically

#2155: manage a single app-level AudioFocusRequest in CrossfadeExoPlayerAdapter instead of per-player handleAudioFocus. Releasing the outgoing player no longer abandons audio focus, so playback stops pausing between tracks on background autoplay (cf. androidx/media#2100). Handles GAIN/LOSS/TRANSIENT/DUCK and abandons on stop/release.

#2152: save playback position to DataStore every 5s while playing so a background process kill resumes at the right position instead of restarting the track; also cancel the previous progress loop to avoid leaking duplicate save loops.
Signed-off-by: Nguyễn Đức Tuấn Minh <ndtminh2608@gmail.com>
Signed-off-by: Nguyễn Đức Tuấn Minh <ndtminh2608@gmail.com>
# Conflicts:
#	media/media3/build.gradle.kts
#	media/media3/src/main/java/com/maxrave/media3/service/SimpleMediaService.kt
…-window

Disable VLC video output for audio playback
Signed-off-by: Nguyễn Đức Tuấn Minh <ndtminh2608@gmail.com>
MediaSession play went straight to ExoPlayer without requesting audio focus, so AA could show playing with silence. Route play/pause through the adapter, arm resume across MODE/USB/radio source switches, and resolve AA search hits that are not yet in Room.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

3 participants