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

DRM with key rotation: Black flicker observed when keys rotate #3561

Closed
ojw28 opened this issue Dec 7, 2017 · 35 comments
Closed

DRM with key rotation: Black flicker observed when keys rotate #3561

ojw28 opened this issue Dec 7, 2017 · 35 comments
Assignees
Labels

Comments

@ojw28
Copy link
Contributor

ojw28 commented Dec 7, 2017

Spun out from #1298. When playing a stream with key rotation, the display flickers black at the points when keys rotate. Every three minutes in this sample:

{
  "name": "Sintel - 3 minutes key rotation",
  "uri": "https://storage.googleapis.com/playerinfra/wv/sintel_3min_rotate.mpd",
  "drm_scheme": "widevine",
  "drm_multi_session": true,
  "drm_license_url": "https://widevine-proxy.appspot.com/proxy"
}

This is because the secure video decoder is (incorrectly) released and re-instantiated.

There also appears to be an audio underrun on some devices, although this may be more of a performance problem with some devices as opposed to an ExoPlayer issue.

@ojw28 ojw28 added the bug label Dec 7, 2017
@ojw28 ojw28 self-assigned this Dec 7, 2017
@ojw28 ojw28 changed the title Black flicker when playing DRM protected streams with key rotation DRM with key rotation: Black flicker observed when keys rotate Dec 7, 2017
@ueno-yuhei
Copy link

Thank you for the new issue.
If you have found something here I will send comments and actual code to this issue.

@jboisjo
Copy link

jboisjo commented Jan 11, 2018

any updates for this issue?

@ojw28
Copy link
Contributor Author

ojw28 commented Jan 12, 2018

We will provide an update when there is one (lack of update == there is no update). Thanks.

@kvillnv
Copy link

kvillnv commented Jan 15, 2018

Same issue here, looking forward for an update as well. Thanks

@adelati
Copy link

adelati commented Jan 16, 2018

After reading the document about Key Rotation on Android (https://storage.googleapis.com/wvdocs/Widevine_DRM_Android_Using_Key_Rotation.pdf). to the best of my knowledge, the bug is related to the moment of releasing the initial sessionId1 which lead to tearing down the MediaCodec and creating new one. So, I think somewehere in Exoplayer library, you destruct the initial session.

@linhai326
Copy link

linhai326 commented Mar 14, 2018

Originally, i thought @cizarco was right: obviously, the current implementation closes the primary/first session when opening a new one, which doesn't match the document's design. But even if I don't release any session, this issue still happens. So it seems the cause was somewhere else.

@ojw28
Copy link
Contributor Author

ojw28 commented Mar 14, 2018

@cizarco is right. Just commenting out releasing of sessions isn't sufficient to fix it. More in depth changes are required (e.g. to ensure MediaCodecRenderer doesn't tear down the MediaCodec).

ojw28 added a commit that referenced this issue Jan 21, 2019
@ojw28
Copy link
Contributor Author

ojw28 commented Jan 21, 2019

Fixed in dev-v2 for API level 23 and above. There's still a little pause when key rotation occurs, however.

@ojw28
Copy link
Contributor Author

ojw28 commented Jan 21, 2019

The pause is tracked by #4133, so closing this one.

@ojw28 ojw28 closed this as completed Jan 21, 2019
@rajeshghosh1978

This comment has been minimized.

@ojw28

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@ojw28

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@ojw28

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@ojw28

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@ojw28

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@ojw28

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@AchibanaUkyo

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@AchibanaUkyo

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@AchibanaUkyo

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@AchibanaUkyo

This comment has been minimized.

@rajeshghosh1978

This comment has been minimized.

@AchibanaUkyo

This comment has been minimized.

@ojw28

This comment has been minimized.

@AchibanaUkyo

This comment has been minimized.

@AchibanaUkyo

This comment has been minimized.

@ojw28
Copy link
Contributor Author

ojw28 commented Apr 21, 2019

As per my comment above, this is fixed in dev-v2 for API level 23 and above. The issue is tricky to fix in a general way on earlier API levels, and we will likely not be investing time into doing so.

Note there's still a small pause when key rotation occurs. This is tracked by #4133.


Aside: I've marked the extended discussion that occurred in this issue after it was closed as off topic, so that it's easy to understand for those reading it.

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

No branches or pull requests

8 participants