-
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
Returning to ABR mode #435
Comments
I'm unable to reproduce on the nightly build: http://nightly.shaka-player-demo.appspot.com/demo/ I started with adaptation disabled via the UI. Then I started "Sintel 4k (multicodec)". The resolution was 426x182. I let it play for a bit, then enabled adaptation via the UI. It switched resolutions several times after that in response to bandwidth estimates, hitting both 720p and 1080p. I also tried the other way. I started with adaptation enabled via the UI. Then I started "Sintel 4k (multicodec)". The resolution adapted up to 1080p. I then disabled adaptation by selecting 256x110 resolution. Then I re-enabled adaptation via the UI. It eventually switched resolution again, hitting both 720p and 1080p. The problem might be here:
Can you retest with a clip of at least several minutes and wait longer this time? It could be that our default ABR manager is simply slower than you expected in certain conditions. If so, we'll rename this issue and discuss ways we could improve responsiveness. |
I now tested on Chrome with nightly with adaptation disabled first and both Sintel 4k (multicodec) and Tears of Steel. Strangely enough, Sintel 4k starts for me in 426x182 (not the lowest resolution). Tears of Steel starts properly in lowest 220x124 resolution. In both cases I've been waiting for 5-7 minutes after enabling adaptation again, but it didn't switch to any higher resolution. It took about 50-100 ms to get larger video segments for Tears of Steel, while it took about 200 ms to get video segments for Sintel 4k. Difference caused likely due to me being in Europe. When I started throttling my current speed 100 Mbps to 20 Mbps and less, so it took the video segments about 500 ms and more to arrive, adaptation started to work after a while. No exact measurement, but subjectively it felt like the more I throttled the bandwith, the faster it switched to next available resolution from the initial resolution I started with. How long does it take on average in your case to get the video segments? There is likely a connection. |
Interesting. What Shaka version are you using? |
These last tests were done with the nightly version as you suggested. On 1.7.2016 18:21, Joey Parrish wrote:
|
It seems likely that there is some issue in In particular, I'm sorry that we don't have the environment necessary to reproduce this issue, but if you can find a change to those parameters that helps in your case, we can work from there to analyze the situation in a theoretical way. |
None of the value updates in ewma_bandwidth_estimator.js made any relevant change, unfortunately. When debugging with Chrome dev tools, I could see my custom values being used, but it didn't help. Still stuck on the first selected resolution. I did find something worth reporting, though, when testing with Tears of Steel from Unified Streaming with adaptation disabled first. Not sure where bandwidth throttling comes into play and why it helps. |
I can confirm same like Tomáš. I saw that a month ago using same debugging session. At some circumstances AbrManager caches incorrect (highest) values, gets stuck with them and don't process switch call - probably some initialization race condition. My test case:
I was able to repro it at work & home using Chrome 51.0.2704.103 m. Check race condition status using console:
Why are there cached values inside managers and not reading actual states? |
The value of "chosen" at line 311 would be the lowest bitrate stream on the first pass through the loop. The loop should continue, though, and look at all video streams in order of bandwidth from lowest to highest. @BucherTomas, does this happen in your case? The most recently chosen streams are cached so that the "switch" callback only happens when there are actual changes necessary. One thing that may be confusing the issue is that when we change bitrates, we don't currently clear the buffer at all. So if you've buffered ahead 30 seconds of content at 240p, you won't see 1080p content in the buffer for 30 more seconds. The streams chosen by We've been putting off changes to allow the AbrManager to clear the buffer when switching. Assuming there's no race, that change would make upgrades take effect more quickly. Of course, there may also be a race somewhere. To start, I will try to reduce the effect of buffering, because that is the simplest thing we can do. After that, I will see if I can reproduce the race described by @Ross-cz. |
SimpleAbrManager will now leave 5s of video ahead of the playhead and clear the rest when upgrading to a higher resolution. Also smooths transitions for overlapping segments by scheduling an abort() call to reset MediaSource internals after removing content or changing the append window. Related to issue #435 Change-Id: Ie036515388e1e7e4b3b8f3ab9922e3d5e7ed2627
Tested again with Tears of Steel on nightly with 6daa7f3 commit included.
If I repeat the same procedure with adaptation disabled first and bandwidth throttled by using "Good 3G" preset in Chrome dev tools, chosen bitrate in the second step is 814000 - second lowest bitrate and the player switches to it at the 1 min 20 seconds mark. Return to ABR mode works reasonably well in this low bandwidth scenario. The new feature of clearing the buffer does not tackle the issue I am experiencing, but thank you for it nonetheless. I would have suggested it in the future likely anyway, we were using in our player bufferingGoal of 10 seconds instead of default 30 to shorten the switch time between chosen and displayed track and this should make it redundant. |
I've got clear repro on this now. Definitely a bug. The key is enabling adaptation after the manager has enough data to justify a switch. As soon as the config changes, After that, there's a mismatch between what Not sure yet if the fix will be to |
Also, thanks to both @BucherTomas and @Ross-cz for the detailed reports and for helping to debug. Much obliged. |
Calling chooseStreams does not disable AbrManager. Further, we must explicitly disable it when switching periods. Cleanup for issue #435 Change-Id: Ib5c75ddabb342929aef31eb185860b08d5c27cdc
This will allow us to pass only audio stream sets when a language changes, which will remove the need to filter the output of chooseStreams in Player.applyConfig_. Working toward a solution for #435 Change-Id: I893d13882809ef461b16c6c9426c8e9e33604c02
Duplicate language information from StreamSet to Stream. This will simplify the task of determining when a configuration change triggers a language change. Working toward a solution for #435 Change-Id: I461f7e8974f1e09b0b6f38edfab901b3f89eb3bc
* Create a manifest before each test, since most tests assume that one exists. Not all tests create one, though, and many had relied on pollution from one test to another to satisfy this requirement. * Clean up manifests and players after each test. * Move all manifest creation to beforeEach instead of beforeAll. * Always use the existing global manifest in test's chooseStreams(). Needed to overhaul chooseStreams calls in Player, but also good test hygiene. Tangentially related to #435 Change-Id: I71dc6c2032376b63f93249f18a1d5cdd79eb7c39
Working toward a solution for #435 Change-Id: I662c06c21eab7c5b6f2af85236088f1712ee7a72
* Instead of filtering the output of AbrManager, ask AbrManager only to choose streams for certain types. This keeps AbrManager's info synced with reality. * Simplify the way we apply config changes, restrictions, and new text tracks to one method. Detect which types need updates and only ask for those streams from AbrManager. Issue #435 Change-Id: Ie10ddd2805cd45e97594838520e677de628a9f4c
@BucherTomas and @Ross-cz, I believe we have this fixed now in |
Yes, from what I can see, I also believe that this is now fixed. Thank you. |
Excellent. Thanks! |
There seems to be an issue with re-enabling adaptation once user switches to a given quality manually and then attempts to switch back to auto.
Alternatively start with "enable adaptation" checkbox disabled and enable during playback.
Expected behavior would then be that the player enables ABR again and adapts in a short while to the highest possible quality based on network conditions. But this does not happen, playback is stuck on the manually chosen quality.
We attempted to call in our player player.configure({ abr: { enabled: true } }); , hopefully the correct approach, but no difference from the reference Shaka player, ABR does not kick in.
The text was updated successfully, but these errors were encountered: