My mistake, new link
For that file I am seeing the audio ~4 frames late for me. While skipping around, I think I was seeing small variations in the offset - but at most +/1 one frame. Personally, I found it harder to judge the audio delay with the three rapid beeps in that sample.
You will make a kodi.log with last test image.
Enable video and video/audio timing component!
Hi,
Iām also affected by the delay in audio on my DuneHD but because of this thread, I spent a lot of hours to test and give an accurate report of the behavior Iām observing.
Preamble: The day to day use of CE-NG is fine and nothing wrong ever occurred. But, trying to watch a 4K movie with HD audio (DTS-MA/X, DolbyTrueHD/Atmos) shows a delay in audio since the start of the file and no seeking back and forth changes anything. I manually compensated the audio delay with Kodi for each movie, especially noticeable on close up speeches where the lips are off with the audio. The compensated delay was different from movie to movie but now I know why! This is a frame induced delay which of course is related to the movie frame rate (23.976, 24, 25 and 50 FPS) and thereās no relation to the audio format either (HD or lossy)
Here are the findings :
- CE-NG (nightly 20241109) or test image posted in post Kodi Audio Out of Sync playing file or after seeking - #139 by Portisch makes no difference
- As my DuneHD is connected through a Denon AVR, Iāve tested the audio output from the AVR and via bypass as the TV āSpeaker selectionā allows to select TV or AVR for the audio output. In direct mode the AVR identifies and decodes the audio (TrueHD, DTS-MA, EAC3, AC3, PCM) and in TV bypass mode, the AVR show āunknownā as audio and the sound comes out of the TV. This makes no difference. The AVR isnāt the culprit and does not induce any delay
- Iāve tested the samples from :
- Kodi Audio Out of Sync playing file or after seeking - #90 by R3S3T_9999
- Video Audio Sync Tests @ 23.98, 24, 25, 29.97, 50 & 59.94
- Spears and Munsil extracted MKV files for audio sync
- Disney - Word of wonder - audio sync video files
- https://www.avsforum.com/threads/hdr10-test-patterns-set.2943380/
and they all display the same behavior constantly across all sources
Conclusion:
- If the video file is 1080p there is no delay no matter what the audio format is
- If the video file is 2160p there is a delay no matter what the audio format is and no matter the video format (SDR, HDR10, DV)
- The delay is almost always -2 frames and sometimes up to -4 frames when cycling through the multiple audio tracks of files from post #90 by R3S3T_9999. Seeking back to position 0 sets back to -2 frames again.
So, thereās a bug of some sort causing the audio delay when using 4K files
ā EDIT ā
On the same system (TV + AVR) I have my old NUC running LibreELEC running the exact same Kodi version and config as the DuneHD (except x86 and no HDR support whatsoever). Iāve run the exact same tests and thereās no delay anywhere, everything is perfectly in sync all the time no matter what.
Because of frame switchingā¦ Not sure if LE support it. And other hardware then AML is useless test anyway.
Where is a Kodi.log?
I tested on LE with another platform to make sure the delay isnāt induced by the AVR or the TV
Hereās the log with audio/video timing component - https://paste.coreelec.org/RabbitSparring
I rebooted, played the file and let it run its course until the end.
Useless againā¦
I did told all to use the test image, multiple times.
The nightly does not include all fixes.
Oops sorry! I used the latest image during my tests and the results were exactly the same from my point of view but I suppose that from your point of view (detailed logs) it would show up valuable information.
Iāll redo the log a bit later, for now I have an errand to run
I think fixing audio sync issues can be a bit like shooting fish in a barrel. Some will probably be fixable whereas others wonāt. There can be so many variables in the chain. I once owned an Apple TV with Yamaha amp and LG E6 tv. Everything was fine. I changed my amp and I started to get lip sync issues on 4k material only. And this was Apple TV specific, other sources were fine. I then changed my TV and everything was fine again.
Which device was to blame? Where do you even start with this?
I agree that the sync issues in general have a multitude of factors. However, in this case the main issue is that the sync difference changes based on playback behavior. For example, seeking backwards may change the current a/v sync by + or - 1 frame. Or multiple frames. And then seeking again will change it further. This is not the same as audio being delayed by the processing of your AVR or TV, as that would be fairly consistent I believe.
Agreed but some of the other posts have drifted into murkier territory.
Hello @Portisch, Iām back again and a (hopefully) correct log this time
kodi_20241122003132_CE-NG-20241118142641.log
On CE-NG-20241118142641 the delay is slightly worse at -4 frames (was -2 on CE-NG-20241109)
20241118142641_kodi.log (3.1 MB)
Uses the TrueHD track of audio_sync1.m2ts
which had been made available to you. Results while playing are as previously described
I donāt know yet what is different but something is.
It should not be possible to have a diff more than 50ms. Also I miss a log line. Next weekā¦
I have an idea what could be wrong but I need more debug log with the new test build please: 258.53 MB file on MEGA
Enable video and video/audio timing component!
Then cat /storage/.kodi/temp/kodi.log | paste
should do the trick to upload log.
This new build has solved the difference in offsets I was seeing between TrueHD and other audio tracks.
On Audio_Video_Sync_23.976_TEST TrueHD DTS-HD DDP DD PCM.mkv
, I tested the TrueHD, DTS, DD+, and AC3 tracks. The audio offsets now all look the same to me visually and werenāt varying between playbacks or when skipping.
Also tested with 05. Audio-delay-test-v5_23.976.mkv
, offset was the same as the previous file and wasnāt varying between playbacks or skipping either.
Here is the new log kodi_20241122121414_CE-NG-20241122085304.log
That sounds really promising! Iāve not been in a position to help out with testing so appreciate everyoneās efforts with this. Iāve been seeing av sync issues with regards to HD sound formats when skipping and sometimes when coming out of pause. True HD / Atmos was more glitchy than DTS-HD formats. Looking forward to trying this out over the weekend and happy to send in some logs if I encounter issues.
Did it play at all?
If yes I donāt think you enabled the video and video/audio sync component in logging.
Also please share this sample for tests.
Yes it played, still with -2 frames sync though.
And I selected audio/video sync component in logging. In fact, this was the only component selected.
The sample is this one posted by R3S3T_9999 earlier at post #90. I just renamed the file to my own naming scheme.
If you need other tests and other logs, just ask.
ā EDIT ā
In the log, the file is PhotoJoseph - AVSync - 23.976 - 4K HEVC DTHD DTSMA EAC3 AC3 PCM FLAC.mkv
starting at mark 2024-11-22 12:10:39.522
in case youāre wondering.