google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

Android TV api 31 emulator. Widevine not working. #10158

Open Cocherijka opened 2 years ago

Cocherijka commented 2 years ago

ExoPlayer Version

2.17.1

Devices that reproduce the issue

Android studio Android TV emulator API 31.

Devices that do not reproduce the issue

Android studio Android TV emulator API 30.

Reproducible in the demo app?

Yes

Reproduction steps

Try to play any Widevine video or stream.

Expected result

Video is playing

Actual result

ERROR_DRM_UNKNOWN IMG_20220407_020744_308

Media

Any exoplayer demo app drm media

Bug Report

icbaker commented 2 years ago

I can reproduce the same behaviour - thanks for reporting.

I've opened internal b/228424439 to report this to the relevant team.

fredgc commented 1 year ago

It looks like you are trying to cast to an emulator. Cast requires L1 support, and L1 support requires real hardware.

icbaker commented 1 year ago

@fredgc I don't think there's any casting happening here, this is just local playback. It works on the API 30 emulator, but not the API 31 one. See b/228424439#comment3 and comment4 for some more diagnosis details.

tibor-leo-safar-accedo commented 1 year ago

Hi @icbaker - I would be interested in the outcome of this ticket. Apparently when WideVine L3 is forced for a stream where only HDCP is enforced, we get the above mentioned error, having the following cause:

Cannot cast android.hardware.drm@1.0::ICryptoPlugin obj to android.hardware.drm@1.4::ICryptoPlugin plugin

Is there a workaround or solution for this? (Your last comment suggests to be an internal error) This is happening on the DRM system of all the latest Android versions 10 ... 12,13

My suspicion is that once the HDCP is required, this implies as well the presence of the hardware decoded stream, for security reasons, because WV L3 is not considered secure enough.

icbaker commented 1 year ago

@tibor-leo-safar-accedo Is your problem on the emulator? This thread is specifically about a known issue with Widevine on API 31 emulators. If you have a non-emulator Widevine question and you're a Widevine partner you can also get support directly from them: https://www.widevine.com/contact.

In general we focus on issues with ExoPlayer's Widevine integration on this issue tracker, rather than general Widevine questions (since we are not Widevine experts).

tibor-leo-safar-accedo commented 1 year ago

Hi @icbaker - this is on real devices. Now I am not sure if this is a real issue or it is more a DRM configuration issue of the streams? Anyhow, thank you for the response, since my question is physical device related, it will need an another solution.

rrfrias commented 1 year ago

@tibor-leo-safar-accedo that is a policy question and unrelated to this tracker or this forum. If you are a Widevine licensee (or would like to become one) you can reach out for Widevine support at https://www.widevine.com/contact

nilsnilsnils commented 5 months ago

Same here ... had errors for days on the emulator with API 31.. than I used 34 and everything was fine.

rahulnainwalttn commented 4 months ago

Same here.

{"error": {"errorCode": "21000", "errorException": "androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error", "errorStackTrace": "androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:668) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:230) at android.os.Looper.loop(Looper.java:319) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: android.media.MediaCodec$CryptoException: Crypto key not available: ERROR_DRM_NO_LICENSE cdm err: 0, oem err: 0, ctx: 0 ============================== Beginning of DRM Plugin Log ============================== 05-14 22:19:39.788 I found instance=clearkey version=android.hardware.drm@1.3::IDrmFactory 05-14 22:19:39.788 I found instance=widevine version=android.hardware.drm@1.3::IDrmFactory 05-14 22:19:41.361 W Cannot cast android.hardware.drm@1.0::IDrmPlugin obj to android.hardware.drm@1.4::IDrmPlugin plugin 05-14 22:19:42.717 W Cannot cast android.hardware.drm@1.0::ICryptoPlugin obj to android.hardware.drm@1.4::ICryptoPlugin plugin ============================== End of DRM Plugin Log ============================== at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method) at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:3105) at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecBufferEnqueuer.doQueueSecureInputBuffer(AsynchronousMediaCodecBufferEnqueuer.java:240) at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecBufferEnqueuer.doHandleMessage(AsynchronousMediaCodecBufferEnqueuer.java:205) at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecBufferEnqueuer.access$000(AsynchronousMediaCodecBufferEnqueuer.java:47) at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecBufferEnqueuer$1.handleMessage(AsynchronousMediaCodecBufferEnqueuer.java:96) at android.os.Handler.dispatchMessage(Handler.java:106) ... 3 more ", "errorString": "ExoPlaybackException: ERROR_CODE_UNSPECIFIED"}}