-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video stutters with vulkan+winvk+interpolation #5296
Comments
Can you upload a log with |
https://xserv.hopto.org/xnor/mpv/logs/log3.txt.bz2 Windowed mode, then fullscreen with focus, then fullscreen without focus, roughly 10s each. |
Try ClockBlocker, it seems AMD's clock adjustment being flawed isn't just limited to Linux, but also Windows. |
In theory, Windows auto detect the best value for "useplatformclock", but anyone can force it. https://www.tweakhound.com/2014/01/30/timer-tweaks-benchmarked/ |
Oh, wow. Curious if that Quite a hack. Normally something you'd only want to use for debugging etc. |
The situation has improved a bit with latest git, but VSync jitter is still 10x higher than d3d11. I think it would help to use Multimedia Class Scheduler Service (AvSetMmThreadCharacteristics) for the relevant threads. The wasapi ao already does this by setting the audio thread to the "Pro Audio" task, though I'm not sure that's even the right choice for a video/audio player. I've exported my Windows 10's multimedia tasks from the registry, in case anyone wants to take a look at the properties of Windows' presets: multimedia-tasks.reg |
The vulkan API currently doesn't offer an accurate way to measure the jitter. |
Frankly, this setting is a bit of voodoo that's probably only really understood by one Microsoft engineer. That being said, it is set to "Pro Audio" here for the simple reason that it is "recommended" by the example code demonstrating exclusive mode. There's also this:
Since we use a 10 ms buffer in exclusive mode (which has been found necessary to avoid inexplicably crappy behaviour such as #1773), we use "Pro Audio". I guess that doesn't justify setting it the same for shared mode other than keeping things simple. If someone can actually demonstrate that this is harmful, I guess we could change it. One such possibility is #3421, which I haven't gotten around to actually measuring. Sorry to completely derail this issue. If anyone wants to take this discussion further, please open a new issue or reopen #3421 if you can demonstrate there is an issue there. |
@kevmitch 10ms buffer? In a video player? That would be crazy. For non latency sensitive playback applications it's typical to use hundreds of ms or even seconds because it drastically lowers the probability of buffer underruns and increases efficiency. @haasn It's hard to believe that. Btw, I've noticed that sometimes when going fullscreen with vulkan there's a bit of extra lag that disables the vsync jitter measurement (?), at least I guess so because mpv-stats disables plotting vsync jitter after that. |
@xnoreq If you're on nvidia drivers, try disabling “Allow Flipping” in the OpenGL settings. |
After a recent update to latest master the initial problem seems to be fixed. @haasn Regarding accurate presentation timestamps have you looked into VkPastPresentationTimingGOOGLE? Example usage: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/demos/cube.c |
Only exists on android |
There's an update on this: WIP: RFC: present-timing: Enhanced presentation timing requests and events WIP: Add the VK_EXT_present_timing extension This is the time to look through the proposed extension/changes and comment on its (in)adequacy for media player like mpv. |
mpv version and platform
Built today from master using lachs0r's build scripts.
Reproduction steps
mpv.com --no-config --vo=gpu --gpu-api=vulkan --gpu-context=winvk --interpolation --video-sync=display-resample
either in window mode or in fullscreen mode when the window does NOT have focus on a high refresh rate display.
When the window is in fullscreen and has focus playback is fine.
Expected behavior
Smooth playback.
Actual behavior
Stuttering, dropped frames, estimated display FPS drops significantly and jumps around a much lower value than the actual display FPS, vsync jitter hovering around .8 to over .9.
Log file
https://pastebin.com/raw/VgetuKda
The text was updated successfully, but these errors were encountered: