Skip to content
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

mpv: Prevent blocking in the render update callback for vo=libmpv #982

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tsukinaha
Copy link

@tsukinaha tsukinaha commented Sep 29, 2024

According to the documentation, setting video-timing-offset to 0 prevents blocking during render updates.
This has a noticeable effect on improving the software frame rate on wayland.

photo_2024-09-29_07-52-03

@gnome-mpv
Copy link
Collaborator

I'm not sure this should be the default. Wouldn't it make frame timings worse in some cases?

@tsukinaha
Copy link
Author

I'm not sure this should be the default. Wouldn't it make frame timings worse in some cases?

By default, the render update callback blocks the UI thread for 0.05 seconds during rendering. We really shouldn’t be blocking the UI thread like that.

It works fine on my machine and even helps reduce frame drops. But you’re right, it probably does need more testing.

@Kimiblock
Copy link

Tested on a laptop with 240Hz screen. Celluloid went from under 60 FPS to 230-240 FPS.

@gnome-mpv
Copy link
Collaborator

After some more testing, I noticed that these options cause a small amount of AV desync (around 0.0002s). From my reading of the documentation, I think we're supposed to time the call mpv_render_context_render() ourselves to eliminate the desync. Once that's done, it should be okay to merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants