-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Wrong mpv detected refresh rate when fullscreening, with different refresh rate monitors #7932
Comments
Can you post a |
Log of simply fullscreening and unfullscreening mpv |
Unfortunately, I cannot reproduce this issue. Mpv will jump to the correct framerate of the monitor when fullscreen is activated in any arbitrary order on any monitor. |
I can't reproduce this either but mpv logs ( |
Strange, I can reproduce it consistently even on different machines. This is the mpv log starting it in the 144hz output, which mpv correctly recognizes, then fullscreening, where mpv thinks it entered the 60Hz output, and unfullscreening. |
There's at least 1 bug here, possibly two. mpv currently doesn't correctly set the current output when it receives a surface leave. This patch for mpv should fix it: https://0x0.st/HkD_.patch and will probably be upstreamed shortly. However, mpv receives a random surface enter and surface leave on your 60Hz output when you try to fullscreen mpv on the 144Hz which probably shouldn't happen.
This is either a sway bug or user error, hard to say. |
When the mpv surface leaves the output, we no longer mark it as the current output. However, this implicitly depends on there being a preceding surface entrance event to a different output. This is not necessarily the case. Consider moving the window from monitor 1, to monitor 1-2, and then back to 1 again. mpv gets the entrance event to monitor 2 and sets that as the current output to work off of. Then when you move back to only monitor 1, it removes monitor 2 from the current output. However, monitor 1 is not updated again as the current output because there is not a new surface entrance event in this case (the window never left). So the numbers that mpv's core is using are incorrect and for the wrong monitor. Luckily, we already keep track of what outputs the mpv surface is currently on no matter how many there are so it is simply a matter of setting current output again in the leave event if we have a different output that has the mpv surface. Ref: swaywm/sway#7932
@dtop129: You can try mpv-player/mpv#13433 which hopefully should solve the issue for you. Now as for why there would be a behavior difference between different sway versions, I can't say. |
With mpv-player/mpv#13433 the issue is fixed for me |
Thanks for tracking this down @Dudemanguy! |
When the mpv surface leaves the output, we no longer mark it as the current output. However, this implicitly depends on there being a preceding surface entrance event to a different output. This is not necessarily the case. Consider moving the window from monitor 1, to monitor 1-2, and then back to 1 again. mpv gets the entrance event to monitor 2 and sets that as the current output to work off of. Then when you move back to only monitor 1, it removes monitor 2 from the current output. However, monitor 1 is not updated again as the current output because there is not a new surface entrance event in this case (the window never left). So the numbers that mpv's core is using are incorrect and for the wrong monitor. Luckily, we already keep track of what outputs the mpv surface is currently on no matter how many there are so it is simply a matter of setting current output again in the leave event if we have a different output that has the mpv surface. Ref: swaywm/sway#7932
When the mpv surface leaves the output, we no longer mark it as the current output. However, this implicitly depends on there being a preceding surface entrance event to a different output. This is not necessarily the case. Consider moving the window from monitor 1, to monitor 1-2, and then back to 1 again. mpv gets the entrance event to monitor 2 and sets that as the current output to work off of. Then when you move back to only monitor 1, it removes monitor 2 from the current output. However, monitor 1 is not updated again as the current output because there is not a new surface entrance event in this case (the window never left). So the numbers that mpv's core is using are incorrect and for the wrong monitor. Luckily, we already keep track of what outputs the mpv surface is currently on no matter how many there are so it is simply a matter of setting current output again in the leave event if we have a different output that has the mpv surface. Ref: swaywm/sway#7932
Sway Version:
sway version 1.9-dev-a4e85332 (Jan 24 2024, branch 'master')
Debug Log: relevant log
Configuration File:
Description:
The issue doesn't appear in the release version 1.8.1, so there is a possibilty of it being a sway issue.
Also, if I send back and forth the fullscreen mpv window between the two monitors, when going back to the higher refresh rate one mpv detects it correctly.
I couldn't bisect as I had trouble with downgrading wlroots when compiling older sway.
The text was updated successfully, but these errors were encountered: