Visitar URL original
Widevine VP9 Playback Issues on Some Devices · Issue #2408 · androidx/media · GitHub
Skip to content

Widevine VP9 Playback Issues on Some Devices #2408

Closed

Description

@surmay

Version

Media3 1.6.1

More version details

Media3 1.4.0 was not affected.

Issue appears to start in commit bffa253

Devices that reproduce the issue

Redmi Note 8
Samsung SM-A146U1
Samsung SM-T515

Devices that do not reproduce the issue

Pixel

Reproducible in the demo app?

Yes

Reproduction steps

  1. Play "HD (cenc, full-sample)" under the "Widevine DASH (WebM, VP9)" section in the demo app

Expected result

The media plays successfully

Actual result

Playback crashes with the following stacktrace:

05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: Video codec error
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: java.lang.IllegalStateException
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3452)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:112)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:2032)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:878)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1261)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at androidx.media3.exoplayer.RendererHolder.render(RendererHolder.java:381)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1329)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:646)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at android.os.Handler.dispatchMessage(Handler.java:102)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at android.os.Looper.loop(Looper.java:236)
05-08 17:31:28.245 25686 26455 E MediaCodecVideoRenderer: at android.os.HandlerThread.run(HandlerThread.java:67)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: Playback error
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(4, null, video/webm, video/x-vnd.on2.vp9, vp9, 4889229, en, [1920, 856, 23.809525, null], [-1, -1]), format_supported=YES
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:745)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at android.os.Handler.dispatchMessage(Handler.java:102)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at android.os.Looper.loop(Looper.java:236)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at android.os.HandlerThread.run(HandlerThread.java:67)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: Caused by: androidx.media3.exoplayer.video.MediaCodecVideoDecoderException: Decoder failed: OMX.MTK.VIDEO.DECODER.VP9.secure
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:2330)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:902)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1261)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.RendererHolder.render(RendererHolder.java:381)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1329)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:646)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: ... 3 more
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: Caused by: java.lang.IllegalStateException
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3452)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:112)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:2032)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:878)
05-08 17:31:28.248 25686 26455 E ExoPlayerImplInternal: ... 7 more

Media

Widevine DASH (WebM, VP9) > HD (cenc, full-sample)

Bug Report

Activity

  1. surmay commented on May 8, 2025

    @surmay
    Author

    Note that I called out bffa253 where I bisected the issue in the demo app.

    In our app, the problematic commit on these devices is 6b56f12

  2. icbaker commented on May 12, 2025

    @icbaker
    Collaborator

    Are you able to depend on media3 locally?

    If so, please can you see if modifying this logic to also include VP9 resolves the issue?

    // Remove the initialization data from the format if present when dealing with AV1, as it is not
    // required for playing AV1 video.
    // Reference: https://developer.android.com/reference/android/media/MediaCodec#CSD
    if (Objects.equals(newFormat.sampleMimeType, MimeTypes.VIDEO_AV1)
    && !newFormat.initializationData.isEmpty()) {
    newFormat = newFormat.buildUpon().setInitializationData(null).build();
    }

    So it becomes:

    if ((Objects.equals(newFormat.sampleMimeType, MimeTypes.VIDEO_AV1)
            || Objects.equals(newFormat.sampleMimeType, MimeTypes.VIDEO_VP9))
        && !newFormat.initializationData.isEmpty()) {
      newFormat = newFormat.buildUpon().setInitializationData(null).build();
    }
  3. surmay commented on May 12, 2025

    @surmay
    Author

    Applying your patch works for the devices we have in our lab (previously, ~10 were failing)

  4. icbaker commented on May 13, 2025

    @icbaker
    Collaborator

    Thanks for the report, and for checking the fix - I've submitted this change in the commit linked above.

  5. locked and limited conversation to collaborators on Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions