androidx / androidx/media

Audiotrack stale playback head on ac3/eac3 audio, after seeking. playback stopped.

Open
#3,269 1 comment 3 reactions 1 assignee View on GitHub

@tianyif is already working on this.

Since Jun 15, 2026.

bug needs triage
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 1.10.1

More version details

No response

Devices that reproduce the issue

Device: Hisense SmartTV 4K FFM / 65U75LUA
Android: 12, API 31
Build: STT2.230310.002 / 00.00.00.132
Security patch: 2025-05-01
SoC/platform: MediaTek MT9689 / mt5896
ABI: armeabi-v7a, armeabi only; 32-bit zygote
Display: 3840x2160 panel, Android override 1920x1080
Audio output: HDMI ARC, 48 kHz primary mixer
Media3: 1.10.1

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

Created basic Android TV application with Media 3 as player - with some logging from Media3. Play an mp4 with direct-play Dolby-style encoded audio, i think limited to AC3 and EAC3. seeking forward will likely not play, will be stuck at 'buffering', though it is not buffering. seeking generally can produce this error > 50% of the time.

Expected result

From logs:

  1. The new encoded AudioTrack may still briefly start with a stale playback head.
  2. But after play(), the playback head resets to 0.
  3. audioTrackPositionAdvancing fires.
  4. Playback continues normally.
Actual result

From the logs, the failed seek pattern looked like this:

  1. Media3 successfully seeks inside the existing source buffer.
  2. The old AC3/EAC3 AudioTrack is released/paused with a non-zero playback head.
  3. A new direct encoded AudioTrack is created, but it starts with that same stale non-zero playback head.
  4. play() is called, but the playback head does not reset.
  5. Playback then gets stuck with repeated writes returning 0, playState=2, and the playback head never advancing.

i've created a fix for my local test project, which works... though i'm not filing a PR as i doubt this is a proper fix. but it does stop the issue from happening:

https://github.com/soloish90/media/tree/ac3-eac3-audiotrack-stale-head-proof

Media

Not applicable. any media with ac3/eac3 encoded audio.

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.