Switching between audio tracks leads to player stalling
Created by: BucherTomas
Environment
-
The MPD passes the DASH-IF Conformance Tool on https://conformance.dashif.org/ -
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 -
The issue observed is not mentioned on https://github.com/Dash-Industry-Forum/dash.js/wiki/FAQ -
The issue occurs in the latest reference client on http://reference.dashif.org/dash.js/ and not just on my page
- Link to playable MPD file: Will be sent to provided developer email
- Dash.js version: 2.6.6 - 2.9.3
- Browser name/version: Chrome, Firefox, any version tested
- OS name/version: Windows 7
Steps to reproduce
I have an MPEG-DASH test stream with one AdaptationSet providing stereo audio track with "main" role and another AdaptationSet providing 5.1 audio track with "alternate" role, both in the same language. Curiously enough, initial load with default configuration in the reference player picks alternate audio track as first loaded instead of main, but I guess this can be influenced by setInitialMediaSettingsFor() when developing custom player app. This issue is about player stalling when switching between stereo and 5.1 audio tracks. Steps to reproduce:
- Load the provided URL and switch from active 5.1 audio track with alternate role to stereo audio track with main role before the stream is buffered entirely. This step works fine.
- After a second or two switch back to 5.1 audio track with alternate role.
Observed behaviour
The player stalls. In order to continue, you just need to nudge the playhead a bit on the seekbar.
2.6.5 was the last working dash.js version, where switching between these tracks used to work properly. 2.6.6 and newer up to nightly exhibit this problem on any tested browser. Shaka, Bitmovin Player and RX Player all work fine.
Possibly related to https://github.com/Dash-Industry-Forum/dash.js/issues/2727
Console output
dash.all.debug.js:15640 [66139201][Protection] EME detected on this user agent! (ProtectionModel_21Jan2015)
dash.all.debug.js:15640 [66139201][MediaPlayer] Streaming Initialized
dash.all.debug.js:15640 [66139204][MediaPlayer] Playback Initialized
dash.all.debug.js:15640 [66139968][DashParser] Parsing complete: ( xml2json: 3.00ms, objectiron: 0.00ms, total: 0.00300s)
dash.all.debug.js:15640 [66139971][ManifestUpdater] Manifest has been refreshed at Thu Jan 17 2019 10:20:51 GMT+0100 [1547716851.457]
dash.all.debug.js:15640 [66139978][AbrController] AbrController (video) switch from 0 to 2/5 (buffer: 0) .
dash.all.debug.js:15640 [66139984][Stream] No text data.
dash.all.debug.js:15640 [66139984][Stream] No fragmentedText data.
dash.all.debug.js:15640 [66139985][Stream] No embeddedText data.
dash.all.debug.js:15640 [66139985][Stream] No muxed data.
dash.all.debug.js:15640 [66139985][Stream] No image data.
dash.all.debug.js:15640 [66139992][PlaybackController] Native video element event: play
dash.all.debug.js:15640 [66139992][PlaybackController] Native video element event: waiting
dash.all.debug.js:15640 [66140167][BufferController][video] Init fragment finished loading saving to video's init cache
dash.all.debug.js:15640 [66140169][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://***/chunk_ctvideo_ridp0va0br849326_cinit_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66140170][BufferController][audio] Init fragment finished loading saving to audio's init cache
dash.all.debug.js:15640 [66140171][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa1br229089_cinit_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66140175][PlaybackController] Native video element event: loadedmetadata
dash.all.debug.js:15640 [66140175][ScheduleController][video] Top quality video index has changed from undefined to 5
dash.all.debug.js:15640 [66140186][ScheduleController][audio] Top quality audio index has changed from undefined to 0
dash.all.debug.js:15640 [66140225][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa1br229089_cs0_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66140378][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa1br229089_cs353285_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66140404][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://***/chunk_ctvideo_ridp0va0br849326_cs0_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66140488][PlaybackController] Native video element event: playing
dash.all.debug.js:15640 [66140610][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://***/chunk_ctvideo_ridp0va0br849326_cs720000_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66140681][ScheduleController][video] OnFragmentLoadingCompleted - Url: https://***/chunk_ctvideo_ridp0va0br849326_cs1440000_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66140683][AbrController] AbrController (video) switching from throughput to buffer occupancy ABR rule (buffer: 23.868).
dash.all.debug.js:15640 [66140927][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa1br229089_cs705556_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66140931][AbrController] AbrController (audio) switching from throughput to buffer occupancy ABR rule (buffer: 23.606).
dash.all.debug.js:15640 [66141022][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa1br229089_cs1058797_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66142304][BufferController][audio] Track change asked
dash.all.debug.js:15640 [66142304][Stream] Stream - Process track changed at current time 1.753333
dash.all.debug.js:15640 [66142328][BufferController][audio] Init fragment finished loading saving to audio's init cache
dash.all.debug.js:15640 [66142330][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa0br119288_cinit_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66142334][AbrController] AbrController (audio) switch from 0 to 1/1 (buffer: 30.274) .
dash.all.debug.js:15640 [66142359][BufferController][audio] Init fragment finished loading saving to audio's init cache
dash.all.debug.js:15640 [66142360][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa0br187486_cinit_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66142563][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa0br187486_cs352800_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66144137][BufferController][audio] Track change asked
dash.all.debug.js:15640 [66144138][Stream] Stream - Process track changed at current time 3.586783
dash.all.debug.js:15640 [66144139][AbrController] AbrController (audio) switch from 1 to 0/1 (buffer: 28.536) .
dash.all.debug.js:15640 [66144174][BufferController][audio] Append Init fragment audio with representationId: p0aa1br229089 and quality: 0 , data size: 640
dash.all.debug.js:15640 [66144179][BufferController][audio] Append Init fragment audio with representationId: p0aa1br229089 and quality: 0 , data size: 640
dash.all.debug.js:15640 [66144214][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa1br229089_cs1411068_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66144216][AbrController] AbrController (audio) switching from buffer occupancy to throughput ABR rule (buffer: 0.000).
dash.all.debug.js:15640 [66144218][PlaybackController] Native video element event: waiting
dash.all.debug.js:15640 [66144218][ScheduleController][audio] Buffer is empty! Stalling!
dash.all.debug.js:15640 [66144218][PlaybackController] Native video element event: ratechange: 0
dash.all.debug.js:15640 [66144241][ScheduleController][audio] OnFragmentLoadingCompleted - Url: https://***/chunk_ctaudio_ridp0aa1br229089_cs1764353_mpd.m4s , Range: undefined
dash.all.debug.js:15640 [66144247][Stream] onBufferingCompleted - One streamProcessor has finished but video one is not buffering completed
doLog @ dash.all.debug.js:15640
warn @ dash.all.debug.js:15591
onBufferingCompleted @ dash.all.debug.js:29140
(anonymous) @ dash.all.debug.js:15777
trigger @ dash.all.debug.js:15776
checkIfBufferingCompleted @ dash.all.debug.js:31902
onStreamCompleted @ dash.all.debug.js:32131
(anonymous) @ dash.all.debug.js:15777
trigger @ dash.all.debug.js:15776
executeRequest @ dash.all.debug.js:39855
getNextFragment @ dash.all.debug.js:34604
schedule @ dash.all.debug.js:34619
setTimeout (async)
startScheduleTimer @ dash.all.debug.js:34658
onBytesAppended @ dash.all.debug.js:34870
(anonymous) @ dash.all.debug.js:15777
trigger @ dash.all.debug.js:15776
onAppended @ dash.all.debug.js:31683
afterSuccess @ dash.all.debug.js:28326
executeCallback @ dash.all.debug.js:28407
updateEndHandler @ dash.all.debug.js:28424
dash.all.debug.js:15640 [66144248][ScheduleController][audio] Stream is complete
dash.all.debug.js:15640 [66144524][PlaybackController] Native video element event: playing
dash.all.debug.js:15640 [66144529][PlaybackController] Native video element event: ratechange: 1
dash.all.debug.js:15640 [66144769][PlaybackController] Native video element event: waiting