Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to handle key response: DRM vendor-defined error: -2902 #2648

Closed
stellabei opened this issue Apr 4, 2017 · 15 comments
Closed

Failed to handle key response: DRM vendor-defined error: -2902 #2648

stellabei opened this issue Apr 4, 2017 · 15 comments

Comments

@stellabei
Copy link
Contributor

stellabei commented Apr 4, 2017

Issue description

This issue started to happen when user upgraded their Android OS from M (6.0.1) to N (7.0). Either their download or steaming video does not play anymore due to this DRM problem.
We'd like to know what this error code means at least. Thank you!

Reproduction steps

It is hard to reproduce since it involves a system upgrade

Link to test content

email the link to
dev.exoplayer@gmail.com including the issue number in the subject line.

Version of ExoPlayer being used

r1.5.1

Device(s) and version(s) of Android being used

version of Motorola Droid Turbo 2 before upgrade:
6.0.1
after upgrade:
7.0

A full bug report captured from the device

android.media.MediaDrm$MediaDrmStateException: Failed to handle key response: DRM vendor-defined error: -2902

@wvpaf
Copy link

wvpaf commented Apr 18, 2017

@stellabei can you please provide a full adb bugreport?

@amasalkov
Copy link

Attached file includes relevant part of adb output.
widevine-err_2902.txt

@wvpaf
Copy link

wvpaf commented Apr 25, 2017

@stellabei can you please provide a full adb bugreport? The snippets shows the error but does not include some entries that we would expect to see in a full unfiltered bug report.
thanks,

@stellabei
Copy link
Contributor Author

stellabei commented Apr 25, 2017

@wvpaf Hi, unfortunately we don't have the full adb bugreport. The log that we provided was user logs captured by crashlytics. We can not reproduce this problem since it requires an upgrade.
What we know so far is that uninstalling the app, clearinging data and even rebooting the phone does not fix the problem. The only way to fix the problem so far is to perform a factory reset. So this seems that some internal DRM data (database ex.) was jeopardized during this upgrade process.
One work around would be find a way to "reset DRM" data for this device (please advice what api to call in the case). In the meanwhile, if it is possible to investigate upgrade process in widevine plugin that can possibly get it in this "non-recoverable" state. Thanks in advance!

@stellabei
Copy link
Contributor Author

stellabei commented Apr 26, 2017

@wvpaf One more important information. I tried to reproduce this problem by "simulating" a system upgrade using a rooted phone. The simulation is done by flashing a new version without erasing user data, it is the closest that I can get as a system upgrade. I had some downloaded encrypted media before the "upgrade", after that when I try to play them, I got the following error "Failed to restore keys: DRM vendor-defined error: -2887". Although the error code differs from the user reported one, I believe the adb full log in this case can be very useful, so I'm attaching it. In this error -2887, the situation is "recoverable" since we can just request a new license when that happens. But in the case of error -2902, it happens even for the streaming media, that leads to a situation that app can not do that much. Hope this full adb log helps.
afterupgrade.txt
Please help us on this issue, it is urgent since our users are complaining a lot about it. Thanks!

@wvpaf
Copy link

wvpaf commented May 9, 2017

@stellabei the 'afterupgrade.txt' log does not provide any clues on the initial issue.

Are you only getting reports of issues on this one device after the upgrade? Do you know if any of these
Motorola Droid Turbo 2 devices that succeed playback after upgrading?

Having a full adb log from a failing device would be best.

@stellabei
Copy link
Contributor Author

stellabei commented May 9, 2017

@wvpaf as I stated before, we do not have the full adb log from a failing device. They are all user devices that we can not have access. We will try to buy one and reproduce and will let you know. But in the meanwhile, can you please help us understand what this error means? -2902. Thanks!
@wvpaf I'm going to take logs before the upgrade, is there any special logs that you need before I do the upgrade? Thanks!

@stellabei
Copy link
Contributor Author

stellabei commented May 22, 2017

@wvpaf I sent and email with this issue number to dev.exoplayer@gmail.com adb logcat. If you need wireshark or bug report please let me know. Thanks! I also attached Kaltura Device Info before and After for comparision. I was also able to reproduce this problem using exoplayer demo app:

05-22 16:03:45.083 540-540/? E/WVCdm: CryptoSession::LoadKeys: OEMCrypto_LoadKeys error=10012
05-22 16:03:45.083 540-540/? E/WVCdm: CdmEngine::AddKey: keys not added, result = 99
05-22 16:03:45.083 28621-9832/com.google.android.exoplayer2.demo E/MediaDrm-JNI: Illegal state exception: Failed to handle key response: DRM vendor-defined error: -2902 (-2902)
05-22 16:03:45.084 28621-9832/com.google.android.exoplayer2.demo E/ExoPlayerImplInternal: Renderer error.
com.google.android.exoplayer2.ExoPlaybackException at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.shouldWaitForKeys(MediaCodecRenderer.java:735) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:676) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:511) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:479) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:308) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)

@jefftinker
Copy link

@stellabei The -2902 error indicates a problem in the device security software. The SoC vendor is in the process of providing an update to Motorola to resolve this issue.

@stellabei
Copy link
Contributor Author

stellabei commented May 23, 2017

@jefftinker Thanks a lot for the response! You made my day :-) If you have any estimate date for this please let me know!

@ram992
Copy link

ram992 commented Jul 27, 2017

Hello,
Can you give some info on how to handle this issue,
like when this error occurs, I want to take the control and give the player a classic widevine url, till Android 6.0, cause some popular devices are throwing this error in android 5.0 and 6.0 platforms.

@ojw28
Copy link
Contributor

ojw28 commented Jul 31, 2017

@ram992 - You should be able to determine when this error occurs in the EventListener.onPlayerError method of an event listener registered to the player. It's unclear exactly what the exception looks like for this case (the log snippet provided above is insufficient to determine this), but it should be possible for you to inspect the exception and determine if playback failed for this reason. You'll then need to implement your own fallback logic. The demo app's PlayerActivity has some logic showing how you might inspect the exception in onPlayerError, albeit for a different case. You'll want to check the exception's type is ExoPlaybackException.TYPE_RENDERER, call getRendererException to get the cause, and then look at that exception and its cause(s) and see if it's possible to determine from those that the failure is this issue.

@ram992
Copy link

ram992 commented Aug 1, 2017

@ojw28 - as you said, the log shared by @stellabei is not enough, I was able to reproduce the same issue with the demoPlayer and with the same content you have provided in the main screen for testing.
In the options if you go to "Widevine DASH policy tests(GTS)" and select any content which says secure videopath required, this exception occurs.
MeanWhile I will try the method you just suggested.
The device you can use is an Le-Max Le X507 with Android 6.0

@ojw28
Copy link
Contributor

ojw28 commented Aug 6, 2017

Closing because this is not an ExoPlayer issue. From @jefftinker's response above the SoC vendor is providing Motorola with a fix.

@ojw28 ojw28 closed this as completed Aug 6, 2017
@ojw28
Copy link
Contributor

ojw28 commented Aug 6, 2017

@ram992 - Please file the Le-Max issue as a separate issue, with a full bug report and detailed information included as requested in the issue template.

@google google locked and limited conversation to collaborators Dec 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants