You missed: video + video/audio timing component
You enabled only the video/audio timing component.
And please always start playback from beginning on make a log!
You missed: video + video/audio timing component
You enabled only the video/audio timing component.
And please always start playback from beginning on make a log!
Damn! OK Iām preparing a new log then
I donāt understand. I started from beginning of the file. I pressed play and waited until the end of the video without any intervention whatsoever. Once the video closed itself, I sshāed the box and copied the kodi.log file, nothing else.
Slight problem uploading the log :
# paste kodi_20241122172905_CE-NG-20241122085304.log
Error happen, maybe need to increase file upload sizes in php.ini.
The log is 3738295 bytes
Here is the new log
kodi_20241122172905_CE-NG-20241122085304.log.gz (431.2 KB)
To make sure everything is done according to your needs, here are the steps :
.kodi/temp/kodi.log
to logfiles
and rename it to a more useful nameAnd this was not in sync?
Because kodi says: max about a half frame behind, ~22ms.
One time it got >50ms (64ms) and it skipped one frame.
So how kodi does correct work correct here.
The only item left is this part:
m_displayLatency = DVD_MSEC_TO_TIME(
m_latencyTweak +
static_cast<double>(CServiceBroker::GetWinSystem()->GetGfxContext().GetDisplayLatency()) -
m_videoDelay -
static_cast<double>(CServiceBroker::GetWinSystem()->GetFrameLatencyAdjustment()));
So when this value is wrong it might get a offset but kodi think itās in sync!?
But it should have constant offset I guess.
I donāt know yet where these values come from.
Nope. The beep is heard at the (-2) blue circle and sometimes I get the impression that it shifts to -3 or even -4 but I hope this is not some kind of illusion (confirmation bias in psychology). One thing is sure, itās never at (0) when the video is 4K.
I have a āLipSyncā folder filled with extracts from various movies I own, all in 4K and TrueHD, DTS-MA, DTS-MA + DTS-X and EAC-3, quite exclusively actors close ups in good lighting with clear speech so I can really watch the lips and compare with the sound.
Your latest CE image does better than my usual nigtly (20241109), I can even press āleftā once on the remote to rewind 5 seconds and on some movies is falls in sync (DTS-MA in this case) but not all.
On the nightly, no matter if I play normally or rewind a bit, the lips are always out of sync. 2 frames in 23.976 is 83 ms and thatās usually the amount of audio offset I need to set on Kodi on these samples to get the sync back.
I always remove the audio offset afterwards to not compromise the future tests with new CE images and other various tests.
Kodi have a ābugā in frame skip.
When itās only one frame off it does not fix it. So this 41ms.
So it only adjust if itās Ā±2 frames. But this is because like maybe 15 frames later itās good again, or maybe never.
I did now add a short work around to sync on really the exact frame.
But this maybe lead to āstutterā as much more frames are skipped.
Please test with this new image, watch 20-30s. Then skip backwards when you say itās then in sync. Watch again like 5s, this should be enough.
And same kodi.logā¦
I quickly tested this image which installed and booted fine but I canāt open any of my video files
Selecting a file and pressing play freezes Kodi for about a minute until it comes back like a new launch from boot. The contents of .kodi/temp/ confirms a kodi_crash log. I tested several files and they all make kodi crash. After a few crashes, CE rebooted to a safe mode (I didnāt even know there was one, nice ) and I rebooted back to my CE-NG config.
Youāll find the crash log here kodi_crashlog_20241122203154.log
PS: I have to leave for a few hours and Iāll make myself available again after
No clue if this helps and can apply to CE
Kodi Self-calibration of max audio/video out-of-sync
This is already inside I guess. With TrueHD I have seen a 100ms and 30ms threshold.
I removed the dirty āskipā fix and it should now work again, maybe:
But I will need a new log with this test image, when playback works againā¦
I checked a bit this code and it looks like the latency is hardcoded. Itās number of (video buffer + 1) / frame rate.
Default itās set to 3. So the latency is about 96ms.
So you can play to adjust this value step by step until itās in sync?
It should be found in display settings when in expert mode.
I have been looking around in both the video and audio expert settings for the last half hour and donāt remember seeing it but Iāll look again.
Just going by my eyes and ears the audio is still pretty far off by starting a previously paused video, pausing and playing can bring it in a little bit but it doesnāt always help the first time.
I know this isnāt very helpful in the grand scheme of things because I havenāt uploaded logs but I just wanted to give a seat of the pants impression.
Iāll try to review this thread tomorrow or Sunday to be able to contribute meaningful logs.
I find it really strange that so many people seem to have audio sync issues and others (like me) donāt have any issues.
I donāt know if it has anything to do with it, but Iāve been using this setting in advancedsettings.xml ever since audio rework was done by a couple of developers in Kodi for Android:
<audio>
<maxpassthroughoffsyncduration>50</maxpassthroughoffsyncduration>
</audio>
Initially, I had it set to 96 but after even more rework with regards to the MAT packer, the developerās advice was to set it to 50.
If you donāt set it manually, I believe Kodi tries to determine the required value by itself during the first 30 seconds of playing a video.
I have no clue if this code is also active in CE, but since I never have audio sync issues, I just left it in there.
This was discussed earlier in this thread. As you say, the calculation is (number_of_buffers + 1) / frame_rate
. For a 23.97ā¦fps video though with the default 3 buffers, this does not equal 96ms, but rather 166.8333 ms. This calculation matches the result shown in the player process debug info under latency
. I have checked this against different frame rates and number of buffers.
My setup is CE device ā TV ā eARC ā sound system with CE set to passthrough everything - in theory this should have no lipsync issues due to how eARC works. When I was testing however, the consistent offset I saw was the audio 5 frames late.
From looking at the kodi code, my impression is that kodi is trying to ācompensateā for the latency of the display by shifting output audio to be late compared to the video by a fixed amount of frames. The hdmi standard is very clear on this - this is not how source devices should behave. Valid options to take depend on the Video_Latency
and Audio_Latency
sent by the sink device (i.e, TV) in the edid:
Video_Latency
> Audio_Latency
either:Video_Latency
- Audio_Latency
Video_Latency
< Audio_Latency
, a situation that is strongly discouraged, the source device shall transmit with audio and video streams in sync as per the first point.Any other potential sources of latency (i.e. of the display, different processing modes of the TV, or repeaters (AVRās etc)) are subsequently handled the other devices in the chain - not the source device.
As such, I believe what kodi is trying do is incorrect and would result in the audio being delayed by the shown latency
value. This explains 4 of the 5 frames delay in audio I am seeing.
I think that latency value should be removed entirely from kodiās code. On the code that is currently available, I have tested doing so and it did reduce the audio delays by 4 frames - as expected based on the default 3 buffers.
This has since been removed from kodi. It is not currently in CE.
According to this PR:
The setting is still present, but it defaults to 50 and there is no self-learning anymore. So I guess me setting it manually to 50 has become unnecessary
Here are the new logs
kodi_20241123043114_CE-NG-20241122212602.zip (390.8 KB)
Youāll find :
VidBuf#
is Settings ā System ā Display ā Number of buffers used by graphics driver (Iām always in Expert mode). I can only choose between 2 and 3, defaulting to 3. When this setting was changed, a reboot was performed to get a clean start and unpolluted log.
As requested, the file was played for about 20~30 seconds then a single āLeftā press to rewind 5 seconds and let it play 5~7 seconds more by eye.
Ok, I made some tests with this setting.
When this happened which audio format were you using?
From memory when I briefly tested, I think I was seeing a difference in offsets between formats that could be passed though as RAW
(TrueHD, DTS, eac3, and ac3) and those that couldnāt (pcm and flac formats).
I think the default track on that samples was one that couldnāt be passed through as RAW
- which would be different to all your other samples.
About | FAQ | Terms of Service | Privacy Policy | Legal Notice