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

Cannot cast widevine-encrypted vorbis content #7546

Open
antoniori-eng opened this issue Nov 5, 2024 · 17 comments
Open

Cannot cast widevine-encrypted vorbis content #7546

antoniori-eng opened this issue Nov 5, 2024 · 17 comments
Assignees
Labels
component: Widevine The issue involves the Widevine DRM platform: Cast Issues affecting Cast devices priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Milestone

Comments

@antoniori-eng
Copy link

Have you read the FAQ and checked for duplicate open issues?
Yes. I found no open issues involving Vorbis specifically. The same scenario with different codecs seems to work fine, so I suspect that this may be an issue related to Vorbis+Widevine specifically in the "Shaka Cast Demo Nightly" app (app ID 07AEE832).

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

N/A

What version of Shaka Player are you using?

Shaka Demo Nightly Cast App, app ID 07AEE832

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

Can you reproduce the issue with the latest code from main?
N/A

Are you using the demo app or your own custom app?
Demo cast app

If custom app, can you reproduce the issue using our demo app?
N/A

What browser and OS are you using?
Casting to a "Chromecast with Google TV" device, from a chrome browser on a variant of Debian Linux.

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
This seems to repro on any cast device. I tested on a production "Chromecast with Google TV" device.

What are the manifest and license server URIs?

Manifest URL: https://www.gstatic.com/cast_3p/wv/live/vorbis/vorbis_1100hz.mpd
License URL: https://cwip-shaka-proxy.appspot.com/no_auth

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

N/A (it's the shaka demo cast app running)

What did you do?

  1. Add "Custom Content" at https://shaka-player-demo.appspot.com/ using the license server and manifest listed above.
  2. Play the content, and note that playback in the browser works (the entire file can be played)
  3. Cast the content to a "Chromecast with Google TV"

What did you expect to happen?
Playback should work on the TV with the "Chromecast with Google TV" plugged into it.

What actually happened?

Playback works for a few seconds, then stops (once it reaches the encrypted content).
From debugging on a different cast device, it looks like the CDM is not being initialized. In the chromecast code, a CDM is never constructed.
In the JS logs, I see
Failed to load resource: the server responded with a status of 500 () cwip-shaka-proxy.appspot.com/no_auth:1

Are you planning send a PR to fix it?
No

@antoniori-eng antoniori-eng added the type: bug Something isn't working correctly label Nov 5, 2024
@shaka-bot shaka-bot added this to the v4.12 milestone Nov 5, 2024
@joeyparrish
Copy link
Member

Failed to load resource: the server responded with a status of 500 () cwip-shaka-proxy.appspot.com/no_auth:1

From this detail, it sounds like you had a license server failure.

Does it work with https://proxy.uat.widevine.com/proxy as the license server?

@antoniori-eng
Copy link
Author

I see the same results with https://proxy.uat.widevine.com/proxy: playback works fine on the shaka demo website, but not on the cast device.

Sorry, I should have included this info in the original bug report, but the webpage shows "Shaka Error 6007". But again, only when casting (playing the content on the shaka demo site works fine).

@avelad avelad added platform: Cast Issues affecting Cast devices component: Widevine The issue involves the Widevine DRM labels Nov 6, 2024
@joeyparrish
Copy link
Member

The license request failed. This could be a timeout, a network failure, or a rejection by the server. error.data[0] is a shaka.util.Error from the networking engine.

Do you have the error.data so we can see what the underlying network error was?

@joeyparrish
Copy link
Member

Specifically the error data from proxy.uat.widevine.com/proxy, since we already saw an HTTP 500 error from the other license server.

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Nov 12, 2024
@avelad avelad modified the milestones: v4.12, v4.13 Nov 13, 2024
@antoniori-eng
Copy link
Author

How can I access error.data? Isn't that from shaka code? I'm just casting.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Nov 15, 2024
@joeyparrish
Copy link
Member

If you can't access the Shaka error object directly in your cast receiver, can you send us the logs?

In the first version, you said:

In the JS logs, I see
Failed to load resource: the server responded with a status of 500 () cwip-shaka-proxy.appspot.com/no_auth:1

These logs for the UAT proxy would be helpful. In fact, full logs would be ideal if you have them. Thanks!

@antoniori-eng
Copy link
Author

There's not much in the logs, but here's a screenshot when casting and using the UAT proxy.
Screenshot from 2024-11-14 16-27-35

@joeyparrish
Copy link
Member

Okay, so HTTP 400 is the status from the UAT proxy.

Widevine's UAT proxy is rejecting the request for a license for this content, but it's not clear why. If you can capture the actual request from the dev console's network tab, and send a base64-encoded or hex-encoded version of it here, I should be able to decode it and use Widevine's partner tools to parse it. Understanding what's in the request should help.

If you can do the same for the license request from the browser, we can parse both and compare.

Finally, we can start a support request with Widevine armed with this information. Probably there is some older request format used by Cast devices, which Widevine's servers have stopped supporting. If we have details and can be specific, they may consider restoring compatibility with these older Widevine CDMs.

@antoniori-eng
Copy link
Author

By the time I open the debugger, the license requests have already completed. If I try to cast the content again (or if I try to cast different content first and then cast the vorbis content), I get "Cannot read properties of undefined (reading 'length')" on the shaka demo website and nothing plays.

Are you able to repro the issue? It's happened on every cast device I've tried.
Screenshot from 2024-11-15 09-59-20

@avelad
Copy link
Member

avelad commented Nov 19, 2024

@antoniori-eng what demo url are you using?

@antoniori-eng
Copy link
Author

I'm just casting from https://shaka-player-demo.appspot.com/ with the custom content mentioned in the first comment:
Manifest URL: https://www.gstatic.com/cast_3p/wv/live/vorbis/vorbis_1100hz.mpd
License URL: https://cwip-shaka-proxy.appspot.com/no_auth (https://proxy.uat.widevine.com/proxy also fails)

Playback works in the browser, but fails when casting. Other codecs work fine when casting.

@joeyparrish
Copy link
Member

What devices have you tried?

@joeyparrish
Copy link
Member

I just reproduced the failure on an Android-based Chromecast, which is relatively recent. 😭

@antoniori-eng
Copy link
Author

Interestingly, I did see it work on one cast device I tried just now: a Nest Hub Gen 2 (running Fuchsia).

It fails on every other device I've tried, though: "Chromecast with Google TV," a third-party LG TV, and a third-party Vizio TV. I have access to cast's logs on the LG TV, and I don't see a CDM being constructed.

@joeyparrish
Copy link
Member

I managed to capture a request from a failing device. The request payload that fails seems to be JSON, not a Widevine license request.

{"kids":["IptDXMeUUEa-tPG-2RrfTg","iQZpI_CbUW-s8oVeKGq56Q","RBqKMeheXred76X9uSZ3kQ","I_2iX_r5UXe0YJvVmvEbbA","H4vznOorWcWcLoRuKPL07g"],"type":"temporary"}

To do this, I had to work around a UI bug (the Cannot read properties of undefined you mentioned). I'll put up a fix for it later.

@joeyparrish
Copy link
Member

I think the player is selecting ClearKey, then sending a ClearKey request to a Widevine server. I'm not sure why this only happens while casting.

@joeyparrish
Copy link
Member

The cast receiver attached to the demo is based on the nightly build. The nightly build plays this content just fine in the browser.

Casting with the nightly build results in error 6012, no license server given.

(Found a demo UI bug: if you specify an explicit key system ID in the asset config, it doesn't get saved.)

The demo's "custom asset" feature has some limitations. You can only configure one license server URI. So if the player fails to negotiate for a Widevine CDM on the cast device, it will fall back to clear key, but that single server URI means it will then send a clearkey license request to the Widevine server, which results in HTTP 400.

This weirdness is a limitation of the demo asset configuration AFAICT.

If I cast a version where I have stripped out the ClearKey parts of the MPD (https://storage.googleapis.com/shaka-demo-assets/_7546/wv-only.mpd), then I see error 6001, REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE.

For some reason, the cast device rejects the Player's request for a Widevine CDM.

@joeyparrish joeyparrish self-assigned this Nov 19, 2024
@joeyparrish joeyparrish added the priority: P2 Smaller impact or easy workaround label Nov 19, 2024
joeyparrish added a commit to joeyparrish/shaka-player that referenced this issue Nov 19, 2024
If the remote player does not have getChapters(), the proxied call returns undefined.  This led to exceptions when .length was accessed.

Reported as part of issue shaka-project#7546
joeyparrish added a commit that referenced this issue Nov 19, 2024
)

If the remote player does not have getChapters(), the proxied call returns undefined.  This led to exceptions when .length was accessed.

Reported as part of issue #7546
joeyparrish added a commit that referenced this issue Nov 19, 2024
)

If the remote player does not have getChapters(), the proxied call returns undefined.  This led to exceptions when .length was accessed.

Reported as part of issue #7546
joeyparrish added a commit that referenced this issue Nov 19, 2024
)

If the remote player does not have getChapters(), the proxied call returns undefined.  This led to exceptions when .length was accessed.

Reported as part of issue #7546
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: Cast Issues affecting Cast devices priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

4 participants