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
Seeking race condition on Firefox #569
Comments
v2.0.1 makes faster adaptation decisions than v2.0.0 did. This is intentional, and based on feedback that Shaka sometimes took tens of seconds to adapt when playback started. See 8152e64 for the commit. It's not instant, though. The time first choice is very low, less than one second for fast connections. The time to that choice being visible on screen depends on many factors, but primarily buffering goal and segment size. In my tests with 4 second segments, 10 second buffering goal, and ample bandwidth, I see visual changes after 8 seconds. Until then, the resolution is determined by the default bandwidth estimate, which is configurable. I haven't seen any issues with seeking events on Firefox. Can you reproduce with our demo app, or only with your own app? Can you provide a steps to reproduce? (Next time you file an issue, please use our template.) |
@boredom2: on which operating systems do you see this Firefox seeking problem? Do you see this problem with all streams? |
Hi there, sorry - you are right, I should have used the Template (was too early for me :P). I can reproduce this Issue also on your Demo Page - but not with all Manifests. The YouTube Manifests run fine, the Azure Media Services Trailer has the same Effect. Due to the fact, that we are also using Azure Media Services heavily - there might be the Problem. I use: Firefox 49.02 on Windows 10, Anniversary Update with all available Updates. |
We're seeing the same issue with 2.0.1 on Firefox 49.0.2 for streams generated by Unified Streaming Platform both for our own content and the sample content within the shaka demo player (Tears of Steel - Widevine). In both cases we've tested so far on OSX. These streams are working fine using Shaka 2.0.1 on Chrome. Steps to replicate:
thanks, Dan |
Using the steps provided by @danpeters76, I can reproduce the buffering problem with Firefox on Windows 10 and Mac OS X 10.12, though I don't see any console errors. The stream resumes within 1-2 seconds in Chrome and Edge, but buffers for about 1-2 minutes in Firefox before resuming. I reproduce the problem any of the Shaka demo streams, not just the United Streaming streams. I don't think this is a Firefox regression because I can reproduce the stall with older versions of Firefox (45-49). Are older versions of the Shaka demo player archived online? That would make regression testing easier. I only tested the current Shaka v2.0.1-debug demo player: |
I filed Firefox bug 1313806 to investigate this problem from the Mozilla side. The Shaka 2.0.1 code works in Chrome, IE11, and Edge, so Firefox should try to be compatible. Safari (macOS 10.12.1) has a different seeking problem with current Shaka demo: the audio begins playing at the new seek position, but the video doesn't start playing unless you manually pause and resume playback. |
2ecd8bb is the first bad commit
|
In commit 2ecd8bb, as workaround for a chromecast bug, whenever the sourcebuffer is cleared, a new seek is initiated in order to flush the media pipeline. However, this can cause an infinite loop if a seek is already pending. Fixes shaka-project#569.
Here is a quick fix. I'm not familiar with shaka code so it may not be how you would have done it. The current code is racy in such that it relies on an event (seeking/seeked) be fired in a specific order, order not defined in the spec. So the work around is to not attempt to clear the media pipeline while we're seeking. It's more efficient that way anyway as when you're seeking there's no need to flush the pipeline (it's already been flushed). This will speed up seeking on all user agents. It fixes the issue mentioned by @cpeterso above with Safari slightly, but there's still something wrong there. Sometimes after seeking it displayed the Halloween message until you pause and play again. But this appears to be irrelevant of 2.0.0 vs 2.0.1 |
@jyavenard, can you please clarify what your fix is? I don't see any code here. Can you submit a PR? |
The link was above: jyavenard@2310754 Will do a PR |
I just managed to reproduce this bug on Chrome by rapidly seeking. The system got stuck in a seek loop, which eventually resolved after many hundred iterations. @cpeterso, I believe this is not Firefox's fault. I hope you haven't spent too much time investigating on the Mozilla side. |
Rather than flushing implicitly when clearing the buffer, flush explicitly in some circumstances. In particular, do not flush on unbuffered seeks. Flushing uses seeking, so flushing on seek creates a race condition that may cause a nasty loop. Issue #569 Change-Id: I61489b13100b56a5316a8313a1b2782dc242f858
I pushed a commit that should fix this. Please let us know if that's not the case, and I can reopen. |
Rather than flushing implicitly when clearing the buffer, flush explicitly in some circumstances. In particular, do not flush on unbuffered seeks. Flushing uses seeking, so flushing on seek creates a race condition that may cause a nasty loop. Issue shaka-project#569 Change-Id: I61489b13100b56a5316a8313a1b2782dc242f858
Rather than flushing implicitly when clearing the buffer, flush explicitly in some circumstances. In particular, do not flush on unbuffered seeks. Flushing uses seeking, so flushing on seek creates a race condition that may cause a nasty loop. Issue #569 Change-Id: I61489b13100b56a5316a8313a1b2782dc242f858
Hi there,
Version 2.0.0 was running fine on Chrome and Firefox.
Version 2.0.1 runs fine on Chrome, but on Firefox, I receive hundreds of "seeking", "seeked", "seeking"... Messages and a very long "stalled" Period afterwards. By Hitting Pause/Play, if then works, but without, it simply does not start anymore.
Additionally - since 2.0.1, the highest Quality is ALWAYS chosen initially. Is this intended?
Thanks,
Christoph
The text was updated successfully, but these errors were encountered: