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

AudioStreamController may stuck after flushing buffer #2079

Closed
3 of 5 tasks
mad-gooze opened this issue Jan 14, 2019 · 13 comments
Closed
3 of 5 tasks

AudioStreamController may stuck after flushing buffer #2079

mad-gooze opened this issue Jan 14, 2019 · 13 comments

Comments

@mad-gooze
Copy link
Contributor

What version of Hls.js are you using?

0.12.2

What browser and OS are you using?

Latests Chrome

Test stream:

Test page -- http://jsfiddle.net/0hzpgc7a/1/

Checklist

  • The stream has correct Access-Control-Allow-Origin headers (CORS)
  • There are no network errors such as 404s in the browser console when trying to play the stream

Steps to reproduce

This issue may happen in the wild when video stream is switched by abr controller or by user and BUFFER_FLUSHING event is triggered.

I made a synthetic example with a sample stream with a single audio and video level.

In this example BUFFER_FLUSHING event is triggered manually after FRAG_LOADING event for the 3rd audio chunk (the exact number does not matter here).

After BUFFER_FLUSHING playback may stall (this happens most of the times, try reloading the page). The problem is that FragementTracker marks fragCurrent as APPENDING https://github.com/video-dev/hls.js/blob/v0.12.2/src/controller/audio-stream-controller.js#L314 because it was loaded during IDLE state and was not parsed so it never gets loaded and parsed again.

Expected behavior

Playback continues

Actual behavior

Playback stalls

Console output

https://gist.github.com/mad-gooze/f77d1381f571049b6e44777771a98800

@mad-gooze
Copy link
Contributor Author

please see possible solution in supplied PR

mad-gooze added a commit to yandex-pcode/hls.js that referenced this issue Jan 25, 2019
@stale
Copy link

stale bot commented Mar 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Mar 15, 2019
@mad-gooze
Copy link
Contributor Author

still an issue

@stale stale bot removed the Stale label Mar 16, 2019
@johnBartos
Copy link
Collaborator

johnBartos commented Mar 16, 2019 via email

@itsjamie
Copy link
Collaborator

itsjamie commented Mar 24, 2019

It's possible this is a byproduct of #2143. If the controller believes the buffer was flushed but it wasn't actually behaviour would definitely be undefined.

The synthetic example doesn't pass a type to flush to the event, which would result in logs being output that a flush occured, but no actual source buffer flush would occur.

Nope, tried the jsfiddle with the fix from the PR for the mentioned issue, still get the cycling.

@stale
Copy link

stale bot commented May 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label May 23, 2019
@mad-gooze
Copy link
Contributor Author

still an issue here

@stale stale bot removed the Stale label May 23, 2019
@stale
Copy link

stale bot commented Jul 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Jul 22, 2019
@mad-gooze
Copy link
Contributor Author

ping

@stale stale bot removed the Stale label Jul 24, 2019
@stale
Copy link

stale bot commented Sep 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Sep 22, 2019
@itsjamie
Copy link
Collaborator

ping

@robwalch
Copy link
Collaborator

robwalch commented Jul 25, 2020

Hi @mad-gooze,

This appears to be working v0.14.5 with @latest: http://jsfiddle.net/0hzpgc7a/1/

Can you confirm? (I'll reopen if I missed something in reproducing the issue)

@robwalch
Copy link
Collaborator

There are also additional improvements to audio track sync and state handling coming in #2919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants