Skip to content
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

Frequent warnings on playback start #3933

Closed
softworkz opened this issue May 24, 2021 · 9 comments · Fixed by #3967
Closed

Frequent warnings on playback start #3933

softworkz opened this issue May 24, 2021 · 9 comments · Fixed by #3967
Labels
Milestone

Comments

@softworkz
Copy link
Contributor

I'm frequently getting these warnings logged when starting playback:

image

The warning is emitted in method alignPlaylists:

if (previousDetails && details.fragments.length > 0) {
sliding = details.fragments[0].start;
if (details.alignedSliding && Number.isFinite(sliding)) {
this.log(`Live playlist sliding:${sliding.toFixed(3)}`);
} else if (!sliding) {
this.warn(
`[${this.constructor.name}] Live playlist - outdated PTS, unknown sliding`
);
alignStream(this.fragPrevious, lastLevel, details);
}
} else {

Is that expected to happen? And what is supposed to be "aligned" in that situation?

There's just a single media playlist and when that method is called, details and previousDetails are exactly the same.

Thanks

@robwalch
Copy link
Collaborator

Any idea why the playlist is refreshed 6 times at start without updating? That would have happened before we got here, and at this point, the method alignPlaylists is just surprised that there is a list of fragments starting at 0, that does not need to be shifted.

@softworkz
Copy link
Contributor Author

Any idea why the playlist is refreshed 6 times at start without updating?

Ah, that's probably due to the fact that I'm delaying/blocking the request for the first segment until data is available (= tuning into a channel at the server side). This can take between 300ms and 3-5 seconds.
It seems that hlsjs is starting operation and timers when sending out the request for the first segment. I would probably need to delay all this until the first segment data has arrived.
Is there any easy way to achieve this?

@softworkz
Copy link
Contributor Author

delaying/blocking the request for the first segment until data is available

Could this also be the reason for the other issue I'm seeing: #3928 ?

@robwalch
Copy link
Collaborator

I really don't know about your particular use-case or if this is directly related to your other issue. I doubt it, at least with respect to the logging.

I've done some cleanup and removed the warning in #3967. What you should see instead is clearer Live playlist sliding: messages with details about the first SN before and after the refresh, and what the SN of the last appended segment was when we do try to align the playlist here.

You can take it for a spin here:
https://deploy-preview-3967--hls-js-dev.netlify.app/demo/

@softworkz
Copy link
Contributor Author

Thanks Rob, looks good. I'll try shortly (but I can't use the online demo with my local environment, so I'll need to pull/rebase first).

I really don't know about your particular use-case or if this is directly related to your other issue. I doubt it, at least with respect to the logging.

Could you perhaps hint me at the right place(s) where I can block the processing of hlsjs until the first data has arrived (from the first segment request)?

@robwalch
Copy link
Collaborator

robwalch commented May 28, 2021

Could you perhaps hint me at the right place(s) where I can block the processing of hlsjs until the first data has arrived (from the first segment request)?

Block what processing exactly? Playlist reloading (see level-controller and computeReloadInterval largely based on TARGET-DURATION)? More, like level switching (set config.startLevel)?

The components of HLS.js operate independently and in response to events, timers, API methods, and configuration.

@softworkz
Copy link
Contributor Author

I mean everything that is related to timing - not the video timestamps, but what is used to control hlsjs operation. Playlist can be reloaded as many times as it wants to do - as long as that doesn't trigger anything else.

The result should - ideally - be as if the time while waiting until the first byte of the first segment arrives wouldn't have existed. :-)

@softworkz
Copy link
Contributor Author

PS: I'm testing your PR right now

@softworkz
Copy link
Contributor Author

I can confirm that your PR fixes the reported issue.

Thanks again for your great work 👍

@robwalch robwalch added this to the 1.0.5 milestone Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants