ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

IllegalStateException when trying to play DASH (with Widevine DRM) on Nexus Player

Open DavidMihola opened this issue 11 years ago • 10 comments

I am trying to play a DASH stream with Widevine DRM using ExoPlayer on an ASUS Nexus Player.

  • On all other test devices (phones mostly, a few tablets) the same stream is working fine.
  • On the Nexus Player DASH streams without DRM are working fine, too.
  • But DASH with DRM, consistently gives me the following stacktrace when I try to start playback:
07-09 10:04:51.266    6427-6588/com.mycompany.film E/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] ERROR(0x80001005)
07-09 10:04:51.266    6427-6588/com.mycompany.film E/ACodec﹕ signalError(omxError 0x80001005, internalError -2147483648)
07-09 10:04:51.266    6427-6587/com.mycompany.film E/MediaCodec﹕ Codec reported err 0x80001005, actionCode 0, while in state 6
07-09 10:04:51.267    6427-6605/com.mycompany.film I/SoftAAC2﹕ Reconfiguring decoder: 0->32000 Hz, 0->2 channels
07-09 10:04:51.269    6427-6588/com.mycompany.film E/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] ERROR(0x80001005)
07-09 10:04:51.269    6427-6588/com.mycompany.film E/ACodec﹕ signalError(omxError 0x80001005, internalError -2147483648)
07-09 10:04:51.272    6427-6588/com.mycompany.film E/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] ERROR(0x80001005)
07-09 10:04:51.272    6427-6588/com.mycompany.film E/ACodec﹕ signalError(omxError 0x80001005, internalError -2147483648)
07-09 10:04:51.280    6427-6587/com.mycompany.film E/MediaCodec﹕ Codec reported err 0x80001005, actionCode 0, while in state 0
07-09 10:04:51.280    6427-6587/com.mycompany.film E/MediaCodec﹕ Codec reported err 0x80001005, actionCode 0, while in state 0
07-09 10:04:51.281    6427-6588/com.mycompany.film E/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] ERROR(0x80001005)
07-09 10:04:51.281    6427-6588/com.mycompany.film E/ACodec﹕ signalError(omxError 0x80001005, internalError -2147483648)
07-09 10:04:51.281    6427-6587/com.mycompany.film E/MediaCodec﹕ Codec reported err 0x80001005, actionCode 0, while in state 0
07-09 10:04:51.290    6427-6567/com.mycompany.film E/ExoPlayerImplInternal﹕ Internal runtime error.
    java.lang.IllegalStateException
            at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
            at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:1033)
            at com.google.android.exoplayer.MediaCodecTrackRenderer.drainOutputBuffer(MediaCodecTrackRenderer.java:819)
            at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:502)
            at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:401)
            at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:203)
            at android.os.Handler.dispatchMessage(Handler.java:98)
            at android.os.Looper.loop(Looper.java:135)
            at android.os.HandlerThread.run(HandlerThread.java:61)
            at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
07-09 10:04:51.309    6427-6427/com.mycompany.film E/EXO﹕ onPlayerError
07-09 10:04:51.309    6427-6427/com.mycompany.film W/System.err﹕ com.google.android.exoplayer.ExoPlaybackException: java.lang.IllegalStateException
07-09 10:04:51.309    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf992c368
07-09 10:04:51.309    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171819320 to native window
07-09 10:04:51.311    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf992c268
07-09 10:04:51.311    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171817336 to native window
07-09 10:04:51.313    6427-6427/com.mycompany.film W/System.err﹕ at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:236)
07-09 10:04:51.313    6427-6427/com.mycompany.film W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:98)
07-09 10:04:51.313    6427-6427/com.mycompany.film W/System.err﹕ at android.os.Looper.loop(Looper.java:135)
07-09 10:04:51.313    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf98fdea8
07-09 10:04:51.313    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171815352 to native window
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ at android.os.HandlerThread.run(HandlerThread.java:61)
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ Caused by: java.lang.IllegalStateException
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:1033)
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ at com.google.android.exoplayer.MediaCodecTrackRenderer.drainOutputBuffer(MediaCodecTrackRenderer.java:819)
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:502)
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:401)
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:203)
07-09 10:04:51.314    6427-6427/com.mycompany.film W/System.err﹕ ... 4 more
07-09 10:04:51.315    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf98edd68
07-09 10:04:51.315    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171813416 to native window
07-09 10:04:51.315    6427-6427/com.mycompany.film E/BasePlayerActivity﹕ [ExoDashPlayerActivity.java:onPlayerError:634] onPlayerError: java.lang.IllegalStateException
    last playback state: PlaybackState{currentPosition=4494000, currentlyPlaying=true}
07-09 10:04:51.316    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf98edea0
07-09 10:04:51.316    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171824336 to native window
07-09 10:04:51.320    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf95522e0
07-09 10:04:51.320    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171688208 to native window
07-09 10:04:51.322    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf992c4a8
07-09 10:04:51.322    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171686224 to native window
07-09 10:04:51.324    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf98010b8
07-09 10:04:51.324    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171810544 to native window
07-09 10:04:51.326    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf98d8058
07-09 10:04:51.326    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171721504 to native window
07-09 10:04:51.328    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf98f0440
07-09 10:04:51.328    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171713352 to native window
07-09 10:04:51.330    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf991bcb8
07-09 10:04:51.330    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171718240 to native window
07-09 10:04:51.332    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf98597c0
07-09 10:04:51.332    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171790496 to native window
07-09 10:04:51.334    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf992c450
07-09 10:04:51.334    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171793808 to native window
07-09 10:04:51.335    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf992b5e8
07-09 10:04:51.335    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171797232 to native window
07-09 10:04:51.337    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf979e9c0
07-09 10:04:51.337    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171685152 to native window
07-09 10:04:51.340    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf9928128
07-09 10:04:51.340    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171792856 to native window
07-09 10:04:51.342    6427-6588/com.mycompany.film E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xf98d4bc8
07-09 10:04:51.342    6427-6588/com.mycompany.film W/ACodec﹕ [OMX.Intel.VideoDecoder.AVC.secure] can not return buffer 4171820952 to native window
07-09 10:04:51.344    6427-6588/com.mycompany.film E/ACodec﹕ error pushing blank frames: api_disconnect failed: Invalid argument (22)
07-09 10:04:51.346    6427-6567/com.mycompany.film E/ExoPlayerImplInternal﹕ Stop failed.
    java.lang.IllegalStateException
            at android.media.MediaCodec.native_stop(Native Method)
            at android.media.MediaCodec.stop(MediaCodec.java:628)
            at com.google.android.exoplayer.MediaCodecTrackRenderer.releaseCodec(MediaCodecTrackRenderer.java:436)
            at com.google.android.exoplayer.MediaCodecTrackRenderer.onDisabled(MediaCodecTrackRenderer.java:407)
            at com.google.android.exoplayer.MediaCodecVideoTrackRenderer.onDisabled(MediaCodecVideoTrackRenderer.java:325)
            at com.google.android.exoplayer.TrackRenderer.disable(TrackRenderer.java:214)
            at com.google.android.exoplayer.ExoPlayerImplInternal.stopAndDisable(ExoPlayerImplInternal.java:513)
            at com.google.android.exoplayer.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:501)
            at com.google.android.exoplayer.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:478)
            at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:237)
            at android.os.Handler.dispatchMessage(Handler.java:98)
            at android.os.Looper.loop(Looper.java:135)
            at android.os.HandlerThread.run(HandlerThread.java:61)
            at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)

The Nexus Player is running Android 5.1.1 Build LMY47V.

DavidMihola avatar Jul 09 '15 08:07 DavidMihola

I am seeing the same error on the Nexus Player

indieboyalex avatar Aug 05 '15 12:08 indieboyalex

I also have the same issue:

07-22 15:17:04.727 1875-1875/? I/VideoCapabilities﹕ Unsupported profile 4 for video/mp4v-es 07-22 15:17:04.751 165-535/? I/WVCdm﹕ CdmEngine::QueryStatus 07-22 15:17:04.751 165-535/? D/MDRMOemCrypto﹕ Calling GetDeviceID 07-22 15:17:04.753 165-535/? I/MDRMOemCrypto﹕ extracted deviceID FUGU_AKTJAODF_000201CC, res 0 07-22 15:17:04.753 165-535/? I/MDRMOemCrypto﹕ Calling GetKeyData 07-22 15:17:04.755 165-535/? I/MDRMOemCrypto﹕ extracted keydata 00:00:00:02, len 72, res 0 07-22 15:17:04.755 165-535/? I/MDRMOemCrypto﹕ Calling GetKeyData 07-22 15:17:04.757 165-535/? I/MDRMOemCrypto﹕ extracted keydata 00:00:00:02, len 72, res 0 07-22 15:17:04.759 165-535/? E/WVCdm﹕ WvContentDecryptionModule::Decrypt: unable to find session 07-22 15:17:04.759 165-535/? E/WVCdm﹕ Decrypt error result in session sid5 during unencrypted block: 5 07-22 15:17:04.760 1875-2407/? I/OMXClient﹕ Using client-side OMX mux. 07-22 15:17:04.761 165-534/? E/ISVProfile﹕ static int32_t ISVProfile::getGlobalStatus(): failed to open file /data/user/0/com.intel.vpp/shared_prefs/vpp_settings.xml 07-22 15:17:04.762 165-534/? I/cmodule﹕ module libOMXVideoDecoderAVC.so successfully loaded 07-22 15:17:04.762 165-534/? I/componentbase﹕ OMX.Intel.VideoDecoder.AVC: set working role video_decoder.avc: 07-22 15:17:04.762 165-534/? I/wrs-omxil-core﹕ get handle of component OMX.Intel.VideoDecoder.AVC successfully 07-22 15:17:04.763 165-165/? I/VideoDecoder﹕ Deleting decoder for video/h264 07-22 15:17:04.764 165-165/? I/cmodule﹕ module libOMXVideoDecoderAVC.so successfully unloaded 07-22 15:17:04.764 165-165/? I/wrs-omxil-core﹕ free handle of component OMX.Intel.VideoDecoder.AVC successfully 07-22 15:17:04.766 1875-2411/? I/OMXClient﹕ Using client-side OMX mux. 07-22 15:17:04.767 165-534/? E/ISVProfile﹕ static int32_t ISVProfile::getGlobalStatus(): failed to open file /data/user/0/com.intel.vpp/shared_prefs/vpp_settings.xml 07-22 15:17:04.767 1875-2378/? E/MediaCodecBridge﹕ Failed to queue secure input buffer android.media.MediaCodec$CryptoException: Unknown Error at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method) at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:956) at org.chromium.media.MediaCodecBridge.queueSecureInputBuffer(MediaCodecBridge.java:521)

hahue avatar Aug 11 '15 08:08 hahue

We have now found out that the same error occurs when we try to play the same stream on the Nexus Player in Chromecast mode, i. e. when the Nexus Player acts a Chromecast and the stream is cast from a phone. The stream plays without any problems on a regular Chromecast.

In both cases we see the following message before the actual exception:

08-11 10:08:21.673 3781-3781/com.mycompany.film I/VideoCapabilities﹕ Unsupported profile 4 for video/mp4v-es

So, the problem probably is not within ExoPlayer but has something to do with the DRM stuff on the Nexus Player - but maybe you have any idea who to contact about that?

DavidMihola avatar Aug 11 '15 08:08 DavidMihola

I have a similar problem. I have created an issue here: https://github.com/google/ExoPlayer/issues/883

PetrSklenicka avatar Nov 05 '15 09:11 PetrSklenicka

If you have a contact within Widevine, you should contact them for assistance.

Out of interest, do all of the Widevine protected samples in the demo app work correctly? If so, do you have any idea what the differences might be between those streams and yours?

ojw28 avatar Nov 05 '15 14:11 ojw28

@ojw28 I'll try that tomorrow (European time) and let you know!

DavidMihola avatar Nov 05 '15 17:11 DavidMihola

Do you have any update of this issue? Do you need some other information from me? I tested you demo application on Nexus Player and it works fine. Do you want me to provide you some other technical information about video, Widevine, etc?

PetrSklenicka avatar Dec 10 '15 08:12 PetrSklenicka

@ojw28: And so a "tomorrow" became "three months" later - I am sorry! As expected, however, all the Widevine Streams in the demo app work fine. As to the differences between our streams and yours I have no idea yet...

It may be of interest that the exact same streams work without any problems when played with PlayReady DRM (the manifest and the DRM provider support both, but to keep consistent with the phone and tablet apps we still would like to use Widevine on the Nexus Player).

@PetrSklenicka: Have you tried your streams with PlayReady?

DavidMihola avatar Feb 05 '16 10:02 DavidMihola

@DavidMihola I'm replacement for PetrSklenicka - In our case PlayReady streams in Demo application works just fine. Any other progress on your side?

Woren avatar Apr 04 '16 15:04 Woren

Closing as stale. Please file a new issue containing all of the information requested in the issue template if this is still a problem on a more current Android build for Nexus Player. We have @wvpaf from Widevine helping out on this issue tracker, who will be able to take a look if a new issue is filed. Thanks!

ojw28 avatar Aug 23 '16 20:08 ojw28