Skip to content

Buffer sync error when switching audio across different adaptation sets

Created by: blicky

Environment
  • Link to playable MPD file: -NA-
  • Dash.js version: 3.1.0
  • Browser name/version: Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.34 Safari/537.36 WebAppManager
  • OS name/version: LG 2019 WebOS
Steps to reproduce

When playing back a DASH-stream with multiple audio-tracks in the manifest defined:

 <AdaptationSet lang="eng" mimeType="audio/mp4" id="1" segmentAlignment="true" startWithSAP="1">
      <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="MSPR 2.0" cenc:default_KID="--removed--">
        <mspr:pro>--removed--</mspr:pro>
      </ContentProtection>
      <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="--removed--" />
      <SegmentTemplate duration="6000" media="$RepresentationID$_165000/segment_$Number$.m4a" startNumber="0" timescale="1000" initialization="$RepresentationID$/audio/init.mp4" />
      <Representation bandwidth="65200" codecs="mp4a.40.2" id="ac7b82ae-54a1-5e6b-9b48-9412375cd1a0-0_audio_frag_482_64000.idx~audio_frag_482_64000" audioSamplingRate="48000" scanType="progressive" />
    </AdaptationSet>
    <AdaptationSet lang="eng" mimeType="audio/mp4" id="2" segmentAlignment="true" startWithSAP="1">
      <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="MSPR 2.0" cenc:default_KID="--removed--">
        <mspr:pro>--removed--</mspr:pro>
      </ContentProtection>
      <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="--removed--" />
      <SegmentTemplate duration="6000" media="$RepresentationID$_165000/segment_$Number$.m4a" startNumber="0" timescale="1000" initialization="$RepresentationID$/audio/init.mp4" />
      <Representation bandwidth="392000" codecs="ac-3" id="ac7b82ae-54a1-5e6b-9b48-9412375cd1a0-0_audio_frag_483_384000.idx~audio_frag_483_384000" audioSamplingRate="48000" scanType="progressive" />
    </AdaptationSet>
Observed behavior

the player starts buffering the correct audio-track, but then continues to buffer audio from the next audio-track in the manifest after a few chunks.

Console output
[SourceBufferSink] SourceBufferSink error audio
[StreamController] Video Element Error: MEDIA_ERR_DECODE


[2021-04-20T05:40:43.287Z][ScheduleController][audio] Quality has changed, get init request for representationid = ac7b82ae-54a1-5e6b-9b48-9412375cd1a0-0_audio_frag_482_64000.idx~audio_frag_482_64000 
[2021-04-20T05:40:43.288Z][ScheduleController][audio] Switch track has been asked, get init request for audio with representationid = ac7b82ae-54a1-5e6b-9b48-9412375cd1a0-0_audio_frag_482_64000.idx~audio_frag_482_64000bufferResetInProgress = true 
[2021-04-20T05:40:43.293Z][ScheduleController][audio] isFragmentProcessingInProgress is already equal to true 
[2021-04-20T05:40:43.312Z][AbrController] [video] switching from throughput to buffer occupancy ABR rule (buffer: 16.394). 
[2021-04-20T05:40:43.327Z][BufferController][video] Buffered Range 0  -  18  currentTime =  0.446 
[2021-04-20T05:40:43.613Z][ScheduleController][fragmentedText] Schedule stop! 
[2021-04-20T05:40:43.929Z][BufferController][audio] Init fragment finished loading saving to audio's init cache 
[2021-04-20T05:40:43.931Z][BufferController][audio] Append Init fragment audio  with representationId: ac7b82ae-54a1-5e6b-9b48-9412375cd1a0-0_audio_frag_482_64000.idx~audio_frag_482_64000  and quality: 0 , data size: 1518 
[2021-04-20T05:40:43.934Z][ScheduleController][audio] OnFragmentLoadingCompleted - Url: http://--removed--/ac7b82ae-54a1-5e6b…412375cd1a0-0_audio_frag_482_64000.idx~audio_frag_482_64000/audio/init.mp4  
1.chunk.js:75166 [2021-04-20T05:40:43.974Z][SourceBufferSink] SourceBufferSink error audio function.console.(anonymous function) @ 1.chunk.js:75166doLog @ main.chunk.js:36928error @ main.chunk.js:36871errHandler @ main.chunk.js:55943
[2021-04-20T05:40:43.976Z][BufferController][audio] AppendToBuffer seek target should be 1.046 ```

##### Expected behavior
The player should be able to switch to a different Representation in a different AdaptationSet