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 - fritsch - 2014-08-06

(2014-08-06, 18:07)torcar Wrote: 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...

Yeah that's expected, as I told you before. So - now where is the culprit? :-) vsync, e.g. video driver? AVR that introduces a lag?

@steelman1991: Nope that's not fully correct. He can have delay free playback with vsync enabled but not at 24p.

Thanks for providing that data - but sadly that's what I have expected before and also see with my very own hardware.

Edit: Something else here. Video / Audio is synced back if they go > 200 ms away of each other. So the question now is: where are 200 ms going when the internal watchdog never gets triggered and we think that everything is fine? <- that one needs to be answered. Last time I digged into it, I did not find anything and thought it's some hardware dependend thingy, e.g. TV says: "wait until we have 3 frames == 150 ms and then interpolate something over it to make the picture more brilliant and put it out" :-)


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

@fritsch. Of course my comment was correct in relation to the thread. Don't think anyone has complained of audio sync issues at anything other than 23.976/24 playback.


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

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

One further question: This is with or without the global delay of 200 ms?


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

@fritsch
All testing was done without advancedsettings tweaks.

No global delay for any material or output mode.

After finding that disabling vSync is a workaround I stopped using advancedsettings.


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

@fritsch and FernetMenta is the build provided earlier in the thread still valid for testing of this issue? If so will happily provide logs on my return from holiday on Friday.


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

That's interesting and I cannot reproduce it that way, e.g. vsync does not change that. Do you both have AMD GPUs? Is there by any chance a Triple Buffering setting that can be turned off?

And perhaps - is it possible to boot OpenELEC from an USB stick - the 4.1.x beta please. I don't trust AMD closed source drivers since our heavy fuckup with the xvba acceleration where we have seen a driver in a state that was more than unbelievably bad. That OE image uses free radeon drivers that got their vsync reworked lately.

If that's not possible I can quite understand.


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

(2014-08-06, 19:20)steelman1991 Wrote: @fritsch and FernetMenta is the build provided earlier in the thread still valid for testing of this issue? If so will happily provide logs on my return from holiday on Friday.

Yes - fernet currently is also on holidays but will for sure read that thread after his return. I am currently much too far in real world projects (everyday's work) that I won't be able to provide other testing builds - but gathering most the information we can get we should do.


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

@fritsch

I have a AMD-GPU and a Intel-CPU. (Details in signature)
HPET is also enabled by the way... don't know if it contributes to anything in this case however.


It's been a long time since I used openelec... But I can give it a go as soon as possible.

Is using two USB-sticks and install from the one to the other still the easiest way of creating a temporary openelec stick?


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

Quote:Is using two USB-sticks and install from the one to the other still the easiest way of creating a temporary openelec stick?

Yes that or download the image and dd it over to a stick. Curious on the results, but I think it will be the same. For AMD you need to select VDPAU (yeah was used by the OSS people and is not nvidia only anymore) as Acceleration and for Intel VAAPI.

Thanks in advance.


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

Perhaps the development version with the enhanced debug log should be reposted? I would be willing to contribute. Is the default copy of Gotham with logs sufficient enough?

I am convinced that all of these magic settings are nothing more than a placebo effect. On my set-up both, Linux and Windows display the same problem - even with a usb stick. Eventually, you'll notice that the sync is out on certain program material, while others are not. That is my finding. If I was to guess, I'd blame the TV for not sending correct sync information to the computer, as that is my suspicion.


RE: 24p and audio sync issues - Karnis - 2014-08-10

Following up on my original post, I wanted to get synced playback & smooth video performance across a variety of sources...1080 24p, 1080 30p, and 480p.
Source material was as follows...

Blu Ray MKV 1080 24p rips (all menus removed, movie only):
Man Of Steel DTS HD
Batman Begins Dolby True HD
Black Hawk Down PCM 5.1

Blu Ray MKV 1080 30p rip (input codec lists as 29.97 fps but windowed output is 59.94 fps:
Rush Clockwork Angels DTS HD

1080 30p mp4 videos I shot of my band
480p NTSC band videos AVI converted to mp4

All have perfect audio sync & smooth video playback. The Rush concert in particular has that classic HD "looking out the window" video look. All video looks basically just like my Sony Blu Ray player.

Equipment list as before in my previous post.

Windows 7 Home Premium SP1, Intel HD graphics 9.17.10.2932, HDMI out to Denon 3310 receiver, Sharp 1080p 70"
Dell Inspiron 660, Intel Pentium CPU G2030 @ 3 GHz, 8 Gb RAM (<<< as you can see, fairly unremarkable PC specs)

Display resolution is set to 1920x1080, 59.97 Hz

--------------------------------------------------------------------------

First and foremost, no Windows 7 AERO desktop!

XBMC settings:
Video Playback:
Adjust display refresh rate to match video = on start/stop
3 second pause
Sync playback to display = on
A/V sync method = video clock (drop/dupe audio)

Acceleration:
Render method = DXVA-HD
Decoding method = Hardware accelerated
allow hardware acceleration (DXVA 2) = on

System settings:
video output
display mode = fullscreen
vertical blank sync = always enabled

audio output
audio output device = wasapi-HDMI
enable passthru = on
passthru device = wasapi-HDMI

Finally, XBMC on my system acts like my Sony Blu Ray player, with synced audio & smooth video across a variety of sources. I can assure you, the results are not a placebo.

For my system, disabling Windows 7 AERO desktop were the key factors, along with using the video clock (drop/dupe), which improved 30p video playback. I haven't had any audio glitches, clicks or dropouts yet.

I'd also like to mention I can also play 2K material (Gravity trailer) and 4K (Elysium trailer), but that is more of a driver function than an XBMC function.

Sorry PAL users, I don't have any 50 fps material to test with.

As always, I can only speak for performance & results on my particular system. YMMV

I will mention that my Sharp 1080p HDTV has a mode called "Game" which is straight vanilla monitor setup, no movie mode, no frame doubling to 120 fps, none of that useless crap. Big Grin

I hope this helps others with similar setups achieve improved playback & performance!


RE: 24p and audio sync issues - TRaSH - 2014-08-10

could you add your specs of your HTPC,
perhaps driver version ?


RE: 24p and audio sync issues - Karnis - 2014-08-10

(2014-08-10, 10:11)TRaSH Wrote: could you add your specs of your HTPC,
perhaps driver version ?

Done.


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

I am willing to guess that Game mode on your TV has more to do with you achieving proper sync than disabling Windows Aero desktop. It does nothing for me.


RE: 24p and audio sync issues - Karnis - 2014-08-10

(2014-08-10, 21:47)Warner306 Wrote: I am willing to guess that Game mode on your TV has more to do with you achieving proper sync than disabling Windows Aero desktop. It does nothing for me.

Guess again. Big Grin Wink

I enabled AERO & restarted XBMC while in MOVIE mode on my display. The frame rate in XBMC is cut in ~ half. I scroll through all the available display modes on my HDTV and it has no effect on the current frame rate.

XBMC is reporting 24 fps while on an AERO desktop but its clearly reduced. It's also reporting 0% audio errors.

Turning off AERO & using a regular desktop brings me back to XBMC happy land. I then scroll through all the other viewing modes on my HDTV & they all do their useless marketing hype processing, none of which I use.

I also disable any scaling or processing in my DENON receiver, it's doing straight passthrough.