ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Nexus 5X with Android 8.1.0 can not play any Widevine DRM video

Open oleksandr-yefremov opened this issue 8 years ago • 17 comments

Issue description

Nexus 5X with Android 8.1.0 (OPM3.171019.016) can not play any Widevine DRM video.

Reproduction steps

Open ExoPlayer demo app. Following test cases fail with the same error:

  • Widevine DASH Policy Tests (GTS)
    • All
  • Widevine HDCP Capabilities Tests
    • All
  • Widevine DASH: MP4, H264, WebM, VP9, MP4, H265
    • All secure

Error:

03-22 11:43:25.087 media   569 32490 I WVCdm   : CdmEngine::AddKey
03-22 11:43:25.152 media   569 32490 E WVCdm   : CryptoSession::LoadKeys: OEMCrypto_LoadKeys error=10036
03-22 11:43:25.152 media   569 32490 E WVCdm   : CdmEngine::AddKey: keys not added, result = 99
03-22 11:43:25.152 media   569 32490 W [email protected]: Unable to convert legacy status: -2902, defaulting to UNKNOWN
03-22 11:43:25.152 10112 17627 17793 E MediaDrm-JNI: Illegal state exception: Failed to handle key response: General DRM error (-2000)
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: Playback error.
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: com.google.android.exoplayer2.ExoPlaybackException
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: 	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.shouldWaitForKeys(MediaCodecRenderer.java:836)
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: 	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:733)
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: 	at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:568)
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: 	at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:522)
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: 	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:305)
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: 	at android.os.Handler.dispatchMessage(Handler.java:102)
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: 	at android.os.Looper.loop(Looper.java:164)
03-22 11:43:25.158 10112 17627 17793 E ExoPlayerImplInternal: 	at android.os.HandlerThread.run(HandlerThread.java:65)

Link to test content

Use ExoPlayer demo as mentioned in Reproduction steps.

Version of ExoPlayer being used

v2.7.0

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

Nexus 5X Android 8.1.0 (OPM3.171019.016).

Tested also with Pixel 2XL Android 8.1.0 (OPM1.171019.021): Widevine VoD from demo app run fine, but livestreams are black screen (https://github.com/google/ExoPlayer/issues/3596). No other device/version seems to be affected (both VoD and livestreams work fine on Pixel 1 Android 8.1.0, Samsung S7 Android 7.0, Nexus 5 Android 6.0.1).

A full bug report captured from the device

Attached bugreport-bullhead-OPM3.171019.016-2018-03-22-11-44-29.zip bugreport-bullhead-OPM3.171019.016-2018-03-22-11-44-29.zip

Other information

Seems to be the same issue as https://github.com/google/ExoPlayer/issues/1404 (at least OEMCrypto_LoadKeys error=10036 is mentioned in https://github.com/google/ExoPlayer/issues/1404#issuecomment-221419893). Together with https://github.com/google/ExoPlayer/issues/3596 these are 2 biggest issues we have in production now. Google phone users basically can not watch DRM videos.

We have the device in question, it's 100% reproducible on a clean device (just delivered from store) and I can extract more information if needed (rooting should also be possible).

oleksandr-yefremov avatar Mar 23 '18 10:03 oleksandr-yefremov

@wvpaf, any idea why this could be happening?

AquilesCanta avatar Mar 23 '18 13:03 AquilesCanta

No idea. No repro internally on standing tests or on manual tests as of yet. Quick review of the log; looks like an OMX decoder error then the device cannot handle any more sessions with a key error. Will keep digging.

wvpaf avatar Mar 23 '18 18:03 wvpaf

I have the same issue on my Nexus 5X when trying to play Amazon Prime videos. This shows the same message in logcat (error on LoadKeys, then fails with -2902). First thought it would have something to do with my Nexus being repaired by LG (boot loop issue -> think they replaced the motherboard), but according to oleksandr-yefremov it also occurs on a brand new device. Unfortunately I did not use Amazon Prime before the boot loop issue, so I can not confirm it was really caused by the repair.

03-24 09:50:26.107 572-4838/? I/WVCdm: CdmEngine::AddKey
03-24 09:50:26.190 572-4838/? E/WVCdm: CryptoSession::LoadKeys: OEMCrypto_LoadKeys error=10036
03-24 09:50:26.190 572-4838/? E/WVCdm: CdmEngine::AddKey: keys not added, result = 99
03-24 09:50:26.190 572-4838/? W/[email protected]: Unable to convert legacy status: -2902, defaulting to UNKNOWN
03-24 09:50:26.190 14329-15526/? E/MediaDrm-JNI: Illegal state exception: Failed to handle key response: General DRM error (-2000)
03-24 09:50:26.191 14329-15526/? W/AmazonVideo: Warning: We think the MediaServer might have died because MediaDrm threw ISE android.media.MediaDrm$MediaDrmStateException: Failed to handle key response: General DRM error, unloading MediaDrm.

Peter59403 avatar Mar 26 '18 07:03 Peter59403

Hi This can happpen after OS upgrade You can install DRM info app like Kaltura Device info from store to see the drm status on device

What I think will fix that issue is factory rest

giladna avatar Mar 30 '18 05:03 giladna

@giladna Thank you for your answer. I will look for a factory reset, but it is quite a lot work because I have to reconfigure most apps on my device.

Meanwhile, this is the output from Kaltura Device Info:

{
    "meta": {
        "versionName": "1.2.0",
        "versionCode": 14,
        "timestamp": "2018-03-31T11:46:10Z"
    },
    "system": {
        "RELEASE": "8.1.0",
        "SDK_INT": 27,
        "BRAND": "google",
        "MODEL": "Nexus 5X",
        "MANUFACTURER": "LGE",
        "TAGS": "release-keys",
        "FINGERPRINT": "google/bullhead/bullhead:8.1.0/OPM3.171019.016/4565142:user/release-keys",
        "ARCH": {
            "os.arch": "aarch64",
            "SUPPORTED_ABIS": [
                "arm64-v8a",
                "armeabi-v7a",
                "armeabi"
            ],
            "SUPPORTED_32_BIT_ABIS": [
                "armeabi-v7a",
                "armeabi"
            ],
            "SUPPORTED_64_BIT_ABIS": [
                "arm64-v8a"
            ]
        }
    },
    "drm": {
        "modular": {
            "widevine": {
                "properties": {
                    "vendor": "Google",
                    "version": "v5.1.0-android",
                    "description": "Widevine CDM",
                    "algorithms": "AES/CBC/NoPadding,HmacSHA256",
                    "securityLevel": "L1",
                    "systemId": "6346",
                    "privacyMode": "disable",
                    "sessionSharing": "disable",
                    "usageReportingSupport": "True",
                    "appId": "",
                    "origin": "",
                    "hdcpLevel": "Disconnected",
                    "maxHdcpLevel": "HDCP-2.2",
                    "maxNumberOfSessions": "50",
                    "numberOfOpenSessions": "0",
                    "deviceUniqueId": "<removed>",
                    "provisioningUniqueId": "<removed>",
                    "serviceCertificate": ""
                },
                "events": []
            }
        },
        "classic": {
            "engines": [
                "OMA V1 Forward Lock"
            ]
        }
    },
    "display": {
        "metrics": "DisplayMetrics{density=2.625, width=1080, height=1794, scaledDensity=2.625, xdpi=422.03, ydpi=424.069}"
    },
    "media": {
        "decoders": {
            "OMX.google.aac.decoder": {
                "supportedTypes": [
                    "audio/mp4a-latm"
                ]
            },
            "OMX.google.amrnb.decoder": {
                "supportedTypes": [
                    "audio/3gpp"
                ]
            },
            "OMX.google.amrwb.decoder": {
                "supportedTypes": [
                    "audio/amr-wb"
                ]
            },
            "OMX.google.flac.decoder": {
                "supportedTypes": [
                    "audio/flac"
                ]
            },
            "OMX.google.g711.alaw.decoder": {
                "supportedTypes": [
                    "audio/g711-alaw"
                ]
            },
            "OMX.google.g711.mlaw.decoder": {
                "supportedTypes": [
                    "audio/g711-mlaw"
                ]
            },
            "OMX.google.gsm.decoder": {
                "supportedTypes": [
                    "audio/gsm"
                ]
            },
            "OMX.google.mp3.decoder": {
                "supportedTypes": [
                    "audio/mpeg"
                ]
            },
            "OMX.google.opus.decoder": {
                "supportedTypes": [
                    "audio/opus"
                ]
            },
            "OMX.google.raw.decoder": {
                "supportedTypes": [
                    "audio/raw"
                ]
            },
            "OMX.google.vorbis.decoder": {
                "supportedTypes": [
                    "audio/vorbis"
                ]
            },
            "OMX.qcom.video.decoder.avc": {
                "supportedTypes": [
                    "video/avc"
                ]
            },
            "OMX.qcom.video.decoder.avc.secure": {
                "supportedTypes": [
                    "video/avc"
                ]
            },
            "OMX.google.h264.decoder": {
                "supportedTypes": [
                    "video/avc"
                ]
            },
            "OMX.qcom.video.decoder.h263": {
                "supportedTypes": [
                    "video/3gpp"
                ]
            },
            "OMX.google.h263.decoder": {
                "supportedTypes": [
                    "video/3gpp"
                ]
            },
            "OMX.qcom.video.decoder.hevc": {
                "supportedTypes": [
                    "video/hevc"
                ]
            },
            "OMX.qcom.video.decoder.hevc.secure": {
                "supportedTypes": [
                    "video/hevc"
                ]
            },
            "OMX.google.hevc.decoder": {
                "supportedTypes": [
                    "video/hevc"
                ]
            },
            "OMX.qcom.video.decoder.mpeg4": {
                "supportedTypes": [
                    "video/mp4v-es"
                ]
            },
            "OMX.google.mpeg4.decoder": {
                "supportedTypes": [
                    "video/mp4v-es"
                ]
            },
            "OMX.qcom.video.decoder.vp8": {
                "supportedTypes": [
                    "video/x-vnd.on2.vp8"
                ]
            },
            "OMX.google.vp8.decoder": {
                "supportedTypes": [
                    "video/x-vnd.on2.vp8"
                ]
            },
            "OMX.google.vp9.decoder": {
                "supportedTypes": [
                    "video/x-vnd.on2.vp9"
                ]
            }
        }
    },
    "root": {
        "existingFiles": []
    },
    "safetyNet": {
        "ctsProfileMatch": true,
        "basicIntegrity": true
    }
}

Peter59403 avatar Mar 31 '18 11:03 Peter59403

Have not tested a factory reset yet, but tried the ExoPlayer demo application. Every demo with Widevine Secure fails. Is there anything else I can paste here from the demo application to help?

I also contacted LG last week, their technical department will look into the issue (but no updates yet).

Peter59403 avatar Apr 03 '18 14:04 Peter59403

We tested factory reset and unfortunately there is no difference: installing ExoPlayer demo right after reset gives the same results. Here is the adb bugreport from reset device - bugreport-bullhead-OPM2.171019.029-2018-04-03-16-14-03.zip We also acquired another Nexus 5X with Android 6.0 and there is no issue whatsoever (can this be an indication that the 8.1 OS build is broken?). I will upgrade 6.0 to 8.1 and downgrade 8.1 to 6.X and 7.X to see if it's only 8.1 affected.

oleksandr-yefremov avatar Apr 03 '18 14:04 oleksandr-yefremov

@oleksandr-yefremov Really nice! I wonder what the upgrade and downgrade will result in.

LG has contacted me by phone, and they want me to return my device so they can investigate. I will wait until oleksandr-yefremov has upgraded/downgraded his devices to see if this is an software issue.

Peter59403 avatar Apr 04 '18 11:04 Peter59403

Updates. The second device we bought, which did not have an issue on Android 6.0, does not have it on Android 8.0/8.1 too. The first device (initially affected) was already on Android 8.0 by the time we got it. Downgrading requires unlocking bootloader (as per official guide https://developers.google.com/android/images). Now the interesting part: running fastboot flashing unlock or fastboot oem unlock results in success, but trying then to flash firmware or to run fastboot reboot-bootloader resets the unlock status to locked (which does not happen on the first device, unlocked state is preserved until manual reset). I quickly searched for an issue like that and found this xda thread (not sure how credible it is).

Yes, your eMMC is definitely dead/damaged

If this is the case and NAND is corrupted, can that affect DRM keys as well? I know about Trim Area partition, but I thought it only affects DRM on Sony devices.

oleksandr-yefremov avatar Apr 05 '18 11:04 oleksandr-yefremov

There was an issue discovered on Nexus 5x where the eMMC could become corrupted which caused key loading to fail on those devices. Unfortunately this is not a recoverable situation and the only option as an app developer would be to force running in level 3 using MediaDrm.setsecurityLevel("L3"), this will allow playback but will typically not support HD, depending on the license policy settings.

jt64 avatar Apr 10 '18 22:04 jt64

Thanks for information. In our case relaxing L1 to L3 seems to be not possible from content contracts point of view. Since this is obviously a flaw on manufacturer's side, are those device eligible for replacement/refund after guarantee expired? It seems to be the same as "bootloop" issue which got refunded. From what we have seen, every second device is affected (2 out of 4 we had in testing).

oleksandr-yefremov avatar Apr 11 '18 09:04 oleksandr-yefremov

I finally went for a full factory reset, but as @oleksandr-yefremov mentioned this does not fix the issue. But I found out the cause is indeed the repair of the phone by LG. If the motherboard has been replaced, the bootloader says 'Secure boot (NO RPMB)'. The 'NO RPMB' means the Replay Protected Memory Block does not exists, which is needed to replay DRM content on the Nexus 5X.

I will send my device back to LG to let them investigate this.

@oleksandr-yefremov: Is the NO RPMB message also on your affected devices?

If you Google for NO RPMB and 5X you find that a lot of fixed phones show this behaviour.

Peter59403 avatar Apr 15 '18 18:04 Peter59403

This sounds unfortunate. I'm not sure there's much we can do in this issue tracker though. It sounds like a device problem rather than a problem with ExoPlayer, and there's not going to be anything we can do to work around it. I propose closing this issue unless there's something we can actually do on the ExoPlayer side. If you have any suggestions, please let us know!

ojw28 avatar Apr 18 '18 19:04 ojw28

@ojw28 Is it possible to keep this issue open until LG has confirmed the issue is hardware/repair related (my phone is at their repair center right now)? This issue is/was one of the first search results when searching for a DRM issue on the Nexus 5X.

Peter59403 avatar Apr 19 '18 09:04 Peter59403

@ojw28 I'm not fully familiar with Widevine, is not Android's Drm module having a maximum number of drm sessions? One of my customers was still experiencing an exception that drm had expired and could not resolve it. I informed the customer that the device was broken. (It plays well on the mobile chrome browser.) Can you check if there is a related problem?

workspace avatar Apr 28 '18 19:04 workspace

After two weeks LG returned the device. They replaced the motherboard again, and the issue has been resolved. The 'NO RPMB' message is gone from the bootloader, and DRM content works.

The first time the motherboard was replaced by phone repair company Teleplan, which handles LG warranty. This was just a few weeks within the two year warranty (I had the boot loop issue).

When I contacted LG with this new issue (DRM content not playing), they asked me to send the device to their own headquarters in The Netherlands (where I live), and replaced the motherboard themselves.

I don't think you can do anything yourself to resolve the issue. I tried a factory reset and downgrading to Android 6, which did not work.

Both times LG repaired the phone for free (I only paid shipping), probably because the first (boot loop) issue occurred within the two year warranty.

Peter59403 avatar May 02 '18 10:05 Peter59403

This seems to be confirmed as an LG device issue, based on what @Peter59403 says above. I'm going to close this issue, since there's nothing we can do about this in ExoPlayer.

ojw28 avatar May 05 '18 20:05 ojw28