androidx / androidx/media

Audio sink error in HLS streams

Open
#3,067 5 comments 0 reactions 1 assignee View on GitHub

@tianyif is already working on this.

Since Feb 13, 2026.

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

Description

Version

Media3 main branch

More version details

commit: 4f16e8bba2caf76fedf92d14f16f697b302536f6

Devices that reproduce the issue

We've seen this issue on pretty much all devices we've tested, but for instance:

  • Google Pixel 7A, Android 16
  • Samsung SM-S928B, Android 16.
Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps
  1. Play the attached media in the demo app
  2. Check the logs, almost immediately there will be Audio sink errors visible
  3. There are continuously ads in the stream, watching an ad break, about 3 or 4 ads in the ad break you'll see picture freezing while audio continues to play.
Expected result

SSAI ads should play normally without stuttering or freezing

Actual result

Our SSAI ads are playing normally for a while, but then the picture of the ads freeze while audio plays, then after a while we get an error: "Player stuck buffering with no progress for 600000 ms". Checking the logs there is a visible Audio sink error:

Audio sink error
androidx.media3.exoplayer.audio.AudioSink$UnexpectedDiscontinuityException: Unexpected audio track timestamp discontinuity: expected 1003631332333, got 1003630440000
    at androidx.media3.exoplayer.audio.DefaultAudioSink.handleBuffer(DefaultAudioSink.java:1010)
    at androidx.media3.exoplayer.audio.MediaCodecAudioRenderer.processOutputBuffer(MediaCodecAudioRenderer.java:867)
    at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:2266)
    at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:952)
    at androidx.media3.exoplayer.RendererHolder.render(RendererHolder.java:392)
    at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1388)
    at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:711)
    at android.os.Handler.dispatchMessage(Handler.java:128)
    at android.os.Looper.dispatchMessage(Looper.java:333)
    at android.os.Looper.loopOnce(Looper.java:263)
    at android.os.Looper.loop(Looper.java:367)
    at android.os.HandlerThread.run(HandlerThread.java:139)

In our app we can also see this (Media3 ExoPlayer 1.9.1):

  androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
    at androidx.media3.exoplayer.ExoPlayerImpl$ComponentListener.onStuckPlayerDetected(ExoPlayerImpl.java:3629)
    at androidx.media3.common.util.StuckPlayerDetector$StuckBufferingDetector.update(StuckPlayerDetector.java:194)
    at androidx.media3.common.util.StuckPlayerDetector.handleMessage(StuckPlayerDetector.java:127)
    at androidx.media3.common.util.StuckPlayerDetector.$r8$lambda$O20OfWQe0IImnmxCKXMyVoyaxfk(Unknown Source:0)
    at androidx.media3.common.util.StuckPlayerDetector$$ExternalSyntheticLambda0.handleMessage(D8$$SyntheticClass:0)
    at android.os.Handler.dispatchMessage(Handler.java:128)
    at android.os.Looper.dispatchMessage(Looper.java:333)
    at android.os.Looper.loopOnce(Looper.java:263)
    at android.os.Looper.loop(Looper.java:367)
    at android.app.ActivityThread.main(ActivityThread.java:9287)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
  Caused by: androidx.media3.common.util.StuckPlayerException: Player stuck buffering with no progress for 600000 ms
    ... 12 more

We've seen similar Audio Sink errors in previous Media3 ExoPlayer versions - 1.6.1 - but after bumping to 1.9.0 / 1.9.1 ads got a lot more unstable. This seems to happen primarily to live streams with a shifting start window. These streams had the problems in this issue where Window.windowStartTimeMs became TIME_UNSET, this seems to be partially fixed, however the value does not seem to update properly anymore, the window start time seems to stay the same for minutes sometimes causing calculation problems.

Media

https://prism.a2d-stage.tv/hls/init.m3u8?stream=aHR0cHM6Ly9saXZlLnN0cmVhbWluZy5hMmQudHYvYXNzZXQvMjA4MjE3MjMuaXNtbC8ubTN1OA==&adUrl=aHR0cHM6Ly9kb3dubG9hZHMuYTJkLnR2L3ByaXNtL3Rlc3R2YXN0LXdpdGgtZmlsbGVyLnhtbA==&adType=vast

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.