Kodi Community Forum
24p and audio sync issues - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59)
+---- Thread: 24p and audio sync issues (/showthread.php?tid=80247)



RE: 24p and audio sync issues - FernetMenta - 2014-07-31

(2014-07-31, 21:12)Simkin84 Wrote: so its pathetic they have't figured it out.

those kind of posts are pathetic too Smile

Note that on my Linux system a/v sync is perfect without any delay. Without any users contributing and providing valuable data this probably won't change.
Navigate back in this thread, I have provided a test build with additional debug info but nobody volunteered and provided the data I requested. This is what I call pathetic.
Just complaining won't change things!

P.S. I am on holiday now and might not have a chance to follow this thread for a while. If I don't replay its not that I ignore this thread.


RE: 24p and audio sync issues - Simkin84 - 2014-07-31

(2014-07-31, 21:39)FernetMenta Wrote:
(2014-07-31, 21:12)Simkin84 Wrote: so its pathetic they have't figured it out.

those kind of posts are pathetic too Smile

Note that on my Linux system a/v sync is perfect without any delay. Without any users contributing and providing valuable data this probably won't change.
Navigate back in this thread, I have provided a test build with additional debug info but nobody volunteered and provided the data I requested. This is what I call pathetic.
Just complaining won't change things!

P.S. I am on holiday now and might not have a chance to follow this thread for a while. If I don't replay its not that I ignore this thread.

According to a user back in this thread, this happend on a specific update of Frodo (i believe it was on frodo). so that alone should be something to work on.

Dont get me wrong, i could not ask for a better home theater software, i absolutely love xbmc. and i was not aware of any test build.

Using advancedsettings works fine for me, but it would be nice if it worked without it.


Im using a HTPC W/windows 7 through a Yamaha RX-A2010 receiver.


RE: 24p and audio sync issues - Fade - 2014-08-04

I've been waiting a long time to make the move from Mediaportal to XBMC aka Kodi because the amount of plugins available.

First it took time to get 24p supported, now it's problem with the audiosync. Wouldn't it be time for the XBMC/Kodi team to add an option that let users decide which codecs and filters the application should use? (as in MP)

It would be really nice to be able to make the switch...


RE: 24p and audio sync issues - Warner306 - 2014-08-04

(2014-08-04, 13:23)Fade Wrote: I've been waiting a long time to make the move from Mediaportal to XBMC aka Kodi because the amount of plugins available.

First it took time to get 24p supported, now it's problem with the audiosync. Wouldn't it be time for the XBMC/Kodi team to add an option that let users decide which codecs and filters the application should use? (as in MP)

It would be really nice to be able to make the switch...

Try the DS Player build of XBMC. You can use Reclock and any filters you choose: http://forum.xbmc.org/showthread.php?tid=154534&page=63. Look for my post on how get started (in the provided link).

I don't mention Reclock in the thread, but it can be installed separately and chosen as the default audio renderer from within XBMC. This likely won't make the sync perfect but should improve the situation considerably. Experiment sending PCM audio and bitstream sources. PCM should offer the tightest sync.


RE: 24p and audio sync issues - Fade - 2014-08-05

(2014-08-04, 23:40)Warner306 Wrote:
(2014-08-04, 13:23)Fade Wrote: I've been waiting a long time to make the move from Mediaportal to XBMC aka Kodi because the amount of plugins available.

First it took time to get 24p supported, now it's problem with the audiosync. Wouldn't it be time for the XBMC/Kodi team to add an option that let users decide which codecs and filters the application should use? (as in MP)

It would be really nice to be able to make the switch...

Try the DS Player build of XBMC. You can use Reclock and any filters you choose: http://forum.xbmc.org/showthread.php?tid=154534&page=63. Look for my post on how get started (in the provided link).

I don't mention Reclock in the thread, but it can be installed separately and chosen as the default audio renderer from within XBMC. This likely won't make the sync perfect but should improve the situation considerably. Experiment sending PCM audio and bitstream sources. PCM should offer the tightest sync.

Ah nice thanks, I will give it a try. But I think it's strange that the XBMC/Kodi dev's don't see the problem so it has to be done as an unofficial release. I think this is a core function in the application that the developers should halt everything else and work only on this until it's fixed. A mediacenter should be able to play the most common format there is. film...


RE: 24p and audio sync issues - torcar - 2014-08-05

True... I also think this should be priority nr 1.
However, I don't really think this is a matter of priority for the devs. I think it's simply a matter of expertise.

The best thing that could happen to XBMC imho would be to get a dev that really know the way around this stuff, and I'm still having my fingers crossed Smile

It's really sad that a mediacenter like this is ruined by a bug like this... 24p playback with audiosync is a pretty essential feature the way I see it Wink


RE: 24p and audio sync issues - fritsch - 2014-08-06

Oh my god - i have never seen such an ignorant guy before ...


RE: 24p and audio sync issues - topfs2 - 2014-08-06

(2014-08-05, 11:06)torcar Wrote: However, I don't really think this is a matter of priority for the devs. I think it's simply a matter of expertise.
The best thing that could happen to XBMC imho would be to get a dev that really know the way around this stuff, and I'm still having my fingers crossed Smile

We have multiple devs very very good at this sort of stuff. The problem here is that they aren't getting the logs etc as they have requested. I have my fingers crossed that a user will get of the arse and do the 3 min work requested of them instead of complaining. The devs sink thousands of hours into this, you questioning their expertise without even doing the 3 min work is astonishingly lazy and if I didn't restrain myself I'd ban you for life.


RE: 24p and audio sync issues - Kib - 2014-08-06

I have perfect a/v sync with out any delay on my system.

In the past there was a small issue, I talked to FernetMenta and Fritsch and provided the logs they asked for. Within a few days my specific issue had been identified and fixed.
What would you expect from the guys that basically wrote the entire audioengine...

The best thing that could happen to the development of the audio engine is users that stop complaining and start contributing with logs.


RE: 24p and audio sync issues - torcar - 2014-08-06

@fritsch / topfs2

First and most importantly... I'm very very sorry if I offended any of you guys. That was very far from the intention. Please accept my sincerest apology.

I did not mean to step on any toes or anything and I am not one for complaining about anything anyone does basically for free for a community like XBMC has grown into.
In my line of work the lack of expertise is absolutely not a bad thing... no one can know everything and some things are simply outside of my/our field of expertise. That just means that there's more to learn and ways to make whatever we're working on better with the help of others or by studying the topic more ourselves.

Keep in mind, I may have the wrong impression of the case... I'm not reading every post so I might have missed something from time to time.
However, I have actually sent my own debug logs to devs earlier without being able to pin-point the problem. I also think other have without knowing for sure.

From my position it's impossible to know if XBMC has a dev with this exact field of expertise these days, so I guessed that since the bug is still present this might be the case. No complaints Wink
As I said, I have supplied logs earlier, and I thought that many others also had...
This thread is from 2010 and there are other threads on the same topic also.


But... more importantly and constructive... if this is actually only a matter of the users not doing their part and supplying the devs with what they need we should revive the topic and hopefully solve this year long issue once and for all. Everyone wins Smile
I would not have the least problem with supplying anyone with anything if it could contribute to solving this ever lasting issue for many users.

And again... please accept my honest apology.
(When going downtown later today I will give someone who needs it an extra 20$ in your spirit) Wink


RE: 24p and audio sync issues - fritsch - 2014-08-06

Apology accepted.

24p and passthrough is a real beast. The problem here is that TVs do some interframe calculation when doing 24p in order to make a correct cinema effect, post processing or compensate their cheap hw or something. Currently we don't get a single signal from the GPU on how A/V sync really is - there is no interface to query(*). We only know the sync by the timestamps we have from our renderer and from the buffer (e.g. delay) of the audio. If the hw does anything else internally to compensate whatever needs to be compensated we don't get clue of it.

A second problem is passthrough audio itself. You only have fixed size chunks of audio data, the only chance you have is either "drop" one of them or "dupe" one of them. The first makes clicks and the second is also not perfect.

Concerning the field of expertice: FernetMenta has currently rewritten the complete Audio Engine, which is running on more than 5 different platforms, starting from the Raspberry PI to Quad Core windows 8.1 systems ... we have the expertise, but the above mentioned problems are not easy to fix.

On my personal setup, I have an audio delay of nearly 0 when driving 50 hz and 60hz - I have a 24p delay of 175 ms, a friend of mine has 250 ms. As long as we don't get any knowledge from the hardware about this a/v delay, we cannot compensate.

Good news for this problem is, that this offset is constant per mode(!) - e.g. you can trim it one time and afterwards it's fine. For OpenELEC we ship and advancedsettings.xml which adds 175 ms delay for 24p and 24.0hz since nearly two years now - and average complaints got better.

(*) amd oss radeon reveals that information but it's not implemented in the ALSA kernel driver yet.

If your delay is "changing" over time - then it's another problem and we can probably do something from within xbmc.


RE: 24p and audio sync issues - torcar - 2014-08-06

Thanks for good feedback

I've had a 225ms delay in advancedsetting for 24p material, but as you mention... the delay is changing over time.

I've found a setup that works almost perfect now without advancedsettings tweaking... but it's a workaround, not a fix. And it destroys 50/60hz playback.
In my case that's better since about 99% of everything I view is 24p material.

I use the following settings if I remember correctly:
Adjust display refresh rate to match playback: Enable
Sync Playback to Display: Enable (Delay: 2,5 sec)
A/V Sync method: Audio Clock
Vertical sync = Off
Windowed: Enable
Wasapi passthrough for all sources. (Makes no difference to use directsound)
AERO disabled.

I takes about 5-10 sec for the audio to sync in, but after that it stays on perfect sync.

I've tested many many combinations of settings but these are the only settings that actually fixes the problem. Why? I have no idea Wink But I'm sure you have Wink


RE: 24p and audio sync issues - fritsch - 2014-08-06

Quote:Vertical sync = Off

This does not make sense - as we want to guarantee that exactly the amount of swap buffers is met that refreshrate is giving us. You mean "Adjust Refreshrate to match video" right above?

a) Can you try what happens with: vsync turned on, method video clock and resample audio? - you need to disable passthrough completely for this test. Is that better or the same bad?
b) Can you try: vsync enabled, "Adjust refreshrate to match video" disabled(!), Sync Playback to Display enabled with method video clock and resample audio?

Thanks for the feedback.

Aero does triple buffering which is hard to get in sync if the video clock is using swapbuffers as a measure.


RE: 24p and audio sync issues - torcar - 2014-08-06

Just did a quick test with a 24p file I know is in sync.

First, current settings:

System->Video Output:
True Fullscreen: Enabled
Vertical Blanc Sync: Disabled

Video->Playback:
Adjust display refreshrate to match video: Always (Pause 2,5sec)
Sync Playback to display: Enabled
AV Sync method: Audio Clock

Decoding method: Hardware
DXVA2: Enabled

With these exact settings and a freshly started XBMC (Jerky after 1+ day) I get perfect sync on 24p material.

If I change only Vertical Blanc Sync to: Enabled, I get about 200 +/- ms out of sync.


So for your requests:

(a)
vsync turned on, method video clock and resample audio.
Result: about 200ms out of sync

(b)
vsync enabled, "Adjust refreshrate to match video" disabled(!), Sync Playback to Display enabled with method video clock and resample audio
Result: Perfect sync, but more jerky playback because the output stays at 60hz.

And to confirm I changed everything back to the settings I used before testing (vSync disabled, passthrough enabled etc) without restarting XBMC and the playback is back in perfect sync.
Menu items etc gets jerky due to not syncing every frame, but playback @24p is perfect.

Screenshot from playback with my "original" settings: https://drive.google.com/file/d/0B-l40sDtuNJXbWN4NWYyUUdPU0k/edit?usp=sharing
No drops etc...


RE: 24p and audio sync issues - steelman1991 - 2014-08-06

(2014-08-06, 17:06)fritsch Wrote:
Quote:Vertical sync = Off

This does not make sense - as we want to guarantee that exactly the amount of swap buffers is met that refreshrate is giving us. You mean "Adjust Refreshrate to match video" right above?

a) Can you try what happens with: vsync turned on, method video clock and resample audio? - you need to disable passthrough completely for this test. Is that better or the same bad?
b) Can you try: vsync enabled, "Adjust refreshrate to match video" disabled(!), Sync Playback to Display enabled with method video clock and resample audio?

Thanks for the feedback.

Aero does triple buffering which is hard to get in sync if the video clock is using swapbuffers as a measure.

To confirm Torcar's findings I reported this earlier in the thread. Switching off vsync provides perfect audio playback - no need for latency adjustments, though obviously introduces screen tearing. Switching on rids playback of tearing but introduces audio latency issues.