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

ADTS sync word found ! #5782

Closed
5 tasks done
natematykiewicz opened this issue Aug 30, 2023 · 4 comments · Fixed by #5783
Closed
5 tasks done

ADTS sync word found ! #5782

natematykiewicz opened this issue Aug 30, 2023 · 4 comments · Fixed by #5783
Labels
Bug Confirmed Bug report confirmed or reproduced. Verify Fixed An unreleased bug fix has been merged and should be verified before closing.
Milestone

Comments

@natematykiewicz
Copy link

natematykiewicz commented Aug 30, 2023

What version of Hls.js are you using?

1.4.10

What browser (including version) are you using?

Safari Version 16.6 (18615.3.12.11.2)

What OS (including version) are you using?

macOS 13.5.1

Test stream

https://dwellapp.io/audio/v1/audio_recordings/eyJfcmFpbHMiOnsibWVzc2FnZSI6Ik16UT0iLCJleHAiOm51bGwsInB1ciI6ImF1ZGlvX3JlY29yZGluZy9zdHJlYW1pbmcifX0=--72951f7be12e178838aab17ef5ea75f44295e4a1878918ffab9852abeeab98b1

Configuration

{}

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. Reload page
  2. Press play content
  3. See player immediately pause like 95% of the time

Expected behaviour

Audio plays

What actually happened?

Player displays correct duration. Pressing play causes the duration to update to 0 seconds. No audio is heard. Player pauses.

Sometimes it does work correctly. I've noticed that in the logs, the times it doesn't work it says "ADTS sync word found !". The times that it does work it says "MPEG Audio sync word found !".

I have another audio stream here that works just fine. This one consistently says "MPEG Audio sync word found !".

Is it possible that this probe function sometimes catches MPEG files?

It's worth noting that I've got about 50 .wav files that I've transcoded using the same FFmpeg command, and like 2 of them have this problem. I'm at a loss as to what the problem is.

Note: In the console output logs, the "stalling" warning happens once you try to play it again after it immediately paused.

Console output

[Log] [log] >"[buffer-controller]: Media source opened" (hls__js.js, line 16749)
[Log] [log] >"[buffer-controller]: Updating Media Source duration to 350.302" (hls__js.js, line 17264)
[Log] [log] >"[stream-controller]:""Loading fragment 0 cc: 0 of [0-0] level: 2, target: 0" (hls__js.js, line 7734)
[Log] [log] >"[stream-controller]:""IDLE->FRAG_LOADING" (hls__js.js, line 8427)
[Log] [log] >"[transmuxer-interface, main]: Starting new transmux session for sn: 0 p: -1 level: 2 id: 1↵        discontinuity: true↵        trackSwitch…" (hls__js.js, line 13141)
"[transmuxer-interface, main]: Starting new transmux session for sn: 0 p: -1 level: 2 id: 1
        discontinuity: true
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: true
        timeOffset: 0
        initSegmentChange: true"
[Log] [log] >"ADTS sync word found !" (hls__js.js, line 8822)
[Log] [log] >"[mp4-remuxer]: ISGenerated flag reset" (hls__js.js, line 11626)
[Log] [log] >"[mp4-remuxer]: initPTS & initDTS reset" (hls__js.js, line 11617)
[Log] [log] >"[mp4-remuxer]: reset next timestamp" (hls__js.js, line 11621)
[Log] [log] >"manifest codec:undefined, ADTS type:2, samplingIndex:4" (hls__js.js, line 8637)
[Log] [log] >"parsed codec:mp4a.40.5, rate:44100, channels:3" (hls__js.js, line 8727)
[Log] [log] >"[stream-controller]:""FRAG_LOADING->PARSING" (hls__js.js, line 8427)
[Log] [log] >"[stream-controller]:""Init audio buffer, container:audio/mp4, codecs[selected/level/parsed]=[//mp4a.40.5]" (hls__js.js, line 14456)
[Log] [log] >"[buffer-controller]: creating sourceBuffer(audio/mp4;codecs=mp4a.40.5)" (hls__js.js, line 17324)
[Log] [log] >"[audio-stream-controller]:""InitPTS for cc: 0 found from main: 0" (hls__js.js, line 15125)
[Log] [log] >"[stream-controller]:""Loaded fragment 0 of level 2" (hls__js.js, line 7503)
[Log] [log] >"[transmuxer.ts]: Flushed fragment 0 of level 2" (hls__js.js, line 12650)
[Log] [log] >"[stream-controller]:""PARSING->PARSED" (hls__js.js, line 8427)
[Log] [log] >"[stream-controller]:""Buffered main sn: 0 of level 2 (frag:[0.000-0.093] > buffer:[0.000-0.093])" (hls__js.js, line 7635)
[Log] [log] >"[stream-controller]:""PARSED->IDLE" (hls__js.js, line 8427)
[Log] [log] >"[buffer-controller]: audio sourceBuffer now EOS" (hls__js.js, line 17153)
[Log] [log] >"[buffer-controller]: Queueing mediaSource.endOfStream()" (hls__js.js, line 17159)
[Log] [log] >"[stream-controller]:""IDLE->ENDED" (hls__js.js, line 8427)
[Log] [log] >"[buffer-controller]: Calling mediaSource.endOfStream()" (hls__js.js, line 17176)
[Log] [log] >"[buffer-controller]: Media source ended" (hls__js.js, line 16766)
[Log] [log] >"[stream-controller]:""media seeking to 0.000, state: ENDED" (hls__js.js, line 7424)
[Log] [log] >"[stream-controller]:""Reset loading state" (hls__js.js, line 8321)
[Log] [log] >"[stream-controller]:""ENDED->IDLE" (hls__js.js, line 8427)
[Log] [log] >"[audio-stream-controller]:""media seeking to 0.000, state: WAITING_TRACK" (hls__js.js, line 7424)
[Log] [log] >"[subtitle-stream-controller]:""media seeking to 0.000, state: IDLE" (hls__js.js, line 7424)
[Log] [log] >"[buffer-controller]: Queueing mediaSource.endOfStream()" (hls__js.js, line 17159)
[Log] [log] >"[stream-controller]:""IDLE->ENDED" (hls__js.js, line 8427)
[Info] [info] >"[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ended" (hls__js.js, line 17172)
[Log] [log] >"[stream-controller]:""Media seeked to 0.000" (hls__js.js, line 13917)
[Warning] [warn] >"Playback stalling at @0 due to low buffer ({\"len\":0.09287981859410431,\"start\":0,\"end\":0.09287981859410431})" (hls__js.js, line 13426)


### Chrome media internals output

_No response_
@natematykiewicz natematykiewicz added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Aug 30, 2023
@robwalch
Copy link
Collaborator

Is it possible that this probe function sometimes catches MPEG files?

I'll look into the probe issue.

It's worth noting that I've got about 50 .wav files that I've transcoded using the same FFmpeg command, and like 2 of them have this problem. I'm at a loss as to what the problem is.

Why not encode to aac or fmp4 instead of mp3?

@robwalch
Copy link
Collaborator

Sometimes it does work correctly. I've noticed that in the logs, the times it doesn't work it says "ADTS sync word found !". The times that it does work it says "MPEG Audio sync word found !".

The low variant (32kbps) is always probed correctly. The medium and high variants are passing the ADTS probe test for some reason. Still investigating.

@robwalch
Copy link
Collaborator

Hi @natematykiewicz,

Let me know if #5783 resolves the issue for you. Thank you for finding and reporting the issue.

@robwalch robwalch added Confirmed Bug report confirmed or reproduced. and removed Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Aug 30, 2023
@robwalch robwalch added this to the 1.5.0 milestone Aug 30, 2023
robwalch added a commit that referenced this issue Aug 31, 2023
@natematykiewicz
Copy link
Author

It works perfectly! Thanks @robwalch

@robwalch robwalch added the Verify Fixed An unreleased bug fix has been merged and should be verified before closing. label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed Bug report confirmed or reproduced. Verify Fixed An unreleased bug fix has been merged and should be verified before closing.
Projects
None yet
2 participants