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

Monitor refresh rate fluctuates even with VRR off #5716

Open
kohsine opened this issue Apr 23, 2024 · 20 comments
Open

Monitor refresh rate fluctuates even with VRR off #5716

kohsine opened this issue Apr 23, 2024 · 20 comments
Labels
bug Something isn't working

Comments

@kohsine
Copy link

kohsine commented Apr 23, 2024

Hyprland Version

System/Version info
Hyprland, built from branch  at commit fe7b748eb668136dd0558b7c8279bfcd7ab4d759  (props: bump version to 0.39.1).
Date: Tue Apr 16 16:01:03 2024
Tag: v0.39.1, commits: 4460

flags: (if any)


System Information:
System name: Linux
Node name: kevinarch
Release: 6.8.7-zen1-1-zen
Version: #1 ZEN SMP PREEMPT_DYNAMIC Wed, 17 Apr 2024 15:20:00 +0000


GPU information: 
2d:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] [1002:73bf] (rev c1) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

Bug or Regression?

Regression

Description

My monitor's refresh rate fluctuates from 165 to 141hz. Problem still persists even after turning VRR off.

How to reproduce

Open at least one window and check monitor refresh rate.

Crash reports, logs, images, videos

No response

@kohsine kohsine added the bug Something isn't working label Apr 23, 2024
@vaxerski
Copy link
Member

if this is a regression, please provide a git bisect

generally this is expected to happen if you are looking at the debug:overlay, if nothing changes on screen, no additional frames will be pushed to save resources.

@kohsine
Copy link
Author

kohsine commented Apr 23, 2024

if this is a regression, please provide a git bisect

Will do.

generally this is expected to happen if you are looking at the debug:overlay, if nothing changes on screen, no additional frames will be pushed to save resources.

That makes sense but there's still some strange behavior here. When I disable vrr from my monitor settings the fps in debug overlay maintains a static 165fps. When I enable vrr from my monitor settings the fps in debug overlay starts to fluctuate regardless of what the vrr option in my hyprland config is set to. My understanding of how it should work is that if I have vrr set to off in my hyprland config it should maintain a static 165fps regardless of whether my monitor has vrr set to on or off?

@kohsine
Copy link
Author

kohsine commented Apr 23, 2024

In fewer words, if I have variable refresh rate disabled in the hyprland config my refresh rate should not vary.

@vaxerski
Copy link
Member

that's not how this works

@kohsine
Copy link
Author

kohsine commented Apr 24, 2024

Interesting, why only drop the fps to around 141fps or 85-90%? If nothing changes and power saving is the goal couldn't you drop it far lower?

@kohsine
Copy link
Author

kohsine commented Apr 24, 2024

This can't be right, I've disabled my monitor's VRR fully and the fps shown by debug overlay is now stable... correct me if I'm wrong but Hyprland's fps should be completely independent of whatever the hell my monitor is doing. I'm starting to think this is a mesa driver bug since I noticed sway has the same issue.

@The-Briel-Deal
Copy link
Contributor

This is not the case for me with a 6900xt and lg c2. When VRR is enabled, rr varies, when VRR is disabled, rr stays right at 120.

One problem I have had is vrr staying on until restarting the compositor. Maybe make sure you restart hyprland after enabling vrr?

Also, are you using HDMI or DP. I've definitely had problems similar in the past with HDMI because 2.1 isn't officially supported in amd driver. If thats it get a DP to HDMI 2.1 adapter so that you can use DP output on your card.

@kohsine
Copy link
Author

kohsine commented Apr 24, 2024

@The-Briel-Deal My monitor's refresh rate is fine and follows what you described. The issue I'm having is Hyprland's fps shown by debug:overlay. It remains stable when my monitor VRR is off and fluctuates when my monitor VRR is on which makes no sense to me.

EDIT: I should specify this is with hyprland's vrr option set to off for both.

@kohsine
Copy link
Author

kohsine commented Apr 24, 2024

2024-04-24.00-44-15.mp4

As you can see from the video, my fps in the top left corner is having a field day and going up and down and up and down again. Monitor VRR is enabled and hyprland vrr is set to 0.

@vaxerski
Copy link
Member

that's expected, though yea it should drop far lower, but iirc the overlay itself queues some frames so that it can be up-to-date. You can see that when animation occurs it is back up to speed. I don't see any issues here

@kohsine
Copy link
Author

kohsine commented Apr 24, 2024

Sorry to keep going with this but still not entirely convinced. Sure maybe it should drop but why is it going up and down like that when there is absolutely nothing happening on screen. It should just drop to a steady 140 and back up to 165 during an animation instead of fluctuating like that. I will record again with an earlier version of hyprland (and wlroots) because I'm pretty sure this didn't always happen.

@kohsine
Copy link
Author

kohsine commented Apr 24, 2024

2024-04-24.10-35-27.mp4

Video of Hyprland on v0.35.0. Same exact config and settings as the last video. Monitor VRR is enabled and hyprland VRR is 0. FPS is maintaining a stable 164 fps at all times. At one point it drops to 163 for a second but not a huge deal.

@vaxerski
Copy link
Member

vaxerski commented Apr 24, 2024

it's staying at 165 just because it renders the overlay every frame. If you disable it, the fps will drop likely to 0.

edit: it's also worth noting the fps have nothing to do with your refresh rate

@The-Briel-Deal
Copy link
Contributor

The-Briel-Deal commented Apr 24, 2024

Lol. I am absolutely not the person to ask about this but it seems like this isn't seriously impacting user experience?

Are there any problems in actual usage, or was this just a problem with the frame counter?

@kohsine
Copy link
Author

kohsine commented Apr 24, 2024

edit: it's also worth noting the fps have nothing to do with your refresh rate

Incorrect, I have a VRR monitor so whatever fps is shown on the debug overlay is what my monitor's refresh rate is adjusting to. I can see my monitor refresh rate adjusting live to hyprland's fps.

Lol. I am absolutely not the person to ask about this but it seems like this isn't seriously impacting user experience?

If you don't have a vrr monitor you probably wouldn't even notice. In fact even with a vrr monitor you wouldn't. Maybe some flickering but thats a big maybe. You're right in that end users probably won't notice but I think outputting the correct frames and number of frames should be pretty important to a desktop.

EDIT: Users without a vrr monitor would not experience this issue at all. I know this because when I disable my monitor's VRR the fps maintains a steady 165 fps which is how I am working around this issue now.

@vaxerski
Copy link
Member

if you want to always force your monitor to match 165fps, you can disable vfr, but it comes at a cpu usage penalty, so don't come crying later that hyprland is using 15% cpu at idle

@kohsine
Copy link
Author

kohsine commented Apr 24, 2024

Tried disabling vfr and it's better. Doing nothing it maintains 165fps. It still dips for some reason but definitely a step in the right direction.

How do I re-enable vfr? Tried setting it back to true and removing it entirely but I think it's still disabled. Is there some way to check that I've re-enabled it?

@vaxerski
Copy link
Member

vaxerski commented Apr 24, 2024

if you enabled it, it's enabled

if there are any regressions, always provide a bisect. I still don't really know what the issue is.

@kohsine
Copy link
Author

kohsine commented Apr 25, 2024

if there are any regressions, always provide a bisect.

My mistake. It's not a regression. I checked as far back as release v0.35.0 but the behavior is consistent.

I still don't really know what the issue is.

Monitor VRR Hyprland VRR Hyprland FPS
Enabled 0 141 - 165
Disabled 0 165
Enabled 1 48 - 165
Disabled 1 165

Rows 2, 3, and 4 all seem correct to me. My issue is with row 1. The only difference between row 1 and 2 is my monitor's VRR and the FPS. Is the compositor checking if my monitor has VRR capability and deciding to lower the fps? And for some reason only to 141fps?

These results were also checked without the debug overlay because it inserts its own frames and messes up the real fps.

@vaxerski
Copy link
Member

No clue, that's up to wlroots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants