-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DASH] Possibility of playback freezes when switching streams in the middle of StreamingEngine
updates (fetchAndAppend_()
).
#7156
Comments
A regression was reported in video-dev.org Slack, and they narrowed it down to the PR that closed this issue. Playing https://d24rwxnt7vw9qb.cloudfront.net/v1/dash/e6d234965645b411ad572802b6c9d5a10799c9c1/All_Reference_Streams/4577dca5f8a44756875ab5cc913cd1f1/index.mpd with this PR, reportedly:
This was initially observed on Samsung TVs, but then later on LG and even in Chrome. I'm reverting the PR and reopening the issue. |
Another note from the reporter:
|
Thanks for reverting it Joey - I was able to reproduce it as well, and the root cause is due to only calling Since checking the nullability of
IIRC the reason we decided to only call In other words, the initial iteration of the reverted PR would be the corrected version. There is no risk of accidentally closing the active stream's segmentIndex, because we would be closing old streams right before the check to create a new one if needed: shaka-player/lib/media/streaming_engine.js Lines 1172 to 1177 in cdbbe23
I will send out another PR in a bit with better unit tests to check against this behavior. |
…pdates (shaka-project#7217) Resolves the issues reported by shaka-project#7213, which correctly fixes shaka-project#7156. The latest comment shaka-project#7156 (comment) goes further into detail on the problems of the initial PR.
…pdates (#7217) Resolves the issues reported by #7213, which correctly fixes #7156. The latest comment #7156 (comment) goes further into detail on the problems of the initial PR.
…pdates (#7217) Resolves the issues reported by #7213, which correctly fixes #7156. The latest comment #7156 (comment) goes further into detail on the problems of the initial PR.
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?
main
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?
Custom cast receiver app for Paramount+.
If custom app, can you reproduce the issue using our demo app?
No, as constructing test content to reproduce this scenario is difficult outside of the test environment provided directly from Paramount+.
It is a 3 hour DVR window, live, multiperiod, DRM, DAI, DASH stream.
What browser and OS are you using?
Chrome / CastOS (reproducible on all Cast devices).
For embedded devices (smart TVs, etc.), what model and firmware version are you using?
Google Nest Hub Max / Google Chromecast with TV (4K), latest production firmware.
What are the manifest and license server URIs?
N/A (this was reproduced using internal test content generated by Paramount+).
What configuration are you using? What is the output of
player.getConfiguration()
?What did you do?
What did you expect to happen?
What actually happened?
Playback freezes when an ABR switch occurs in the middle of an ongoing
StreamingEngine.fetchAndAppend_()
.To be more specific, when the above happens, the
switchInternal_()
logic (which gets triggered from the ABR switch) closes theSegmentIndex
of the old stream:shaka-player/lib/media/streaming_engine.js
Lines 575 to 581 in 01545f4
In the context of DASH, eventually this leads to the clearing of the
references
array, which holds things like theuris
of each segment:shaka-player/lib/media/segment_index.js
Line 89 in 01545f4
This can be problematic if the old stream's segment index closes before the
fetch()
happens, since everything inreference
no longer exists:shaka-player/lib/media/streaming_engine.js
Lines 1672 to 1673 in 01545f4
As a result, a
PendingRequest
object with no URI will be created downstream:shaka-player/lib/media/streaming_engine.js
Lines 2587 to 2597 in 01545f4
shaka-player/lib/net/networking_engine.js
Lines 326 to 327 in 01545f4
When the presentation time eventually reaches the media start time of the failed segment request, playback stalls.
Here is a snippet of the console logs illustrating the error I see:
Are you planning send a PR to fix it?
Yes. The plan is to defer the closing of a stream's
SegmentIndex
to the nextonUpdate_()
call when an ABR switch happens during a update, similar to how Shaka can defer clearing of the buffer:shaka-player/lib/media/streaming_engine.js
Lines 595 to 603 in 01545f4
I will guard this change with a new config defaulting to turned off, since it's a core
StreamingEngine
change and may not necessarily be a problem on some platforms.The text was updated successfully, but these errors were encountered: