While implementing Drm Dash media source following exception occurs. MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.Exynos.avc.dec.secure
Error report is listed below
ExoPlayerImplInternal: Renderer error: index=0, type=video, format=Format(p0va0br256000, null, null, video/avc, avc1.4d4015, 256000, null, [426, 240, 24.0], [-1, -1]), rendererSupport=NO_UNSUPPORTED_DRM
com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.mediacodec.**MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.Exynos.avc.dec.secure**, Format(p0va0br256000, null, null, video/avc, avc1.4d4015, 256000, null, [426, 240, 24.0], [-1, -1])
at com.google.android.exoplayer2.BaseRenderer.createRendererException(BaseRenderer.java:359)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:563)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1254)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:756)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.readToFlagsOnlyBuffer(MediaCodecRenderer.java:814)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:712)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:599)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:329)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.Exynos.avc.dec.secure, Format(p0va0br256000, null, null, video/avc, avc1.4d4015, 256000, null, [426, 240, 24.0], [-1, -1])
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:867)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:561)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1254)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:756)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.readToFlagsOnlyBuffer(MediaCodecRenderer.java:814)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:712)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:599)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:329)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
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:1989)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:931)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:860)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:561)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1254)
at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:756)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.readToFlagsOnlyBuffer(MediaCodecRenderer.java:814)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:712)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:599)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:329)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
2020-09-14 11:51:58.096 20803-20803/com.rockvillegroup.vidly E/MainVideoPlayerFragment: onPlayerError: Error => **Decoder init failed: OMX.Exynos.avc.dec.secure**, Format(p0va0br256000, null, null, video/avc, avc1.4d4015, 256000, null, [426, 240, 24.0], [-1, -1])
2020-09-14 11:51:58.097 20803-20803/com.rockvillegroup.vidly D/MainVideoPlayerFragment: onPlayerStateChanged: STATE_IDLE
I met the same kind of error before when trying to play the hlsv6-widevine DRM title.
com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.Exynos.avc.dec.secure, Format(1, null, null, video/avc, avc1.640028, 1461621, null, [854, 480, -1.0], [-1, -1])
It happened when I first play a DRM title(it can be played normally); Then switch to a non-DRM title but forgot to release the previous exoplayer instance; When switching back to the DRM title after the non-DRM title finish, the error happened.
The error was gone after I release the exoplayer instance in time after each title was played.
From the exoplayer issues related to the MediaCodec error, I see most of the errors are caused by exoplayer instance(resources) didn't be released in time because the media codec resource for the device is limited. Or the player was trying to rend the decoded data to an invalid surface(view). https://github.com/google/ExoPlayer/issues
Hope the answer can help.