Intel VAAPI howto with Leia v18 nightly based on Ubuntu 18.04 server
(2015-09-16, 18:15)fritsch Wrote:
(2015-09-16, 17:28)ggp759 Wrote:
(2015-09-16, 15:16)FernetMenta Wrote: the point is that you can't adjust refresh rate to match video to a 100% match.

Ok. Saw you are saying that i should have both options enabled?

No. Sync Playback syncs perfectly the fps to the videoclock. Simplified, whenever we change the front with the backbuffer one fps is displayed. This happens fps count a second. Fully in vsync -> perfect video. Problem here is: If video and audio don't match exactly.

Use case a) The VSync Clock runs at 23.99 fps and not at 23.976 fps -> no problem for video as it is just displayed "a bit" faster -> you won't notice. Cause in perfect vsync 23.99 fps are displayed per second - perfectly matching your screen, just like a clock - always doing: tick, tick, tick e.g. frame, frame, frame - the clock just runs faster as a 23.976 clock would run - no one cares. Problem comes into play, when you have audio. Cause audio and video would go ahead of each other. Therefore one needs to do something when this is happening.

With passthrough audio: we only have two choices drop or dupe and that you can hear very loud if you have bad luck, it makes a famous psssst noise to correct this offset.
Without passthrough audio: We resample a bit and video stays perfectly in sync and you won't even notice anything

=> Reason why you should disable it when you passthrough.

In a perfect world where videos are really exactly 23.976 fps and your refreshrate is really 23.976 hz -> Sync Playback does not harm (even if you passthrough), but it won't be able to help you - as everything is perfect already. And: world is not perfect.

Use case b) You play 59.94 fps content at 60 hz -> vclock "speeds it up" automatically, cause swapBuffers every 1000 / 60.0 ms vs. 1000 / 59.94 ms -> audio needs to be speed up too.
With passthrough: drop samples (ugly, bad experience)
Without passthrough: resample with a factor > 1 - audio will get a little bit higher in tone -> but you won't realize.

Adjust Refreshrate to match video is something else - it tries to find a refreshrate, so that Refreshrate % (modulo) fps == some even non fractional value. 25 fps at 50 hz is fine, 23.976 fps at 23.976 hz is fine. 23.976 at 24.0 hz -> not fine. But with RefClock -> no issue video wise.

So to summarize:
- Use Adjust Refreshrate to match video: good precondition to have the Sync Playback do a nice job afterwards
- Use Adjust Refreshrate to match video: also if you are a passthrough audio user - cause 23.976 fps content + passthrough audio played at 60 hz - won't work without either visual stutter or audio drops.
- Passthrough audio sucks for "perfect playback" as video clock might not match fps exactly, we need to drop / dupe or resync after 200 ms off
- Enable Sync Playback to Display _if_ you don't use passthrough audio as it cares for perfect video while maintaining your audio in sync without you noticing.

Edit: Not covered in here: What happens if you play 24.0 fps content at 60 hz? How would you play 23.976 fps at 60 hz? -> Some wikipedia for the dear user able to read:

Personally: I don't use passthrough audio at all - I have a 5.1 capable LPCM receiver which I feed directly. Since we have dcadec support - I even can decode DTS-HDMA and have perfect audio also in combination with perfect video.

This is great explanation for sure.

I have a suggestion, since the new videoplayer in v17 master cannot do passthough audio with sync playback to display enabled, how about if you enable passthough then sync playback to display is disabled and user notified and the opposite if you have passthough enabled and enable sync playback to display then same thing would happen.

that is if this is the new way going forward that is and it wont change, because I was wondering why only pcm was coming out the speaker, and only a few minutes ago anaconda mentioned this...

Would that be possible and does it make sense to do so? In an Ideal world users woul read the help text, but as you noted its not an ideal world Big Grin

Messages In This Thread
RE: New Era: VAAPI with EGL interoperation - by un1versal - 2015-12-16, 07:14
Live TV broken again? - by schamane - 2016-02-29, 19:56
Random crashes - by hal2100 - 2016-03-08, 22:03