GhostNaN/mpvpaper

mpvpaper dropping entire frame

Closed this issue · 9 comments

Often times when mpvpaper will drop the entire frame for no reason few second after it's running. Is the video file too big for mpvpaper to handle? (~50mb) or is there incorrect Wayland configuration? (like kernel config) Restarting mpvpaper can fix the issue but then again I have to kill mpvpaper and start mpvpaper many times before it can run just fine
Just for testing since mpvpaper uses mpv, I ran the video on mpv and mpv has no issue playing the video

V: 00:00:00 / 00:00:19 (3%)[*] MPV is ready to render the next frame for eDP-1
[*] MPV is ready to render the next frame for eDP-1
[*] MPV is ready to render the next frame for eDP-1
[*] MPV is ready to render the next frame for eDP-1
V: 00:00:03 / 00:00:19 (17%) Dropped: 174
[*] Exiting mpvpaper
[!] Failed to quit mpv

Often times when mpvpaper will drop the entire frame for no reason few second after it's running.

This looks exactly like the issue I saw when I was experimenting with getting the NVIDIA GPU proprietary driver to work.
Although, I thought I was able to work around that issue with this: 408092d
One thing is clear, because of the "Failed to quit mpv" error.
That means the render loop must of got stalled and it's likely that there's more to do on how the polling is done.

Is the video file too big for mpvpaper to handle?

No.
In almost all cases if it can run on mpv normally, it should run about the same with mpvpaper.

or is there incorrect Wayland configuration? (like kernel config)

I have no idea what you are referring to, but it's very unlikely the kernel is involved.

I need more info.
What GPU and driver are you running?
Are you sure you are running the latest version or master branch?
What WM (Window Manager) or DM (Display Manager) are you using?

Sorry for not providing system info before, and yes I am currently using the latest version of mpvpaper (as of the day I report)
OS: Arch Linux
Kernel: 6.9.7-arch1-1
GPU: NVIDIA GTX 1660Ti Mobile
WM: Hyprland

I can't seem to replicate this issue on a laptop that has a NVIDIA GPU.
I sort of understand why it's happening, but it's hard to find a fix or even a workaround when I'm flying blind here.
NVIDIA pro drivers have always been troublesome because how they differ from the open source ones.

With all that being said I may have found a fix that I would like for you to try.
Please compile and run below:
mpvpaper_fix.zip
I added wl_display_prepare_read() and wl_display_cancel_read() per instructions from:
https://wayland.freedesktop.org/docs/html/apb.html#Client-classwl__display_1a30a9c4f020f3e77581c7a81ecdb4913d

Also just curious, is this only happening to 1 video or all the videos you play?

Still same. Although I wanna blame Hyprland because it run just fine until I start moving my mouse, that's when mpvpaper start to dropping frames. Tried on other videos, also same result
Can't make a video how it happen atm because my portal is a little broken

Although I wanna blame Hyprland because it run just fine until I start moving my mouse

The good news is that's easy to test.
You could run Hyprland with a near blank config.
Or try running Sway, as that is also wlroots based.

That way you could see if it's a setup issue or a WM issue.

So I tried using Sway with default config, and mpvpaper runs just fine with no drops. Meanwhile Hyprland with also default config still have this frame dropping issue on mpvpaper

I was able to replicate the issue by running mpvpaper with prime-run on Hyprland.
It took a while, but I believe this is now solved with this commit: ec48b98

Go ahead and compile from master and report back please.

Okay, seems like the new commit fixed the issue on Hyprland

Glad to hear that!

Hopefully that's the last I'll hear of NVIDIA cards not working...