androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.69k stars 405 forks source link

ERROR_CODE_DRM_SYSTEM_ERROR 6006 on Exoplayer while playing a drm content #747

Closed raa-ju closed 11 months ago

raa-ju commented 1 year ago

When I try to play a drm content using pallycon widevine android client sdk , Exoplayer throws a error of 6006, ERROR_CODE_DRM_SYSTEM_ERROR. The error detail message is given below -

error ERROR_CODE_DRM_SYSTEM_ERROR ,code 6006, message -> MediaCodecVideoRenderer error, index=0, format=Format(0, null, null, video/avc, avc1.4D401F, 3278353, null, [1280, 720, 29.97], [-1, -1]), format_supported=YES

Is there any configuration issue for android, as the same video is playing on ios and web smoothly ? or Any suggestion that may help.

detail logcat -

2023-10-19 11:22:25.226 12496-12562/com.pallycon.exoplayersample2.simple E/ExoPlayerImplInternal: Playback error
      com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(0, null, null, video/avc, avc1.4D401F, 3278353, null, [1280, 720, 29.97], [-1, -1]), format_supported=YES
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:566)
        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$CryptoException: Unknown Error
        at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
        at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2480)
        at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.queueSecureInputBuffer(SynchronousMediaCodecAdapter.java:149)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1358)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:794)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:989)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:490)
        at android.os.Handler.dispatchMessage(Handler.java:98) 
        at android.os.Looper.loop(Looper.java:154) 
        at android.os.HandlerThread.run(HandlerThread.java:61) 
2023-10-19 11:22:25.625 12496-12496/com.pallycon.exoplayersample2.simple E/drm: error ERROR_CODE_DRM_SYSTEM_ERROR code 6006 message MediaCodecVideoRenderer error, index=0, format=Format(0, null, null, video/avc, avc1.4D401F, 3278353, null, [1280, 720, 29.97], [-1, -1]), format_supported=YES
2023-10-19 11:22:25.913 12496-12608/com.pallycon.exoplayersample2.simple E/libc: Access denied finding property "media.stagefright.codecremote"
2023-10-19 11:22:26.466 12496-12557/com.pallycon.exoplayersample2.simple E/ExoPlayerImplInternal: Playback error
      com.google.android.exoplayer2.ExoPlaybackException: MediaCodecAudioRenderer error, index=1, format=Format(audio:eng_mp4a, eng_mp4a, null, audio/mp4a-latm, mp4a.40.2, 198303, en, [-1, -1, -1.0], [2, 48000]), format_supported=YES
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:566)
        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$CryptoException: Unknown Error
        at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
        at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2480)
        at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.queueSecureInputBuffer(SynchronousMediaCodecAdapter.java:149)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1358)
        at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:794)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:989)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:490)
        at android.os.Handler.dispatchMessage(Handler.java:98) 
        at android.os.Looper.loop(Looper.java:154) 
        at android.os.HandlerThread.run(HandlerThread.java:61)

used sample app to initialize the player

private fun initializePlayer(token: String, url:String) {

    val config = PallyConDrmConfigration(
        "N0BH",
        token
    )
    val content = ContentData(
        url,
        "",
        config
    )

    // initialize PallyconWVM SDK
    WVMAgent = PallyConWvSDK.createPallyConWvSDK(this@MainExoActivity, content)
    WVMAgent!!.setPallyConEventListener(drmListener)
    var mediaSource: MediaSource? = null
    mediaSource = try {
        WVMAgent!!.getMediaSource()
    } catch (e: PallyConException.ContentDataException) {
        e.printStackTrace()
        return
    } catch (e: PallyConException.DetectedDeviceTimeModifiedException) {
        e.printStackTrace()
        return
    }

    // player setting
    val renderer = DefaultRenderersFactory(this).setExtensionRendererMode(EXTENSION_RENDERER_MODE_PREFER)
    player = ExoPlayer.Builder(this)
        .setTrackSelector(trackSelector!!)
        .setRenderersFactory(renderer)
        .setMediaSourceFactory(createMediaSourceFactory())
        .build()

    player!!.setMediaSource(mediaSource!!)
    player!!.addListener(playerEventListener)
    playerView!!.player = player
    player!!.playWhenReady = true
    player!!.prepare()

}
tonihei commented 1 year ago

Could you also share a bugreport? This likely contains additional useful information to know what happened exactly. You can also send it to android-media-github@google.com with "Issue #747" in the subject if needed.

Assigning to @rrfrias for now as it sounds DRM framework / Widevine related.

rrfrias commented 12 months ago

@raa-ju gentle ping to include a bugreport. Follow instructions in the previous comment. The failure occurs before snippet in the first comment.

google-oss-bot commented 11 months ago

Hey @raa-ju. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

raa-ju commented 11 months ago

I found it as device related issue with a audio codec, other device it works fine