Widevine DASH "Failed to get key request" on Android 5.x
Widevine DASH "Failed to get key request" on Android 5.x
Issue description
We have some live content that we're unable to get DRM license keys for on devices with Android 5.x. Everything works fine on Android 6 and up. I've tried putting a failing asset in the ExoPlayer demo and it fails in the same way. I've also tested the same failing asset with the Shaka player demo and the issue DOES NOT exist there.
Reproduction steps
Added the asset with the license URL to ExoPlayer Demo. Attempt to play the asset and a playback error occurs.
Link to test content
Will email test content.
Version of ExoPlayer being used
2.7.3
Device(s) and version(s) of Android being used
Nexus 7 (2013) - Android 5.1.1 Nexus 6 - Android 5.1.1 Samsung Galaxy S5 - Android 5.1.1
A full bug report captured from the device
Will email bug report.
I can reproduce the problem on a Nexus 6. Forwarding to @paf-wv to take a look as it's a platform DRM error [Bugreport and media/drm url are in the email].
I found out that the Shaka player demo plays content with L3 security level instead of L1. I thought I could force L3 as a temporary workaround for this since it has fixed some other DRM issues in the past for me but it turns out to not help in this case. Are there any plans to look at this issue or any updates? I haven't found a way to work around this.
@paf-wv - Please take a look at this
We're working on locking down our streams to prepare for release which means the live asset I provided will soon be inaccessible. This will likely happen within a few weeks. Is there any chance this will get looked at before then?
In the bugreport you provided, we see the following log lines that indicate what is happening when the failure occurs:
06-14 17:22:31.261 185 30261 W WVCdm : CdmEngine::ExtractWidevinePssh: PSSH flags not zero 06-14 17:22:31.261 185 30261 I WVCdm : CdmEngine::GenerateKeyRequest 06-14 17:22:31.262 185 30261 W WVCdm : CdmSession::GenerateKeyRequest: init data absent
The PSSH flags are defined in the DASH - 23001-7 ISO BMFF Common Encryption, section 8.1.2 as being 0. There was a check in android L that verified the flags are zero, which was removed in M and newer releases, which allowed non-compliant PSSH boxes to be processed. If you can check your content and make sure the flags get set to 0 when generated, then it should resolve your problem with playback of this media.
We managed to update the PSSH box in a live asset to fix the issue. I no longer get the error about the PSSH flags not being 0 and the content now plays fine on 5.x.
Great @SeanYouI, we'll close this. please reopen or start a new case if you face further issues.
Hi
I tried to play DRM file its not playing its showing some error can you pls suggest me the way of integration.
Version of ExoPlayer being used 'com.google.android.exoplayer:exoplayer:2.7.3'
Player Integration:
DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
int errorStringId = R.string.error_drm_unknown;
DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager = null;
try {
String drmSchemeExtra = DRM_SCHEME;
UUID drmSchemeUuid = Util.getDrmUuid(drmSchemeExtra);
if (drmSchemeUuid == null) {
errorStringId = R.string.error_drm_unsupported_scheme;
} else {
String[] keyRequestPropertiesArray = new String[]{};
drmSessionManager =
buildDrmSessionManagerV18(
drmSchemeUuid, movie.getDrmLicence(), keyRequestPropertiesArray,false);
}
} catch (UnsupportedDrmException e) {
errorStringId = e.reason == UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME
? R.string.error_drm_unsupported_scheme : R.string.error_drm_unknown;
}
if (drmSessionManager == null) {
showToast(activity.getString(errorStringId));
//activity.finish();
return;
}
boolean preferExtensionDecoders = false;
@DefaultRenderersFactory.ExtensionRendererMode int extensionRendererMode =
((IdeaApplication) activity.getApplication()).useExtensionRenderers()
? (preferExtensionDecoders ? DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER
: DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON)
: DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF;
DefaultRenderersFactory renderersFactory = new DefaultRenderersFactory(context, drmSessionManager,extensionRendererMode);
// Create a player instance.
player = ExoPlayerFactory.newSimpleInstance(context,trackSelector,new DefaultLoadControl(),drmSessionManager);
Testing DRM:
"uri": "https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd", "drm_scheme": "widevine", "drm_license_url": "https://proxy.uat.widevine.com/proxy?video_id=0894c7c8719b28a0&provider=widevine_test"
Error Report:
E/ExoPlayerImplInternal: Playback error. com.google.android.exoplayer2.ExoPlaybackException at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.throwDecoderInitError(MediaCodecRenderer.java:420) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:407) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:898) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:468) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:551) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:522) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:305) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61) Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc.secure, Format(video/5, null, video/avc, 799530, null, [640, 360, 25.0], [-1, -1]) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:407) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:898) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:468) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:551) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:522) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:305) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61) Caused by: android.media.MediaCodec$CodecException: start failed at android.media.MediaCodec.native_start(Native Method) at android.media.MediaCodec.start(MediaCodec.java:1892) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:400) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:898) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:468) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:551) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:522) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:305) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61) 01-10 13:21:00.300 20257-20611/com.ideacellular.digitalvideo E/ExoPlayerImplInternal: Stop failed. java.lang.IllegalStateException at android.media.MediaCodec.native_stop(Native Method) at android.media.MediaCodec.stop(MediaCodec.java:1908) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.releaseCodec(MediaCodecRenderer.java:512) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.releaseCodec(MediaCodecVideoRenderer.java:439) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:468) at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onDisabled(MediaCodecVideoRenderer.java:341) at com.google.android.exoplayer2.BaseRenderer.disable(BaseRenderer.java:150) at com.google.android.exoplayer2.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:972) at com.google.android.exoplayer2.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:772) at com.google.android.exoplayer2.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:735) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:347) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61)
@vinoth56060 Please file a separate, new issue and include all the information requested in the issue template, especially a full bug report. I'll mark this as off-topic as it doesn't seem directly related to this issue.