Resuming playback, audio momentarily muted - keyframes?

Just tried to recreate on Windows and Android using Kodi 18.1, but everything worked fine.

I’m now thinking it might be a LibreELEC/CoreELEC issue.

The problem does not occur with Kodi Leia on Windows or Android - the issue is only present with LibreELEC 9.0 and CoreELEC 9.0.

Maybe some amlogic specific fixes in this area…??

I’ve posted a thread on the Amlogic Forum:-

Yes this is very annoying and only an Amlogic issue afaik. No idea why

I noticed the same.
If I’m correct, it appeared somewhere between CoreELEC-S905.arm-8.95.3 (not present) and CoreELEC-S905.arm-8.99.2 (present).
Hope that helps in finding the breaking change.

My guess is something related to amlogic specific patches. However, the sample could be used to test any changes as it happens every time with that sample on LE or CE v9

It alsp happens without any kodi patches.

I’ve submitted a bug report on the LibreELEC site, as this happens on both LE and CE.

Here is link:-

Btw, I just watch this a little today, and for me, it seems that audio pauses little bit delayed after video. And when unpaused, reverse order to be in sync… (some h264 video…)

Thanks. Did you try playing back the HEVC sample in the link on the Amlogic bug report page? With that sample, you should get about 5-6 seconds of no audio if you resume it from 40 seconds? If you don’t get the same result then maybe it’s something in my setup, but the missing audio is very noticeable.

I just tried your sample ( Link to sample:- https://mega.nz/#F!DhxBDY4L!WY62ZBT0rHSf7meo-LTTMA , on two installations, and both acts the same (maybe on Win the delay was a tiiiiny bit shorter - doesnt matter I think) as I am used from other videos. Video pauses immediatelly, sound a few moments (200-400ms? guessing) later. Resume: video plays immediatelly, sound next after the same delay.

I tried it on Windows 7 + Kodi 18.1, and Odroid C2 + CE 8.99.2 (Kodi 18.0). The behaviour is the same (so I believe its maybe Kodi code, not ELEC…) but too simple testing to claim that, just letting know my results.

On Win - no sync monitor to video, on C2 also. I could test it also on other C2 setup, where I use one freq and syncing videos to it, but I dont think its needed, as I experience slightly delay also on Win platform (and you not?) and also I didnt hit the *sec delay anywhere… (and also, with CE, I am waiting for official version with 18.1, until that I would be propably behind your nightly and I can see, there was some minor (and most propably doesnt affect pausing) frame code change between 8.99.2 and 9.0 final).

Basically, I dont mint that short delay and I still believe, there is some reason for it (as it is same on all platform I using). But it could be we are talking about two different things, where I dont have your symptoms.

and btw., I use network share for media… Hmm, I can see, that there is so many things in setup which could affects test reports (audio sync, buffering, type of TV, resolution, connections/AVR…), that maybe it would be usefull describe my configs somewhere to pastebin and include them to every report… :smiley:

Thanks for your thorough feedback and your time! I’d already tried Windows and Android (latest Kodi on both) and they work fine. The big audio silence (for me) comes using latest LibreELEC/CoreELEC on Android TV box. I believe @Nostalgist in a previous post in this thread suggested that the problem was introduced at 8.99.2 but before that (8.95.3) it was ok - but it does seem specific to CE/LE and running on Linux.

I have a basic setup - box directly connected to TV via HDMI and all media stored on USB 2TB external HDD. I’m sticking with LE 8.2.5 for now - I have had zero issues with that build for well over a year.

Hmm, I must admit I can see this couple of times now (CE 9.0.1, updated couple a days ago from 8.99.2). Its was occured at least few times, and log says

2019-03-08 14:47:33.805 T:4070638448 WARNING: ActiveAE - large audio sync error: 5582.446207
2019-03-08 14:47:33.890 T:4070638448 WARNING: ActiveAE - large audio sync error: 5496.855332
2019-03-08 14:47:33.976 T:4070638448 WARNING: ActiveAE - large audio sync error: 5411.909018
2019-03-08 14:47:34.061 T:4070638448 WARNING: ActiveAE - large audio sync error: 5326.371226
2019-03-08 14:47:34.147 T:4070638448 WARNING: ActiveAE - large audio sync error: 5241.172644
2019-03-08 14:47:34.232 T:4070638448 WARNING: ActiveAE - large audio sync error: 5155.707477
2019-03-08 14:47:34.318 T:4070638448 WARNING: ActiveAE - large audio sync error: 5070.714476

There is propably more variables (HEVC skipping fix or not, media file, fps…) and I cant tell if that happens when because I switched from 8.99.2 to the 9.0.1, if its related only to (some?) x265 content… But I can confirm this is happening now with 9.0.1 in certain circumstances (sync to playback on start+stop, no adjust framerate to display, no passthrough audio, HEVC seek fix ON, maybe only on pause/play). Need more testing.

yes, quite annoying, happens very often since CE 9
resume and skip affected, many kinds of codecs … don’t know if is a start also affected

try it also without HEVC Skip fix… I turning it off, continue watching the same show, and seems to it helps, even there are some timeouts though (maybe its related to pausing, maybe not, I dont have notebook right now to proper debug and watch tv…)

    19-03-08 14:48:28.274 T:3449758576 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
    2019-03-08 15:15:34.092 T:4091158544 WARNING: Previous line repeats 3141 times.
    2019-03-08 15:15:34.092 T:4091158544  NOTICE: Whitelist search for: width: 1920, height: 1080, fps: 23.976, 3D: false
    2019-03-08 15:15:34.093 T:4091158544  NOTICE: Display resolution ADJUST : 1920x1080 @ 23.98 - Full Screen (16) (weight: 0.000)
    2019-03-08 15:15:34.254 T:3449758576 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
    2019-03-08 15:19:13.574 T:4091158544 WARNING: Previous line repeats 306 times.
    2019-03-08 15:19:13.574 T:4091158544  NOTICE: Whitelist search for: width: 1920, height: 1080, fps: 23.976, 3D: false
    2019-03-08 15:19:13.574 T:4091158544  NOTICE: Display resolution ADJUST : 1920x1080 @ 23.98 - Full Screen (16) (weight: 0.000)
    2019-03-08 15:19:13.721 T:3449758576 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
    2019-03-08 15:19:39.085 T:3405697904 WARNING: Previous line repeats 31 times.
    2019-03-08 15:19:39.085 T:3405697904  NOTICE: CActiveAEStream::AddData - messy timestamps, increasing interval for measuring average error to 6000 ms
    2019-03-08 15:19:48.316 T:3449758576 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
    2019-03-08 15:20:29.364 T:4091158544 WARNING: Previous line repeats 80 times.
    2019-03-08 15:20:29.364 T:4091158544  NOTICE: Whitelist search for: width: 1920, height: 1080, fps: 23.976, 3D: false
    2019-03-08 15:20:29.364 T:4091158544  NOTICE: Display resolution ADJUST : 1920x1080 @ 23.98 - Full Screen (16) (weight: 0.000)
    2019-03-08 15:20:29.715 T:3449758576 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
    2019-03-08 15:21:43.112 T:3405697904 WARNING: Previous line repeats 55 times.
    2019-03-08 15:21:43.112 T:3405697904  NOTICE: CActiveAEStream::AddData - messy timestamps, increasing interval for measuring average error to 6000 ms
    2019-03-08 15:25:22.004 T:3449758576 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
    2019-03-08 15:58:41.838 T:3405697904 WARNING: Previous line repeats 615 times.
    2019-03-08 15:58:41.838 T:3405697904  NOTICE: CActiveAEStream::AddData - messy timestamps, increasing interval for measuring average error to 6000 ms

But If i understand correctly, HEVC seek fix was enabled by default on previous 8.99.2, and I didnt experience this before.

1 Like

For me, this happens even when a pause a video and replay it. Do you experience the same? A delay of few seconds in the audio after the video has started.

That “ActiveAE -large audio sync error” is something I noticed in my log - in the example I posted the sync error is over 8 seconds - hence the 8 second mute on resume. The only thing I found looking through the xbmc source is a small change between Kodi 17.6 and Kodi Leia. See below:-

"if (m_pDemuxer)
{
if (m_pDemuxer->SeekTime(starttime, true, &startpts))
{
FlushBuffers(starttime / 1000 * AV_TIME_BASE, true, true);
CLog::Log(LOGDEBUG, “%s - starting demuxer from: %d”, FUNCTION, starttime);
}
else
CLog::Log(LOGDEBUG, “%s - failed to start demuxing from: %d”, FUNCTION, starttime);
}
"
In kodi 17.6 version of this file (https://github.com/xbmc/xbmc/blob/master/xbmc/cores/VideoPlayer/VideoPlayer.cpp), the line below is not present.
FlushBuffers(starttime / 1000 * AV_TIME_BASE, true, true);

I don’t know what this line does but it may hold a clue.

FYI, PR11713 basically changed the line of code from:-
" if (m_pDemuxer->SeekTime(starttime, false, &startpts))"
to
" if (m_pDemuxer->SeekTime(starttime, true, &startpts))
in 2 places. See the commit below:-

This changed the behaviour to seek backwards for the nearest video keyframe to resume playback from, instead of seeking forwards as it had done in the past.

I’m thinking it’s a either a native kodi issue or something LE9.0 introduced, as it also has the same issue since early days of Leia.

Hyphotetically, if this would be Kodi related, it would affect 18.1, because I didnt notice this on CE 8.99.2 + Kodi 18. This suggest opposite though.

But this is hard one, because there are quite much things related, and the error message is a bit general… And also, as you can see, in my previous post, I experienced very little delay normalny when jumped to Leia (which could be consequence of PR you mentioned) which doesnt have any negative consequences in logs I believe, but this AE sync errors seems to be bounded with bigger delay symptom…

btw. for me, after HEVC Skip fix uncheck, my logs doesnt have those AR sync errors (watching one specific TV series 1.5h or something).

It’s definitely a strange one as Kodi 18.1 on Windows and Android are fine.I only see the problem on CoreELEC 9 with resume (and only when the gap between previous keyframe and resume time is noticeable).

it could be something Amlogic specific. And also, more things could change in CE between 8.99.2 (which I think has HEVC Skip fix enabled and I didnt notice longer audio delay) and 9.0.1.

CE devs do amazing work to allow good h265 HW dec. playback as wide as possible (especially appretiated custom settings), but apparently this is quite hard job I guess… h265 seems to not be so much standartized as h264 and some issues could be AML specific; so Intel platform doesnt have those - doesnt pops out so quickly.

I experienced longer delays on 9.0.1, not before… I dont know what early Leia days means, but on the other side I cant remember from which version I started to use CE… but feels like quite a time already… :slight_smile:

I just tried it on a Rockchip device RK3328 (using LE9) and the same issue occurs there also.