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

[Android][Chrome][Widevine][Dash] Error 6002 FAILED_TO_CREATE_CDM #7760

Closed
CHaNGeTe opened this issue Dec 13, 2024 · 7 comments · Fixed by #7808
Closed

[Android][Chrome][Widevine][Dash] Error 6002 FAILED_TO_CREATE_CDM #7760

CHaNGeTe opened this issue Dec 13, 2024 · 7 comments · Fixed by #7808
Assignees
Labels
component: Widevine The issue involves the Widevine DRM platform: Android Issues affecting Android priority: P1 Big impact or workaround impractical; resolve before feature release type: bug Something isn't working correctly
Milestone

Comments

@CHaNGeTe
Copy link
Contributor

Have you read the FAQ and checked for duplicate open issues? Yes

If the problem is related to FairPlay, have you read the tutorial? N/A

What version of Shaka Player are you using? 4.12.4 / 4.12.5

Can you reproduce the issue with our latest release version? Yes

Can you reproduce the issue with the latest code from main? Yes

Are you using the demo app or your own custom app? Both

If custom app, can you reproduce the issue using our demo app? No

What browser and OS are you using?
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Android Chrome 131.0.6778.105 on Android 14

For embedded devices (smart TVs, etc.), what model and firmware version are you using? N/A

What are the manifest and license server URIs? Email

What configuration are you using? What is the output of player.getNonDefaultConfiguration()?

{
  "drm": {
    "servers": {
      "com.widevine.alpha": "SENT ON EMAIL"
    }
  },
  "manifest": {
    "hls": {
      "ignoreTextStreamFailures": true
    }
  },
  "streaming": {
    "ignoreTextStreamFailures": true,
    "alwaysStreamText": true
  }
}

What did you do?
Play Widevine Dash asset on Android Chrome

What did you expect to happen?
To always play

What actually happened?

Sometimes it works.
But sometimes (most of times) I receive 6002 FAILED_TO_CREATE_CDM / Unable to create MediaCrypto session

I have the feeling the queryMediaKeys promises are not correctly resolving.

Are you planning send a PR to fix it?
I tried debugging it, but not for now

@CHaNGeTe CHaNGeTe added the type: bug Something isn't working correctly label Dec 13, 2024
@CHaNGeTe
Copy link
Contributor Author

For some reason the asset works fine on Mac Chrome but I am having issues on Android Chrome

@shaka-bot shaka-bot added this to the v4.13 milestone Dec 13, 2024
@CHaNGeTe
Copy link
Contributor Author

CHaNGeTe commented Dec 13, 2024

I noticed this:
Reattempting the mediaKeySystemAccess.createMediaKeys() call after some time can lead to success getting the mediaKeys.

The rate of successful playback attempts has increased a lot by the reattempt

@CHaNGeTe
Copy link
Contributor Author

@CHaNGeTe
Copy link
Contributor Author

I have increased the % but it is still not bulletproof:

Attempt 1 to create MediaKeys
shaka-player.compiled.debug.js:144 Failed to create MediaKeys on attempt 1 null MediaKeySystemAccess {keySystem: 'com.widevine.alpha'} NotSupportedError: Unable to create MediaCrypto session.
shaka-player.compiled.debug.js:144 Attempt 2 to create MediaKeys
shaka-player.compiled.debug.js:144 Failed to create MediaKeys on attempt 2 null MediaKeySystemAccess {keySystem: 'com.widevine.alpha'} NotSupportedError: Unable to create MediaCrypto session.
shaka-player.compiled.debug.js:144 All attempts to create MediaKeys failed
shaka-player.compiled.debug.js:144 Attempt 1 to create MediaKeys
shaka-player.compiled.debug.js:144 Failed to create MediaKeys on attempt 1 null MediaKeySystemAccess {keySystem: 'com.widevine.alpha'} NotSupportedError: Unable to create MediaCrypto session.
shaka-player.compiled.debug.js:144 Attempt 2 to create MediaKeys
shaka-player.compiled.debug.js:144 Failed to create MediaKeys on attempt 2 null MediaKeySystemAccess {keySystem: 'com.widevine.alpha'} NotSupportedError: Unable to create MediaCrypto session.
shaka-player.compiled.debug.js:144 All attempts to create MediaKeys failed
shaka-player.compiled.debug.js:144 Attempt 1 to create MediaKeys
shaka-player.compiled.debug.js:144 Succeeded to create MediaKeys on attempt 1 null

Seems Widevine CDM is not fully ready when it happens, but at least I am not aware of any method to check its readyness

@CHaNGeTe
Copy link
Contributor Author

BTW seems Widevine CDM readyness is very tied to the specified robutsness
SW_* robustness makes createMediakeys work on first attempt for now on 100% of my tries:

advanced: {
      'com.widevine.alpha': {
          'videoRobustness': 'SW_SECURE_DECODE',
          'audioRobustness': 'SW_SECURE_CRYPTO'
      }
  },

The issues is noticeable when no robustness is specified on Android Chrome

@CHaNGeTe
Copy link
Contributor Author

Well seems it is more SW/HW vs '' (empty) robustness
So seems at least on Android Chrome has come the day this is actually true:
image

@avelad avelad added platform: Android Issues affecting Android component: Widevine The issue involves the Widevine DRM labels Dec 23, 2024
@avelad avelad self-assigned this Dec 26, 2024
@avelad avelad added the priority: P1 Big impact or workaround impractical; resolve before feature release label Dec 26, 2024
@avelad avelad closed this as completed in a018f53 Dec 27, 2024
@CHaNGeTe
Copy link
Contributor Author

Thanks @avelad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Widevine The issue involves the Widevine DRM platform: Android Issues affecting Android priority: P1 Big impact or workaround impractical; resolve before feature release type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants