-
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
Chromecast player stalling when gap in live manifest #1720
Comments
We've definitely had problems with slow hardware problems with Chromecasts before. See issue #1411, for example. So your assumption about the cause of this seems reasonable, though without being able to reproduce the issue I can't say for certain. Looking at the code, it also seems possible that our current check for stalling inside a buffered range is too aggressive. It assumes that if the media is "playing" but has had a playback rate of 0 for more than a second straight, the video has stalled. Maybe on slow hardware, like on Chromecasts, it simply sometimes takes more than one second to seek sometimes, so we are assuming the stream has stalled prematurely? You can send details on reproduction to shaka-player-issues@google.com. |
To be clear, there are some ideas we could try, but we will need to be able to test them to be sure they actually solve the problem. |
I have sent you the information by email. If anything else is need, tell us and we will provide the information as soon as possible! |
We received the info by email. Thank you! |
It appears that Chromecasts stop a fraction of a second before a gap. This would sometimes cause them to stall on gaps in a way that the stall prevention would not fix. This changes Chromecasts to use the large gap threshold, to fix those cases. Issue #1720 Change-Id: Ifc6720e55ab35b81b8592dad2ba7e7293983a755
Ok, I was able to reproduce the problem with a (short) custom manifest. This change solves the problem on that custom manifest; I haven't tested the fix on your sample. I'll try it later, or you can try it yourself if you want. I won't close the issue until I know it's an actual fix. |
We plan on gathering more thorough data on platform-specific gap behavior in the future. Hopefully that will help us better account for V1 Chromecasts, and other platforms with weak hardware. |
That number specifies the distance from a gap where we will jump it. So with that change, we'll jump a gap once we are 0.5 seconds from it. This ensures we seek before the browser stalls due to not enough media. This value has no effect on the stall detection. What is probably happening is the Chromecast is taking too long to start playing after the gap jump so the stall detection kicks in and we do another seek. The delay before we handle a stall would be better to be configurable. |
It probably does not hurt to attempt the seek a bit earlier, but that's correct, we observed that the real issue was the stall detection kicking in too fast, before the chromecast even had the chance to seek and resume. |
It appears that Chromecasts stop a fraction of a second before a gap. This would sometimes cause them to stall on gaps in a way that the stall prevention would not fix. This changes Chromecasts to use the large gap threshold, to fix those cases. Issue #1720 Backported to v2.4.x Change-Id: Ifc6720e55ab35b81b8592dad2ba7e7293983a755
Work so far cherry-picked for v2.4.6. |
@alexgerv I am sorry that progress on this issue has been dormant for so long. I noticed that you mentioned in your last comment that stall detection is kicking too fast. As part of Issue #1839 we are making the stall detection logic configurable. Would that help you make progress until we find time to investigate gaps and stalls more carefully? In offline converstaions, @joeyparrish and I have talked about how buffering, gap detection, and stall detection may need to be more cooperative, which would be in-line with your idea of grace periods. I'm confident that we'll find a solution that will work for you and others, but we will need time. What may help this issue get more attention and slotted for a milestone is if you were to summarize what behaviors you need and open an enhancement request. Enhancement requests are easier for community members to rally behind, increasing their priority, and increasing the odds that they'll get resources directed to them. |
Closing due to inactivity. If this is still an issue for you or if you have further questions, you can ask us to reopen or have the bot reopen it by including |
Closing due to inactivity. If this is still an issue for you or if you have further questions, you can ask us to reopen or have the bot reopen it by including |
As requested, here is the enhancement request: #1864 |
It's not clear why this is still open. It seems like it is superseded by the feature request #1864. May we close this issue? |
Have you read the FAQ and checked for duplicate open issues?: Yes
What version of Shaka Player are you using?: v2.4.4
Can you reproduce the issue with our latest release version?: Yes
Can you reproduce the issue with the latest code from
master
?: YesAre you using the demo app or your own custom app?: Both
If custom app, can you reproduce the issue using our demo app?: Yes
What browser and OS are you using?:
Chromecast (for example: V1, V2, Ultra)
What are the manifest and license server URIs?:
Our manifest contains SegmentTemplate with a gap like this:
Our stream is DRM protected which will make it hard to reproduce. We could provide the URIs in private and more information if needed.
What did you do?
We have played a live stream with gaps in the manifest on Chromecast. When the gap occurs, the player buffers for many seconds. We do not own the manifest and have to deal with those gaps.
What did you expect to happen?
There is a jump over the gap and continue.
What actually happened?
The player got stalled until it was outside of the availability window.
Do you have any idea why this happens?
1- In
GapJumpingController.onPollGapJump_
, We successfully jumped over the gap. We then exitGapJumpingController.onPollGapJump_
2- We return in
GapJumpingController.onPollGapJump_
and enter inhandleStall_
. Conditions are met (we haven't understood what this implies entirely) so that the player prints 'Flushing media pipeline due to stall inside buffered range'3- The player is stalled until it was outside of the availability window.
4- The player returns in the seek range and can play again until the next gap.
Workaround for now
We are not completely clear about why the Chromecast is stalling. We believe that this device is not fast enough to seek. We can see that this problem does not occur on web with a Chrome browser.
We have implemented a workaround and are eager to see what you think of it. Our workaround is to add a grace period after a jump before stalling. Basically, everytime we jump, we keep the timestamp of NOW and before stalling, we check if we have jumped recently over gap. Here is the interesting part:
EDIT: The gaps on the live streams occur only once every 22m30s. Therefore, we do not fear to have many gaps in a short period of time. This fix would not work in that case because we might jump over the first gap, might end up near another gap and our gapJumpingGracePeriodInSeconds would not allow the player to jump again. As of now, we are trying to gather more data with a gapJumpingGracePeriodInSeconds = 3. We might revisit this value if we see any side effects.
Questions:
1- Have you already experienced this issue? If so, how did you dealt with?
2- Do you have any comment/solution for our workaround?
The text was updated successfully, but these errors were encountered: