wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Flickering at 4k 144hz

Open TRPB opened this issue 3 years ago • 6 comments

Describe the bug

When running a monitor at 4k 144hz I get very regular flickering.

Video: https://youtu.be/mR3Ku8zlq1o

This doesn't happen at 60hz.

I also tried Sway, it doesn't happen there so I don't believe it's a wlroots or wayland issue, but specific to Wayfire.

I've tried disabling/enabling adaptive sync (wayfire itself doesn't appear to have an option for this but enabling it the monitor config seems to work)

Wayfire version

0.7.4-0c3621c

It looks like Sway had a similar issue in the past: https://github.com/swaywm/sway/issues/5076 I wonder if Wayfire needs to implement the same fix?

TRPB avatar Nov 19 '22 18:11 TRPB

As noted in https://github.com/WayfireWM/wayfire/issues/1397 this is fixed with WLR_DRM_NO_MODIFIERS=1 I'm not entirely sure what that does but it definitely makes the desktop environment feel less snappy. Less annoying than the flicker though.

TRPB avatar Nov 20 '22 00:11 TRPB

Does it help if you try fiddling with this option?

soreau avatar Nov 20 '22 00:11 soreau

interesting. Thanks! I assume that's in milliseconds? Setting it to 1 fixes it, setting it to 7 (roughly 1000/144), 1000 or -1 the flicker still exists. So it appears that (again assuming it's in milliseconds) a max_render_time lower than the time it takes the display to draw one frame fixes it.

So I'd expect 6 to fix it, it makes it a lot less frequent but still get the occasional flicker.

Does this imply it's dropping some frames then? It doesn't seem to cause a noticeable stutter, even on 0 or 1.

From the description I'd expected that lower values would cause the problem rather than resolve it. I'm curious why 0 doesn't break everything entirely or does Wayfire sensibly just use 1 if it's set to 0?

TRPB avatar Nov 20 '22 02:11 TRPB

interesting. Thanks! I assume that's in milliseconds? Setting it to 1 fixes it, setting it to 7 (roughly 1000/144), 1000 or -1 the flicker still exists. So it appears that (again assuming it's in milliseconds) a max_render_time lower than the time it takes the display to draw one frame fixes it.

So I'd expect 6 to fix it, it makes it a lot less frequent but still get the occasional flicker.

Does this imply it's dropping some frames then? It doesn't seem to cause a noticeable stutter, even on 0 or 1.

From the description I'd expected that lower values would cause the problem rather than resolve it. I'm curious why 0 doesn't break everything entirely or does Wayfire sensibly just use 1 if it's set to 0?

If the option is too low, you may get more latency, that's all.

ammen99 avatar Nov 23 '22 15:11 ammen99

I was having the same issue, tweaking max_render_time solved it, cheers. I have a 165hz monitor, running at 145hz (but same with 165hz), because there is an issue where running it at 165 causes issues where the video card runs at 100%.

With sway, you can do a neat trick where you can set the global max_render_time, and a per window max_render_time. So you can have a lower one for things like your GPU accelerated terminal :rocket:, and one for your browser where it's fine to have a slightly higher.

I had mine set to 6 with sway, my browser to 4, and my terminal to 1.

Maybe a feature request for a window rule would be worth looking into?

joshuataylor avatar Jan 31 '23 07:01 joshuataylor