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

Repeated QuotaExceededError #6529

Closed
5 tasks done
grabofus opened this issue Jul 1, 2024 · 2 comments · Fixed by #6530
Closed
5 tasks done

Repeated QuotaExceededError #6529

grabofus opened this issue Jul 1, 2024 · 2 comments · Fixed by #6530

Comments

@grabofus
Copy link
Contributor

grabofus commented Jul 1, 2024

What version of Hls.js are you using?

v1.5.11

What browser (including version) are you using?

Chrome 126.0.6478.127

What OS (including version) are you using?

Windows 11

Test stream

https://hlsjs.video-dev.org/demo/?src=https%3A%2F%2Fsample-videos-zyrkp2nj.s3-eu-west-1.amazonaws.com%2Fbig-buck-bunny%2Fhls%2Fmaster.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==

Configuration

{
  "debug": true,
  "startLevel": 0,
  "capLevelToPlayerSize": true
}

Additional player setup steps

  • Set HTML video element width to 240px
  • Load stream

Alternatively, without the config:

  • Load stream
  • Pause
  • Manually select lowest rendition

Checklist

Steps to reproduce

  1. Load the provided stream
  2. Manually select lowest resolution
  3. Pause the video

Expected behaviour

Buffer size should be restricted on QuotaExceededError.

What actually happened?

Due to playing very low bitrate video, the audio buffer overfills before reaching the limits of the video buffer. This leads to repeated QuotaExceededErrors: Failed to execute 'appendBuffer' on 'SourceBuffer': The SourceBuffer is full, and cannot free space to append additional buffers. being triggered, and the last audio segment being repeatedly downloaded.

Console output

Clipped as it's infinitely repeating.

[log] > [stream-controller]: IDLE->FRAG_LOADING
transmuxer-interface.ts:230 [log] > [transmuxer-interface, audio]: Starting new transmux session for sn: 91 p: -1 level: 0 id: 1
        discontinuity: false
        trackSwitch: false
        contiguous: false
        accurateTimeOffset: false
        timeOffset: 546.0193673470475
        initSegmentChange: false
base-stream-controller.ts:389 [log] > [audio-stream-controller]: Loaded fragment 91 of level 0
transmuxer-interface.ts:394 [log] > [mp4-remuxer]: reset next timestamp
base-stream-controller.ts:1793 [log] > [audio-stream-controller]: FRAG_LOADING->PARSING
buffer-operation-queue.ts:64 [warn] > [buffer-operation-queue]: Exception executing "audio" SourceBuffer operation: QuotaExceededError: Failed to execute 'appendBuffer' on 'SourceBuffer': The SourceBuffer is full, and cannot free space to append additional buffers.
executeNext @ buffer-operation-queue.ts:64
append @ buffer-operation-queue.ts:29
onBufferAppending @ buffer-controller.ts:548
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
bufferFragmentData @ base-stream-controller.ts:943
_handleTransmuxComplete @ audio-stream-controller.ts:850
handleTransmuxComplete @ transmuxer-interface.ts:422
onWorkerMessage @ transmuxer-interface.ts:382
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:91
Show 1 more frame
Show less
base-stream-controller.ts:1651 [log] > [audio-stream-controller]: Reset loading state
base-stream-controller.ts:1793 [log] > [audio-stream-controller]: PARSING->IDLE
main.js:734 Error event: {type: 'mediaError', parent: 'audio', details: 'bufferFullError', sourceBufferName: 'audio', frag: Fragment, …}
(anonymous) @ main.js:734
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
onError @ buffer-controller.ts:545
executeNext @ buffer-operation-queue.ts:67
append @ buffer-operation-queue.ts:29
onBufferAppending @ buffer-controller.ts:548
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
bufferFragmentData @ base-stream-controller.ts:943
_handleTransmuxComplete @ audio-stream-controller.ts:850
handleTransmuxComplete @ transmuxer-interface.ts:422
onWorkerMessage @ transmuxer-interface.ts:382
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:91
Show 2 more frames
Show less
transmuxer-interface.ts:394 [log] > [transmuxer.ts]: Flushed fragment 91 of level 0
base-stream-controller.ts:758 [log] > [audio-stream-controller]: Loading fragment 91 cc: 0 of [0-99] track: 0, target: 546.019
base-stream-controller.ts:1793 [log] > [audio-stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:389 [log] > [stream-controller]: Loaded fragment 98 of level 0
base-stream-controller.ts:1793 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:394 [log] > [transmuxer.ts]: Flushed fragment 98 of level 0
base-stream-controller.ts:1793 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:570 [log] > [stream-controller]: Buffered main sn: 98 of level 0 (frag:[588.000-594.000] > buffer:[0.000-594.000])
base-stream-controller.ts:1793 [log] > [stream-controller]: PARSED->IDLE
base-stream-controller.ts:758 [log] > [stream-controller]: Loading fragment 99 cc: 0 of [0-99] level: 0, target: 594
base-stream-controller.ts:1793 [log] > [stream-controller]: IDLE->FRAG_LOADING
transmuxer-interface.ts:230 [log] > [transmuxer-interface, audio]: Starting new transmux session for sn: 91 p: -1 level: 0 id: 1
        discontinuity: false
        trackSwitch: false
        contiguous: false
        accurateTimeOffset: false
        timeOffset: 546.0193673470475
        initSegmentChange: false
base-stream-controller.ts:389 [log] > [audio-stream-controller]: Loaded fragment 91 of level 0
transmuxer-interface.ts:394 [log] > [mp4-remuxer]: reset next timestamp
base-stream-controller.ts:1793 [log] > [audio-stream-controller]: FRAG_LOADING->PARSING
buffer-operation-queue.ts:64 [warn] > [buffer-operation-queue]: Exception executing "audio" SourceBuffer operation: QuotaExceededError: Failed to execute 'appendBuffer' on 'SourceBuffer': The SourceBuffer is full, and cannot free space to append additional buffers.
executeNext @ buffer-operation-queue.ts:64
append @ buffer-operation-queue.ts:29
onBufferAppending @ buffer-controller.ts:548
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
bufferFragmentData @ base-stream-controller.ts:943
_handleTransmuxComplete @ audio-stream-controller.ts:850
handleTransmuxComplete @ transmuxer-interface.ts:422
onWorkerMessage @ transmuxer-interface.ts:382
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:91
Show 1 more frame
Show less
base-stream-controller.ts:1651 [log] > [audio-stream-controller]: Reset loading state
base-stream-controller.ts:1793 [log] > [audio-stream-controller]: PARSING->IDLE
main.js:734 Error event: {type: 'mediaError', parent: 'audio', details: 'bufferFullError', sourceBufferName: 'audio', frag: Fragment, …}
(anonymous) @ main.js:734
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
onError @ buffer-controller.ts:545
executeNext @ buffer-operation-queue.ts:67
append @ buffer-operation-queue.ts:29
onBufferAppending @ buffer-controller.ts:548
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
bufferFragmentData @ base-stream-controller.ts:943
_handleTransmuxComplete @ audio-stream-controller.ts:850
handleTransmuxComplete @ transmuxer-interface.ts:422
onWorkerMessage @ transmuxer-interface.ts:382
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:91
Show 2 more frames
Show less
transmuxer-interface.ts:394 [log] > [transmuxer.ts]: Flushed fragment 91 of level 0
base-stream-controller.ts:758 [log] > [audio-stream-controller]: Loading fragment 91 cc: 0 of [0-99] track: 0, target: 546.019
base-stream-controller.ts:1793 [log] > [audio-stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:389 [log] > [stream-controller]: Loaded fragment 99 of level 0
base-stream-controller.ts:1793 [log] > [stream-controller]: FRAG_LOADING->PARSING
transmuxer-interface.ts:394 [log] > [transmuxer.ts]: Flushed fragment 99 of level 0
base-stream-controller.ts:1793 [log] > [stream-controller]: PARSING->PARSED
base-stream-controller.ts:570 [log] > [stream-controller]: Buffered main sn: 99 of level 0 (frag:[594.000-596.440] > buffer:[0.000-596.440])
base-stream-controller.ts:1793 [log] > [stream-controller]: PARSED->IDLE
buffer-controller.ts:638 [log] > [buffer-controller] video sourceBuffer now EOS
base-stream-controller.ts:1793 [log] > [stream-controller]: IDLE->ENDED
transmuxer-interface.ts:230 [log] > [transmuxer-interface, audio]: Starting new transmux session for sn: 91 p: -1 level: 0 id: 1
        discontinuity: false
        trackSwitch: false
        contiguous: false
        accurateTimeOffset: false
        timeOffset: 546.0193673470475
        initSegmentChange: false
base-stream-controller.ts:389 [log] > [audio-stream-controller]: Loaded fragment 91 of level 0
transmuxer-interface.ts:394 [log] > [mp4-remuxer]: reset next timestamp
base-stream-controller.ts:1793 [log] > [audio-stream-controller]: FRAG_LOADING->PARSING
buffer-operation-queue.ts:64 [warn] > [buffer-operation-queue]: Exception executing "audio" SourceBuffer operation: QuotaExceededError: Failed to execute 'appendBuffer' on 'SourceBuffer': The SourceBuffer is full, and cannot free space to append additional buffers.
executeNext @ buffer-operation-queue.ts:64
append @ buffer-operation-queue.ts:29
onBufferAppending @ buffer-controller.ts:548
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
bufferFragmentData @ base-stream-controller.ts:943
_handleTransmuxComplete @ audio-stream-controller.ts:850
handleTransmuxComplete @ transmuxer-interface.ts:422
onWorkerMessage @ transmuxer-interface.ts:382
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:91
Show 1 more frame
Show less
base-stream-controller.ts:1651 [log] > [audio-stream-controller]: Reset loading state
base-stream-controller.ts:1793 [log] > [audio-stream-controller]: PARSING->IDLE
main.js:734 Error event: {type: 'mediaError', parent: 'audio', details: 'bufferFullError', sourceBufferName: 'audio', frag: Fragment, …}
(anonymous) @ main.js:734
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
onError @ buffer-controller.ts:545
executeNext @ buffer-operation-queue.ts:67
append @ buffer-operation-queue.ts:29
onBufferAppending @ buffer-controller.ts:548
emit @ index.js:203
emit @ hls.ts:310
trigger @ hls.ts:318
bufferFragmentData @ base-stream-controller.ts:943
_handleTransmuxComplete @ audio-stream-controller.ts:850
handleTransmuxComplete @ transmuxer-interface.ts:422
onWorkerMessage @ transmuxer-interface.ts:382
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:91
Show 2 more frames
Show less
transmuxer-interface.ts:394 [log] > [transmuxer.ts]: Flushed fragment 91 of level 0
base-stream-controller.ts:758 [log] > [audio-stream-controller]: Loading fragment 91 cc: 0 of [0-99] track: 0, target: 546.019
base-stream-controller.ts:1793 [log] > [audio-stream-controller]: IDLE->FRAG_LOADING
transmuxer-interface.ts:230 [log] > [transmuxer-interface, audio]: Starting new transmux session for sn: 91 p: -1 level: 0 id: 1
        discontinuity: false
        trackSwitch: false
        contiguous: false
        accurateTimeOffset: false
        timeOffset: 546.0193673470475
        initSegmentChange: false


### Chrome media internals output

_No response_
@grabofus grabofus added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Jul 1, 2024
@grabofus
Copy link
Contributor Author

grabofus commented Jul 1, 2024

@robwalch robwalch added Confirmed and removed Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Jul 1, 2024
@robwalch
Copy link
Collaborator

robwalch commented Jul 1, 2024

I can reproduce the issue and will work on a fix to patch the latest release.

In the meantime, setting maxMaxBufferLength to a reasonable length (say 300) or reducing maxBufferSize (to 20000000 bytes) will prevent the video buffer from exceeding a length that the audio buffer cannot reach at its bitrate.

@robwalch robwalch added this to the 1.5.12 milestone Jul 1, 2024
robwalch added a commit that referenced this issue Jul 1, 2024
* patch/v1.5.x:
  Reduce max buffer length in response to buffer full errors Fixes #6529
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants