Widevine DASH "Error decrypting data" for L1 and droppedFrames for L3, only on some devices
Issue description
We are experiencing playback issues on some devices when trying to play Widevine encrypted content. More precisely, the video stops after 10-30 seconds for L1 devices, and lags very badly for L3 devices ( despite the fact that playback continues ).
Most of our investigations were performed on a Samsung S4 with Android 5.0, but similar behaviour was reported on a few more models. Whereas other devices have no problems whatsoever.
The L1 exception is always thrown for us when the video switches to HD, after 10-30 seconds.
We have tried to programatically force a maximum width of 640. At first it seemed that it could keep up, but eventually the same happened ( after close to a minute of playback - actual timespan may vary ).
We have also tried to force L3 on the device. The result was lagging and dropped frames, same as devices that don't support L1 by default.
It also seems that memory usage keeps increasing after playback starts, which might suggest a buffer overrun during decryption.
The first seconds of the video seem to play fine for both L1 & L3 -> probably because they are not encrypted?
We kind of ruled out a license problem, since everything runs fine on several other devices. And as far as we know, the license doesn't have a very limited duration once obtained.
We've researched similar posts, but couldn't derive a conclusive answer. So we were hoping your superior knowledge and experience could confirm whether:
- Are there known issues with specific devices and if there is any way to outline at least the popular models?
- Do you think this is more likely a problem at encoding/encryption level? And if yes, does anybody have any suggestion what precisely to look at?
Thanks in advance!
Reproduction steps
This can be constantly reproduced for our videos on the devices affected, both in our app and in ExoPlayer demo. It's important to mention that sample videos do not exhibit this behaviour, although some of the secure HD ones lag a bit.
Link to test content
We might be able to provide sample over email. Not sure how helpful it would be, since we have a slightly custom token based licensing process, which expires after some time. The license is also wrapped in a JSON response and we had to alter a bit the parsing in ExoPlayer to make it work.
Copying the .mpd contents below for reference:
<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:DASH:schema:MPD:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd" minBufferTime="PT2S" type="static" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" mediaPresentationDuration="PT1438.280029296875S">
<Period>
<AdaptationSet id="0">
<Representation id="0" bandwidth="712390" codecs="avc1.4d401e" mimeType="video/mp4" width="640" height="360">
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" />
<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />
<SegmentBase indexRange="1035-5398" timescale="25000">
<Initialization range="0-1034" />
</SegmentBase>
</Representation>
<Representation id="2" bandwidth="1212786" codecs="avc1.4d401f" mimeType="video/mp4" width="960" height="540">
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" />
<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />
<SegmentBase indexRange="1037-5400" timescale="25000">
<Initialization range="0-1036" />
</SegmentBase>
</Representation>
<Representation id="3" bandwidth="1912971" codecs="avc1.4d401f" mimeType="video/mp4" width="1280" height="720">
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" />
<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />
<SegmentBase indexRange="1039-5402" timescale="25000">
<Initialization range="0-1038" />
</SegmentBase>
</Representation>
<Representation id="4" bandwidth="3013428" codecs="avc1.4d401f" mimeType="video/mp4" width="1280" height="720">
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" />
<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />
<SegmentBase indexRange="1039-5402" timescale="25000">
<Initialization range="0-1038" />
</SegmentBase>
</Representation>
<Representation id="5" bandwidth="4014575" codecs="avc1.4d4028" mimeType="video/mp4" width="1920" height="1080">
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" />
<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />
<SegmentBase indexRange="1037-5400" timescale="25000">
<Initialization range="0-1036" />
</SegmentBase>
</Representation>
</AdaptationSet>
<AdaptationSet id="1">
<Representation id="1" bandwidth="67385" codecs="mp4a.40.2" mimeType="audio/mp4" audioSamplingRate="32000">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" />
<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" />
<SegmentBase indexRange="889-9356" timescale="32000">
<Initialization range="0-888" />
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
Version of ExoPlayer being used
We are using currently using ExoPlayer 2.2.0 in our app. But we experienced the same behaviour when we configured one of our videos in ExoPlayer demo app 2.5.4. ( might have been 2.6.0 - need to check )
Device(s) and version(s) of Android being used
We could reliably reproduce the issue on:
- Samsung Galaxy S4 Android 5.X ( L1 confirmed - exception )
- AllView Viper V2 ( L3 confirmed - lag )
- Amazon Fire ( lag )
We also received reports from:
- Samsung Galaxy S6 ( lag )
- Nexus 6 ( lag )
- Sony Xperia X / Xperia XZ ( exception )
- Yoga tablet ( exception )
No issues reported with video playback:
- Samsung Galaxy S8 with Android 7
- Samsung Galaxy S7 with Android 7
- HTC Nexus 9 tablet with Android 5.1.1
- Samsung mini 4.4.2
- Samsung tab 4 mini 4.4.2
- Google Pixel Android 8
- Nexus 5 with Android 5.X
- Nexus 7
A full bug report captured from the device
We might be able to send a full report over email, but only if really needed. Copying basic log for reference below:
- CryptoException L1 ( code = -2998 ? )
11-29 13:44:24.627 18513-18700/com.google.android.exoplayer2.demo E/ExoPlayerImplInternal: Renderer error.
com.google.android.exoplayer2.ExoPlaybackException
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:764)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:553)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:560)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:306)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.media.MediaCodec$CryptoException: Error decrypting data.
at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:956)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:748)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:553)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:560)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:306)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)
11-29 13:44:24.627 18513-18722/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] Now Executing->Idle
11-29 13:44:24.637 18513-18513/com.google.android.exoplayer2.demo E/EventLogger: playerFailed [70.77]
com.google.android.exoplayer2.ExoPlaybackException
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:764)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:553)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:560)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:306)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: android.media.MediaCodec$CryptoException: Error decrypting data.
at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:956)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:748)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:553)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:560)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:306)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:145)
at android.os.HandlerThread.run(HandlerThread.java:61)
- Dropped frames L3
11-29 13:52:11.918 16760-16760/com.google.android.exoplayer2.demo D/EventLogger: droppedFrames [167.80, 50]
11-29 13:52:18.078 16760-16760/com.google.android.exoplayer2.demo D/EventLogger: droppedFrames [173.96, 50]
11-29 13:52:24.724 16760-16760/com.google.android.exoplayer2.demo D/EventLogger: droppedFrames [180.61, 50]
11-29 13:52:34.519 16760-16760/com.google.android.exoplayer2.demo D/EventLogger: droppedFrames [190.40, 50]
11-29 13:52:41.776 16760-16760/com.google.android.exoplayer2.demo D/EventLogger: droppedFrames [197.66, 50]
11-29 13:52:51.719 16760-16760/com.google.android.exoplayer2.demo D/EventLogger: droppedFrames [207.60, 50]
- Codec initialisation for avc: Samsung Galaxy S4 i9515 - chipset Qualcomm APQ8064T Snapdragon 600:
11-29 14:00:12.562 21996-21996/com.google.android.exoplayer2.demo D/EventLogger: [X] Track:0, id=0, mimeType=video/avc, bitrate=712310, res=640x360, supported=YES
11-29 14:00:12.562 21996-21996/com.google.android.exoplayer2.demo D/EventLogger: [X] Track:1, id=2, mimeType=video/avc, bitrate=1212294, res=960x540, supported=YES
11-29 14:00:12.562 21996-21996/com.google.android.exoplayer2.demo D/EventLogger: [X] Track:2, id=3, mimeType=video/avc, bitrate=1912203, res=1280x720, supported=YES
11-29 14:00:12.562 21996-21996/com.google.android.exoplayer2.demo D/EventLogger: [X] Track:3, id=4, mimeType=video/avc, bitrate=3012143, res=1280x720, supported=YES
11-29 14:00:12.562 21996-21996/com.google.android.exoplayer2.demo D/EventLogger: [X] Track:4, id=5, mimeType=video/avc, bitrate=4012058, res=1920x1080, supported=YES
11-29 14:00:13.202 21996-22260/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] Now Loaded
11-29 14:00:13.202 21996-22260/com.google.android.exoplayer2.demo E/ACodec: onConfigureComponent mime.c_str() = video/avc
11-29 14:00:13.202 21996-22260/com.google.android.exoplayer2.demo E/ACodec: [OMX.qcom.video.decoder.avc.secure] storeMetaDataInBuffers failed w/ err -2147483648
11-29 14:00:13.202 21996-22260/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] prepareForAdaptivePlayback(1920x1080)
11-29 14:00:13.202 21996-22260/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] DRC Mode: Adaptive Mode
11-29 14:00:13.212 21996-22260/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] OMX_QCOM_FramePacking_OnlyOneCompleteFrame is setting
11-29 14:00:13.212 21996-22260/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] Now Loaded->Idle
11-29 14:00:13.212 21996-22260/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] configureOutputBuffersFromNativeWindow setBufferCount : 22, minUndequeuedBuffers : 4
11-29 14:00:13.212 21996-22260/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] Allocating 22 buffers from a native window of size 3137536 on output port
11-29 14:00:13.232 21996-22260/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] Now Idle->Executing
11-29 14:00:13.232 21996-21996/com.google.android.exoplayer2.demo D/EventLogger: videoDecoderInitialized [1.46, OMX.qcom.video.decoder.avc.secure]
11-29 14:00:13.232 21996-21996/com.google.android.exoplayer2.demo D/EventLogger: videoFormatChanged [1.46, id=0, mimeType=video/avc, bitrate=712310, res=640x360]
11-29 14:00:13.763 21996-22260/com.google.android.exoplayer2.demo I/ACodec: [OMX.qcom.video.decoder.avc.secure] Now Executing
Regarding the CryptoException during L1 playback: can you reproduce this on a device running a build from Marshmallow onwards? Apparently this kind of error has a more precise message on later builds. A full bug report may also help with diagnosing the problem. The codec initialization logging looks fine.
Hi, as requested please provide full bug reports for each issue. Snippets are not all that informative. thank you.
Hi guys, Thanks for the quick reply. We'll try to provide full logs first thing next week over email. Any other info that you might find useful?
Regarding Marshmallow, I think the S4 can't update officially. But we'll check with our other reporters for more info.
Hello @predaV, if you could provide more details like builds on the devices that are exhibiting the issue and any of those details on some of the working examples. Shouldn't need them all defined but having more data is typically better to narrow down on the issue.
Hi all, Sorry for the delay. We're awaiting approval to share with you our modified version of ExoPlayer, which included one of our DRM videos & custom license. Should we still send a full log report as well?
In the meantime, we got some additional info:
-
When we forced L3 on the Samsung S4 ( which is reported as L1 ), even the ExoPlayer's sample DRM streams experienced lag / freeze. By default in L1: the samples seemed fine, while our videos completely stopped after 10-30s.
-
The droppedFrames issue was also reported to us on the following devices. Can't confirm whether they are L3, but they seem so given the behaviour. It's also interesting to note that some models seem to be able to struggle with lagging playback, while on others the video freezes after some time, but audio still runs.
Sony Xperia Z5 Premium - Android 7.1 Sony Xperia Z5 Compact - Android 7.1.1 Sony Xperia XZ1 - Android 8.0 Samsung Galaxy Tab 3 - Android 4.4.2 Samsung Galaxy S4 Active - Android 5.0.1 Samsung Note 4 - Android 6.0 Ulefone Paris - Android 5.1 Nokia 5 - Android 7.1.2 Nokia 3 - Android 7.1.2 Lenovo Tab 2 - Android 5.1.1 Huawei MediaPad T1 10 - Android 4.4.4 Huawei P8 - Android 5.0.2
Please let us know when you can get the custom Exoplayer for testing. Full ADB logs are most helpful.
Hi all, Thanks again for the patience. We've just sent a first bug report over email.
We're still awaiting approval to disclose the sample code with our video. But I'm confident we'll get that soon. I believe if you manage to replicate the behaviour on your end, it would be most helpful.
Hi, We've just shared the modified files from the ExoPlayer demo over email, in order to include one of our videos. Please note the video & hardcoded token have a limited timespan, but we asked for it to be at least 2 weeks.
Don't hesitate to let us know if any further details are needed.
We greatly appreciate your help on this!
Hi predaV, I'm looking into reproducing the issue, but the tokens have expired. Could I get a new token to update for the license?
Thanks!
Hi astinus-1, I've sent the updated files via email.
Thank you for looking into it!
@predaV when will the tokens expire? unfortunately @astinus-1 has been other wise occupied for the past week.
Guys, I've sent an update via email. This won't expire too soon.
Thanks got the update in email. will attempt to repro again.
Hi.
Do you have any updates on this issue? Were you able to confirm it?
I'm asking because we also have an issue regarding playing back of DRMed content on some L1 devices. On other devices it plays OK. Our problem also happens with DASH and the video stream has the codec avc1.4d401f.
No problem when not using DRM.
Hi guys,
we use avc1.4d401f for 960x540, 1280x720 and avc1.4d4028 for 1920x1080.
On Wed, Jan 31, 2018 at 1:17 PM, funnay [email protected] wrote:
Hi.
Do you have any updates on this issue? Were you able to confirm it?
I'm asking because we also have an issue regarding playing back of DRMed content on some L1 devices. Not exactly like this one though. Our problem also happens with DASH and the video stream has the codec avc1.4d401f.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/ExoPlayer/issues/3517#issuecomment-361902110, or mute the thread https://github.com/notifications/unsubscribe-auth/AhnyFV0mj1c5exxRHfDXJJ71A7fwsEyxks5tQEvRgaJpZM4QvGEu .
Still getting a token error when attempting to repro:
I/HttpMediaDrmCallback( 4146): Response: {"correlationId":"302619ff-64ba-4350-ae4e-b7add61e397e","isException":true,"title":"com.theplatform.module.exception.ValidationException","description":"You must provide a valid token for authentication.","responseCode":422}
Hi guys,
attached with a new token.
On Wed, Feb 14, 2018 at 1:09 AM, astinus-1 [email protected] wrote:
Still getting a token error when attempting to repro:
I/HttpMediaDrmCallback( 4146): Response: {"correlationId":"302619ff- 64ba-4350-ae4e-b7add61e397e","isException":true,"title":" com.theplatform.module.exception.ValidationException","description":"You must provide a valid token for authentication.","responseCode":422}
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/ExoPlayer/issues/3517#issuecomment-365436921, or mute the thread https://github.com/notifications/unsubscribe-auth/AhnyFblqwM9wF41nZgxxOMZ5XgxFFvf2ks5tUhYUgaJpZM4QvGEu .
Hi @astinus-1 can you attempt to repro again?
@belanagyb we did not see/get the attached token. Can you please resend/attach? last email/token I can find is from jan 18. thanks.
I sent it 10 days ago, but here it is again.
On Thu, Mar 1, 2018 at 5:44 PM, wvpaf [email protected] wrote:
@belanagyb https://github.com/belanagyb we did not see/get the attached token. Can you please resend/attach? last email/token I can find is from jan 18. thanks.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/ExoPlayer/issues/3517#issuecomment-369633271, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFljprEvzKLafaZJZgw96T6vX9KJr1gks5taBdvgaJpZM4QvGEu .