question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MediaDrmStateException occurs during download and streaming playback.

See original GitHub issue

This exception occurs on Pixel devices, but only on certain devices, not all devices.

Searched documentation and issues

・ExoPlayer Javadoc. ・ExoPlayer Issues

Question

An exception occurs during streaming and download playback. This exception occurs on Pixel devices, but only on certain devices, not all devices. The source code is the same as # 8175. When I checked the error log, I asked a question because it was different from the error log that occurred in the past.

  • Is this exception the same cause as past problems (#8175, #8655)?

Error log during streaming playback

ExoPlayerImplInternal: Renderer error: index=0, type=video, format=Format(3, null, null, video/avc, avc1.4d4028, 1000000, null, [800, 450, 29.97003], [-1, -1]), rendererSupport=NO_UNSUPPORTED_DRM
ExoPlayerImplInternal: com.google.android.exoplayer2.ExoPlaybackException: android.media.MediaCodec$CodecException: Error 0xffffffe0
ExoPlayerImplInternal:  at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.a(MediaCodecRenderer.java:48)
ExoPlayerImplInternal:  at m.c.b.b.z.a(BaseRenderer.java:14)
ExoPlayerImplInternal:  at m.c.b.b.j0.handleMessage(ExoPlayerImplInternal.java:24)
ExoPlayerImplInternal:  at m.c.b.b.j0.b(ExoPlayerImplInternal.java:161)
ExoPlayerImplInternal:  at android.os.Handler.dispatchMessage(Handler.java:102)
ExoPlayerImplInternal:  at android.os.Looper.loop(Looper.java:223)
ExoPlayerImplInternal:  at android.os.HandlerThread.run(HandlerThread.java:67)
ExoPlayerImplInternal:  at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
ExoPlayerImplInternal: Caused by: android.media.MediaCodec$CodecException: Error 0xffffffe0
ExoPlayerImplInternal:  at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2821)
ExoPlayerImplInternal:  at m.c.b.b.o1.r.a(SynchronousMediaCodecAdapter.java:6)
ExoPlayerImplInternal:  at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.q(MediaCodecRenderer.java:81)
ExoPlayerImplInternal:  at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.a(MediaCodecRenderer.java:37)

Error log during download playback

ExoPlayerImplInternal: Source error.
ExoPlayerImplInternal: com.google.android.exoplayer2.drm.DrmSession$DrmSessionException: java.lang.IllegalArgumentException: Failed to restore keys
ExoPlayerImplInternal:         at com.google.android.exoplayer2.drm.DefaultDrmSession.a(DefaultDrmSession.java:44)
ExoPlayerImplInternal:         at com.google.android.exoplayer2.drm.DefaultDrmSession.h(DefaultDrmSession.java:3)
ExoPlayerImplInternal:         at com.google.android.exoplayer2.drm.DefaultDrmSession.a(DefaultDrmSession.java:30)
ExoPlayerImplInternal:         at com.google.android.exoplayer2.drm.DefaultDrmSession.b(DefaultDrmSession.java:9)
ExoPlayerImplInternal:         at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.a(DefaultDrmSessionManager.java:58)
ExoPlayerImplInternal:         at m.c.b.b.s1.k0.a(SampleQueue.java:152)
ExoPlayerImplInternal:         at m.c.b.b.s1.k0.a(SampleQueue.java:64)
ExoPlayerImplInternal:         at m.c.b.b.s1.q0.g.a(ChunkSampleStream.java:68)
ExoPlayerImplInternal:         at m.c.b.b.s1.k0.a(SampleQueue.java:8)
ExoPlayerImplInternal:         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.a(MediaCodecRenderer.java:30)
ExoPlayerImplInternal:         at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.b(MediaCodecRenderer.java:3)
ExoPlayerImplInternal:         at m.c.b.b.z.a(BaseRenderer.java:15)
ExoPlayerImplInternal:         at m.c.b.b.j0.handleMessage(ExoPlayerImplInternal.java:24)
ExoPlayerImplInternal:         at m.c.b.b.j0.b(ExoPlayerImplInternal.java:161)
ExoPlayerImplInternal:         at android.os.Handler.dispatchMessage(Handler.java:102)
ExoPlayerImplInternal:         at android.os.HandlerThread.run(HandlerThread.java:67)
ExoPlayerImplInternal:         at android.os.Looper.loop(Looper.java:223)
ExoPlayerImplInternal: Caused by: java.lang.IllegalArgumentException: Failed to restore keys
ExoPlayerImplInternal:         at android.media.MediaDrm.restoreKeys(Native Method)
ExoPlayerImplInternal:         at m.c.b.b.m1.t.a(FrameworkMediaDrm.java:83)
ExoPlayerImplInternal:         at com.google.android.exoplayer2.drm.DefaultDrmSession.h(DefaultDrmSession.java:1)

Version of ExoPlayer being used: 2.12.1

A full bug report captured from the device

I sent it to dev.exoplayer@gmail.com.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rrfriascommented, Aug 10, 2021

Thanks @nbennink, we were able to reproduce with the apk you shared. We are investigating with Qualcomm.

0reactions
rrfriascommented, Nov 2, 2021

Re-encoding might help but there might still be an underlying issue. Reassigning to @fredgc to follow up on 182495765

Read more comments on GitHub >

github_iconTop Results From Across the Web

MediaDrm.MediaDrmStateException - Android Developers
Thrown when a general failure occurs during a MediaDrm operation. ... Prints this throwable and its backtrace to the standard error stream.
Read more >
HOW TO FIX ALL DSTV NOW ERROR CODES - YouTube
DSTV is the largest satellite TV company in Africa with over 20 million paid subscribers across the continent. You can literally watch ......
Read more >
My movie won't play or is showing an error - Google Help
Based on your data plan, streaming a movie may result in extra charges. Step 2: Delete the app's cache. On your device, open...
Read more >
Known Issues - Brightcove Beacon Studio Home
This occurs because it takes a number of seconds for the stream to be released ... when your app is resumed from background...
Read more >
Failed to handle key response: General DRM error - Stack ...
The content play well until 10 minutes(playback_duration_seconds) after downloaded. Post that if i play, Exoplayer lib is trying to make ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found