Aleksoid1978 / VideoRenderer

Внешний видео-рендерер
GNU General Public License v3.0
1.03k stars 115 forks source link

Framestimes change after resuming playback #60

Closed daddy-cool closed 2 years ago

daddy-cool commented 2 years ago

image As seen in the image, after resuming playback the frametimes sometimes become different and stay that way until I pause/resume or skip ahead 5 seconds.

Tested with MPC-HC 1.9.22 and MPC-BE 1.6.3 using MPC VR 0.6.1.1931

MPC VR Settings: image image Also tested exclusive fullscreen -> same issue Also tested with flip instead of discard -> same issue (could you explain the difference btw?)

Main problem is when the frametimes become like this: image This jitter won't go away unless I pause/resume so everytime I start a movie, pause it, etc I have to check that the frametimes are smooth otherwise I will see jitter/stutter on my OLED - when the frametimes are stable though I have butter smooth playback. Also need to use 120Hz input with wait VBlank, as my OLED's built-in support for 24Hz playback is not stable enough to give me stutter-free 24Hz playback - need to send 120Hz input directly.

MadVR does not have a nice frametime graph like this so hard to compare but from testing with my eyes I can not reproduce this issue with MadVR.

Nvidia Settings: (G-Sync not enabled) image

Any ideas on how to fix this? As the issue goes away/comes back with resuming playback I assume it's not an issue with my settings but maybe I'm wrong and there is an easy fix out there :)

clsid2 commented 2 years ago

Enabling Vertical Sync might help.

daddy-cool commented 2 years ago

You mean in the Nvidia settings? image Tried that, no change really. Setting Vsync in Nvidia to "fast" or "off" doesn't seem to change anything either.

daddy-cool commented 2 years ago

Copy and Paint are always at 0, Present is the one that seems problematic as I can reproduce several "states" of playback where present will behave very differently on the same scene:

Perfect Playback: Present is 1 and fluctuates +-1

"OK" Playback: Present is below 8 and fluctuates +-1

Problematic Playback: Present fluctuates between 0 and 8

As mentioned above, the frametimes for present will stay the same until I pause/resume again so if I hit "Perfect" playback and I don't touch anything I can watch a whole movie without issue. But it works the other way too and if I hit "problematic" playback it will stay that way for the whole movie unless I pause/resume again several times to hit "perfect" playback by random.

Aleksoid1978 commented 2 years ago

It's something specific with 120Hz output. Developers don't have such TV and can't test and do something. What audio renderer use ? Show Filters in MPC-BE when playback.

daddy-cool commented 2 years ago

MPC-BE 1.6.3.0 Filters currently loaded:

MPC Audio Renderer: image

MPC Video Decoder: (tried DXVA2, D3D11, D3D11cb and NVDEC but no changes) image

MPC Audio Decoder: image

Other filters are using default settings.

Aleksoid1978 commented 2 years ago

Try select another audio renderer, system default.

Aleksoid1978 commented 2 years ago

Try without VBlank.

daddy-cool commented 2 years ago

Other audio render -> no change

Disabling VBlank -> MPC VR frametimes are stable and present only shows 0, but now I can't get smooth playback with 120Hz anymore, similar to as if I had bad frametimes in MPC VR before with VBlank enabled. So bad experience but MPC VR seems to think all is fine now

Aleksoid1978 commented 2 years ago

Close ticket until the developers get the appropriate hardware.

clsid2 commented 2 years ago

120Hz means a frame interval of just 8.333 ms, and each video frame repeated 5 times. What is the current behavior when a frame takes longer to present than those 8ms? I assume skip a frame. But that next frame could be a repeat or a "new" input frame. If it is a new one, does it drop it completely (including repeats), or does it reduce the amount of repeats of the new frame, so show 4 times instead of 5. The latter would be the correct way.

daddy-cool commented 2 years ago

I can't see Present ever showing a higher number than 8, even during problematic frametimes.


This is Present fluctuating rapidly between 0 and 8: image Graph indicates frame drops? I'm not sure. This is very straining to watch.


This is Present fluctuating between 7 and 8: image Graph indicates frame repeats? I'm not sure. This is "ok" to watch for most people.


This is Present fluctuating between 0, 1 and 2 - mostly showing Present at 1: image Almost Perfection (I can get it even more flat with enough luck) This is fine to watch for me personally.


All the exact same scene, I just paused/resumed a few times very fast (might take 10 tries, might take 1, very random) to get the different frametime scenarios.

MPC VR doesn't register any dropped or skipped frames either way so I can't tell if I'm having frame drops or repeats, just that I'm seeing not smooth playback whenever the graph is not near-flat.


Btw I can get similar "smoothness" in MPV when I enable display-resample. If you're familiar with MPV source code might be worth a look on how "display-resample" works as it seems to have a stable VSync implementation with 120Hz.

MadVR also works fine as previously mentioned, but many other players/renderers have terrible frametimes with Vsync with 120Hz.

MPC VR being the odd one where it works sometimes and sometimes not, better than never working though since I can keep using MPC VR this way even if it's a bit annoying.

If there is anything else I can do to help let me know, also thanks to both of you for all your hard work so far in keeping Home Cinema alive on Windows.

clsid2 commented 2 years ago

Have you tried with audio bitstreaming disabled?

daddy-cool commented 2 years ago

Yes, no change.

Aleksoid1978 commented 2 years ago

In this situation, you can only help by sponsoring developers on such a TV with 120Hz )