xbmc / xbmc/inputstream.adaptive

[Bug] Long delay before audio works with HE-AAC (mp4a.40.5)

Open
#2,103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Triage: Needed
Dominant language
C++
Stars
531
Forks
270
Avg merge
2d 23h
Merged PRs (30d)
3

Description

Describe the problem

When using IA to play an HLS manifest with HE-AAC audio (mp4a.40.5) - there is a large delay before hearing the audio.
There is no such delay when using ffmpeg

Possible fix

No response

Steps to reproduce
  1. Install the Slyguy Trailers addon (https://www.matthuisman.nz/2025/04/slyguy-trailers-kodi-add-on.html)
  2. Enable the use of IA for live streams by editing resources/lib/youtube.py file and uncomment the line
    # inputstream = HLS(live=data.get('is_live', False)), # IA struggles with audio
  3. Go into the addon -> settings -> addon -> test streams (at the bottom) -> YouTube live stream
  4. When asked for the quality - select the lowest 256x144
  5. Observe the long delay before audio starts
Debug log

IA and ffmpeg playing the same stream.
IA has a good 10-15secs before you hear the audio
Enabled a bunch of the audio/video debug components

ia.log.txt
ffmpeg.log.txt

..

Stream manifest file(s)
#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:URI="https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1787465498/ei/ujqKav_0D7-vz7sPm_vaiQw/ip/122.59.4.96/id/mKCieTImjvU.5/itag/233/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/goi/133/sgoap/gir%3Dyes%3Bitag%3D139/rqh/1/hls_chunk_host/rr1---sn-uo1-jijl.googlevideo.com/xpc/EgVo2aDSNQ%3D%3D/playlist_duration/3600/manifest_duration/3600/bui/AR3QkAk77flHynd40av9AnOVZ65FuGcdZRsGbxhJ-Wty6D986hVTOY1QeNskaMyYuIpLbI-tVtm3BIni/spc/KBGBcvsMnTUhbjOi0WB-gGwxoadl8ca3YJEM8IpJmDhuTBJyzPRLVL8ofw/vprv/1/reg/0/playlist_type/DVR/initcwndbps/2232500/met/1787443900,/mh/jb/mm/44/mn/sn-uo1-jijl/ms/lva/mv/m/mvi/1/pl/21/rms/lva,lva/dover/13/pacing/0/short_key/1/keepalive/yes/fexp/51565116/mt/1787443467/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,rqh,xpc,playlist_duration,manifest_duration,bui,spc,vprv,reg,playlist_type/sig/AE0s2JYwRQIgXxr-M4Lgd-WdR2ceVifL0K_weiruIbE7FoCh6ldwn80CIQCNJ8HVKnNMBw0Q-FDf_G-ewAL8z1koJ5wWqpE3WMyQCA%3D%3D/lsparams/hls_chunk_host,initcwndbps,met,mh,mm,mn,ms,mv,mvi,pl,rms/lsig/APaTxxMwRQIgE7AOn5WidoiCTRwj5hRknQ3FJvOHogog7oNBgxloPPACIQCRIkr_I5EdQChG7ZfqxzTGFjJDSvt6aL0P6Og24G211A%3D%3D/playlist/index.m3u8",TYPE="AUDIO",GROUP-ID="233",NAME="Default",DEFAULT="NO",AUTOSELECT="YES"
#EXT-X-STREAM-INF:BANDWIDTH=290288,CODECS="avc1.42C00B,mp4a.40.5",RESOLUTION=256x144,FRAME-RATE=15,VIDEO-RANGE=SDR,AUDIO="233",CLOSED-CAPTIONS=NONE
https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1787465498/ei/ujqKav_0D7-vz7sPm_vaiQw/ip/122.59.4.96/id/mKCieTImjvU.5/itag/269/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgovp/gir%3Dyes%3Bitag%3D160/rqh/1/hls_chunk_host/rr1---sn-uo1-jijl.googlevideo.com/xpc/EgVo2aDSNQ%3D%3D/playlist_duration/3600/manifest_duration/3600/bui/AR3QkAk77flHynd40av9AnOVZ65FuGcdZRsGbxhJ-Wty6D986hVTOY1QeNskaMyYuIpLbI-tVtm3BIni/spc/KBGBcvsMnTUhbjOi0WB-gGwxoadl8ca3YJEM8IpJmDhuTBJyzPRLVL8ofw/vprv/1/reg/0/playlist_type/DVR/initcwndbps/2232500/met/1787443900,/mh/jb/mm/44/mn/sn-uo1-jijl/ms/lva/mv/m/mvi/1/pl/21/rms/lva,lva/dover/13/pacing/0/short_key/1/keepalive/yes/fexp/51565116/mt/1787443467/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgovp,rqh,xpc,playlist_duration,manifest_duration,bui,spc,vprv,reg,playlist_type/sig/AE0s2JYwRgIhAMb-GakoNj2lR-urTwtX70TG6sHlZ0YA5eE0MD2jo_9MAiEArrcbIOg4IP0fhGwVtg8hTIndg-930ACL-YFgm5qfhEU%3D/lsparams/hls_chunk_host,initcwndbps,met,mh,mm,mn,ms,mv,mvi,pl,rms/lsig/APaTxxMwRAIgdyL2rmFPJvUBYarlFezA3XIAyVqZ9iveBTOXoTC3SD8CIEw3YJtxQwpu9aDxcMMkJybMwOa9nhO3efl5RGg1DPhF/playlist/index.m3u8
Additional info

No response

Operating system(s)

Windows

Operating system version(s)

11

InputStream Adaptive version(s)

22.3.20

Kodi version(s)

22

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing ia.log.txt and ffmpeg.log.txt for the same HLS manifest, focusing on the HE-AAC stream identified by mp4a.40.5. Reproduce with the Slyguy Trailers addon after enabling HLS in resources/lib/youtube.py, then trace the differing startup behavior in InputStream Adaptive. Done means the HE-AAC audio starts without the reported 10–15 second delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.