Skip to content

DRM & ClearKey 1.4.X Unexpected runtime error on FireTV Stick 4K #1732

Closed

Description

@KingLucius

Version

Media3 1.4.0

More version details

From 1.4.0 and up has this issue, downgrading to 1.3.1 fixes it

Devices that reproduce the issue

Amazon FireTV Stick 4K (Mantis)

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

I can provide sample ClearKey link in private to test

Expected result

Media working like in 1.3.1

Actual result

09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal: Playback error
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:   androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:720)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at android.os.Handler.dispatchMessage(Handler.java:98)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at android.os.Looper.loop(Looper.java:154)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at android.os.HandlerThread.run(HandlerThread.java:61)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:   Caused by: android.media.MediaCodec$CryptoException: Operation not supported in this configuration
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2584)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.dequeueOutputBufferIndex(SynchronousMediaCodecAdapter.java:108)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:1994)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:873)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:1018)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1136)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:561)
09-13 07:39:36.096 18108 18297 E ExoPlayerImplInternal:       ... 3 more
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal: Disable failed.
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:   android.media.MediaCodec$CryptoException: Operation not supported in this configuration
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at android.media.MediaCodec.native_flush(Native Method)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at android.media.MediaCodec.flush(MediaCodec.java:2068)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.flush(SynchronousMediaCodecAdapter.java:168)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.flushCodec(MediaCodecRenderer.java:960)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.flushOrReleaseCodec(MediaCodecRenderer.java:953)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:780)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onDisabled(MediaCodecVideoRenderer.java:794)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.BaseRenderer.disable(BaseRenderer.java:220)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:1846)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:1566)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:1523)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:722)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at android.os.Handler.dispatchMessage(Handler.java:98)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at android.os.Looper.loop(Looper.java:154)
09-13 07:39:36.097 18108 18297 E ExoPlayerImplInternal:       at android.os.HandlerThread.run(HandlerThread.java:61)

Media

Will send to android-media-github@google.com

Bug Report

Activity

  1. icbaker commented on Sep 17, 2024

    @icbaker
    Collaborator

    We didn't receive this. Please re-send it with subject Issue #1732. Thanks!

  2. KingLucius commented on Sep 20, 2024

    @KingLucius
    Author

    We didn't receive this. Please re-send it with subject Issue #1732. Thanks!

    Done

  3. icbaker commented on Sep 20, 2024

    @icbaker
    Collaborator

    The email contains a logcat snippet, not the zip file produced by adb bugreport. The full bugreport often contains additional info which can help to understand issues. Please run adb bugreport after reproducing the issue, and email us the resulting zip file, then update this issue.

  4. KingLucius commented on Sep 20, 2024

    @KingLucius
    Author

    The email contains a logcat snippet, not the zip file produced by adb bugreport. The full bugreport often contains additional info which can help to understand issues. Please run adb bugreport after reproducing the issue, and email us the resulting zip file, then update this issue.

    Updated the email with adb bugreport zip file result

  5. 41 remaining items

  6. KingLucius commented on Dec 17, 2024

    @KingLucius
    Author

    As a double-check, I have hardcoded mediaCryptoRequiresSecureDecoder as false and media worked on Fire stick

    maybeInitCodecWithFallback(mediaCrypto, mediaCryptoRequiresSecureDecoder);

  7. KingLucius commented on Dec 22, 2024

    @KingLucius
    Author

    Any ETA when this issue can be resolved ?

  8. KingLucius commented on Feb 7, 2025

    @KingLucius
    Author

    Any update?

  9. icbaker commented on Feb 18, 2025

    @icbaker
    Collaborator

    Looking into this again - my hypothesis from #1732 (comment) can't be correct because in the FireTV BR provided by @KingLucius the device reports its API level as 25 ([ro.build.version.sdk]: [25]) and the Xiaomi TV looks like it's API 23 (based on the screenshot provided in #2088). Both of these are lower than 31, which is when the framework MediaDrm.requiresSecureDecoder method was added. So this bug can't be about a discrepancy between the return values of the framework MediaCrypto and MediaDrm methods.

    New, related, hypothesis: We're entering this catch block:

    try {
    mediaCrypto = new MediaCrypto(uuid, sessionId);
    result = mediaCrypto.requiresSecureDecoderComponent(mimeType);
    } catch (MediaCryptoException e) {
    // This shouldn't happen, but if it does then assume that a secure decoder may be required.
    result = true;
    } finally {

    @KingLucius Would you be able to add a bit of logging to confirm that?

  10. KingLucius commented on Feb 21, 2025

    @KingLucius
    Author

    Image

    Image

    FrameworkMediaDrm.requiresSecureDecoder() Exception Exception Details =>android.media.MediaCryptoException: Failed to instantiate crypto object. drmSession.requiresSecureDecoder()=true FrameworkMediaDrm.requiresSecureDecoder() Exception Exception Details =>android.media.MediaCryptoException: Failed to instantiate crypto object.

  11. FongMi commented on Feb 21, 2025

    @FongMi

    Finally, I make result = fasle when catch expection, it's works.

  12. Tangsan99999 commented on Feb 25, 2025

    @Tangsan99999

    wow, its work. thanks @FongMi

  13. icbaker commented on Feb 25, 2025

    @icbaker
    Collaborator

    While looking to make the change to set result = false for ClearKey in that catch block I spotted the probable cause for the exception in the first place - and fixed that too. The fix is in the commit linked above.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions