-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
in-band key rotation not working with Xbox One #4401
Comments
Chrome on Mac uses Widevine rather than PlayReady. On Samsung TV, which DRM are you using? Looking through your log file, I see license requests sent at these times:
And the error at this time:
The requests that are 6 seconds apart are for two different sessions, and both are of type What is the key rotation period? What is the structure of the keys and tracks? (For example, one set of keys for video, one for audio, or one set for SD video, one for HD, one for UHD, etc.) Thanks! |
We use playready on Samsung TVs Keys rotation occurs every 10 minutes, starting on the hour, then at 10 past etc... Still trying to get a definitive answer on use of track specific keys |
I'm not sure why we are getting two license requests, at startup. It looks like the same KID is used in all init and media segments fetched prior to the second key request In the init segments default_KID in moov.trak.mdia.minf.stbl.stsd.encv.sinf.schi.tenc is eb36782fac245385b789bce12011a9e2 In the media segments KID in moof.traf.sgpd is the same value eb36782fac245385b789bce12011a9e2 |
Based on the timing of the error, the key rotation period, and the fact that the license requests were grouped early in the session, I would guess that we're not fetching the next key for the next key rotation period. This should be done through So either we're not listening to the event, or it didn't happen. I see that your config has If that doesn't work, please check that in your content, either:
Does this help? |
The manifest does not contain PSSH I think this approach is used -
Note that this stream does work as expected on 2017 Samsung TV and Chrome on Mac OS I have attached a Charles Proxy capture containing the manifest and media segments in the vicinity of the key change at segment number 830119800 |
My guess is that the Xbox is not emitting the encrypted event in this situation. Is it feasible to detect the key change by parsing the PSSH in the media segments in shaka player? |
Yes, it's entirely possible that Xbox is not generating encrypted events. EME on Xbox seems pretty broken. We could "polyfill" that by parsing for PSSH ourselves. We already have the parser. I would be more than willing to review a PR to add something like that. I haven't thought through where that would best be added, but segment data doesn't pass through DrmEngine today. So it would need to touch DrmEngine as well as either StreamingEngine or MediaSourceEngine. I think it could be made generic, with a config to decide whether to use browser encrypted events or local parsing. That config could be made to default to true for Xbox. |
@caridley, would you be willing to work on a PR for this? |
Yes.. I should be able to start on this next week. |
Thanks! |
In-band key rotation, in which new keys are signaled by a change in the pssh in the media segments, is not working on the Xbox one, but is working for other browsers and devices. It appear that the Xbox does not continue watching for pssh changes after the initial DRM session has been setup. The problem is fixed by parsing the pssh from media segments prior to appending to the source buffer. This behavior is controlled with the new boolean config field drm.parseInbandPsshEnabled. Fixes #4401
In-band key rotation, in which new keys are signaled by a change in the pssh in the media segments, is not working on the Xbox one, but is working for other browsers and devices. It appear that the Xbox does not continue watching for pssh changes after the initial DRM session has been setup. The problem is fixed by parsing the pssh from media segments prior to appending to the source buffer. This behavior is controlled with the new boolean config field drm.parseInbandPsshEnabled. Fixes #4401
In-band key rotation, in which new keys are signaled by a change in the pssh in the media segments, is not working on the Xbox one, but is working for other browsers and devices. It appear that the Xbox does not continue watching for pssh changes after the initial DRM session has been setup. The problem is fixed by parsing the pssh from media segments prior to appending to the source buffer. This behavior is controlled with the new boolean config field drm.parseInbandPsshEnabled. Fixes #4401
🤖 I have created a release *beep* *boop* --- ## [4.1.5](v4.1.4...v4.1.5) (2022-10-07) ### Bug Fixes * allow build without text ([#4506](#4506)) ([1db6265](1db6265)) * allow the playback on platforms when low latency APIs are not supported ([#4485](#4485)) ([55d1390](55d1390)) * check for negative rows before moving ([#4510](#4510)) ([31abae3](31abae3)), closes [#4508](#4508) * Filter unsupported H.264 streams in Xbox ([#4493](#4493)) ([1ecede6](1ecede6)) * Fix choppy HLS startup ([#4553](#4553)) ([1675bff](1675bff)), closes [#4516](#4516) * Fix errors with TS segments on Chromecast ([#4543](#4543)) ([15a1c60](15a1c60)) * Fix hang when seeking to the last segment ([#4537](#4537)) ([72a119d](72a119d)) * Fix HLS dynamic to static transition ([932d37c](932d37c)) * Fix HLS dynamic to static transition ([#4483](#4483)) ([932d37c](932d37c)), closes [#4431](#4431) * Fix in-band key rotation on Xbox One ([#4478](#4478)) ([5a8f09c](5a8f09c)), closes [#4401](#4401) * Respect existing app usage of Cast SDK ([#4523](#4523)) ([9c3a494](9c3a494)), closes [#4521](#4521) * **ttml:** Default TTML background color to transparent if unspecified ([#4496](#4496)) ([16da1e7](16da1e7)), closes [#4468](#4468) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [4.2.2](v4.2.1...v4.2.2) (2022-10-07) ### Bug Fixes * allow build without text ([#4506](#4506)) ([7e93720](7e93720)) * allow the playback on platforms when low latency APIs are not supported ([#4485](#4485)) ([cf8c857](cf8c857)) * check for negative rows before moving ([#4510](#4510)) ([23f39d7](23f39d7)), closes [#4508](#4508) * Filter unsupported H.264 streams in Xbox ([#4493](#4493)) ([914a08a](914a08a)) * Fix choppy HLS startup ([#4553](#4553)) ([950ce69](950ce69)), closes [#4516](#4516) * Fix errors with TS segments on Chromecast ([#4543](#4543)) ([8204db6](8204db6)) * Fix hang when seeking to the last segment ([#4537](#4537)) ([3d6c768](3d6c768)) * Fix HLS dynamic to static transition ([d9ecbf3](d9ecbf3)) * Fix HLS dynamic to static transition ([#4483](#4483)) ([d9ecbf3](d9ecbf3)), closes [#4431](#4431) * Fix in-band key rotation on Xbox One ([#4478](#4478)) ([bc0a588](bc0a588)), closes [#4401](#4401) * Missing AES-128 key of last HLS segment ([#4519](#4519)) ([2c2677f](2c2677f)), closes [#4517](#4517) * Respect existing app usage of Cast SDK ([#4523](#4523)) ([3db2568](3db2568)), closes [#4521](#4521) * **ttml:** Default TTML background color to transparent if unspecified ([#4496](#4496)) ([0b5c985](0b5c985)), closes [#4468](#4468) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Have you read the FAQ and checked for duplicate open issues?
Yes
What version of Shaka Player are you using?
3.1.2 with customizations
Can you reproduce the issue with our latest release version?
Yes with 4.1.2
Can you reproduce the issue with the latest code from
main
?Yes tested with main branch commit 25fd4f4 from 8/9/2022
Are you using the demo app or your own custom app?
Custom app
If custom app, can you reproduce the issue using our demo app?
I have not been able to get the demo app to run on the Xbox
What browser and OS are you using?
Xbox One
For embedded devices (smart TVs, etc.), what model and firmware version are you using?
Xbox One S - OS version 10.0.22000.4976
What are the manifest and license server URIs?
Will send via e-mail
What configuration are you using? What is the output of
player.getConfiguration()
?see attached file configuration.txt
What did you do?
Playing stream with in-band key rotation signaled with a new KID in the moof/traf/sgpd box
Keys change every 10 minutes
What did you expect to happen?
Playback should continue through key changes uninterrupted, and we should see DRM license requests.
What actually happened?
When the key changes playback fails with an error like this
Shaka Error MEDIA.VIDEO_ERROR (5,8004b82b,)","code":3016,"category":3,"data":[5,"8004b82b",null]
The same stream works as expected with 2017 Samsung TV and Chrome on Mac
Debug log
RemconAvc_20220811_1130.log
Charles proxy capture of manifest, media-segment and license requests at stream start and point of failure
AvcInBandKeyRotation_20220811_1130_pruned.chls.zip
key change occurred on segment number 830119800
segment SpecNews_AVC-audio_105285_spa104800-830119799.m4s
has KID is eb36782fac245385b789bce12011a9e2
segment SpecNews_AVC-audio_105285_spa104800-830119800.m4s
has KID is 6624cf9f8a15598e91435cad17613e70
The text was updated successfully, but these errors were encountered: