tildearrow / kwin-lowlatency

archived - X11 full-screen unredirection and lots'a settings for KWin
373 stars 10 forks source link

5.19.0 - Huge latency with blur #85

Closed rnd-ash closed 2 years ago

rnd-ash commented 4 years ago

This happens with either NVIDIA or Intel

Steps to reproduce

  1. Set compositor to even lower latency
  2. Drag some windows round - Notice how the cursor follows the window border - good low latency
  3. Open up a konsole window with a blurred background
  4. Drag windows round now. There is a huge latency discrepancy between cursor position and window position.

Symptoms happening in step 4 happen EVEN if the blurred window is in the background and obscured!

tildearrow commented 4 years ago

Reopening. Let's work on this when I get off the bed.

rnd-ash commented 4 years ago

Lol

tildearrow commented 4 years ago

Please test the latest commit to the Plasma/5.19 branch. It contains some debug code to check what is going on.

Launch KWin manually (see HACKING.md for instructions on this). It will print lpf: <time> in the console for every frame.

Tell me whether lpf: gets stuck on lpf: 0 or something like that.

rnd-ash commented 4 years ago

When dragging a window round with konsole open i get only "lpf: 1"

If i have a konsole window open on the screen, I get loads of this:


lpf: 2000
lpf: 2000
lpf: 2000
lpf: 2000
lpf: 2000
lpf: 2000
lpf: 764
lpf: 2000
lpf: 765
lpf: 2000
lpf: 765
lpf: 2000
lpf: 766
lpf: 2000
lpf: 766
lpf: 2000
lpf: 767
lpf: 2000
lpf: 767
lpf: 767
lpf: 2000
lpf: 2000
lpf: 768
lpf: 2000
lpf: 769
lpf: 2000
lpf: 769
lpf: 2000
lpf: 769
lpf: 2000
lpf: 770
lpf: 2000
lpf: 770
lpf: 2000
lpf: 2000
lpf: 2000
lpf: 2000
lpf: 772
lpf: 2000
lpf: 772
lpf: 772
lpf: 2000
lpf: 2000
lpf: 773
lpf: 773
lpf: 2000
lpf: 2000
lpf: 774
lpf: 2000
lpf: 775
``
tildearrow commented 4 years ago

Hmm... Is it possible for me to know what are your graphics cards and the [Compositing] section of your kwinrc? (it is located at ~/.config/kwinrc)

rnd-ash commented 4 years ago

This happens when both my intel card (UHD 630 coffee lake), and GTX 1060

[Compositing]
LatencyControl=3
OpenGLIsUnsafe=false
UnredirectFullscreen=false
tildearrow commented 4 years ago

Default values... hmm...

rnd-ash commented 4 years ago

After more experimenting, it appears the issue is fixed when using my NVIDIA GPU, however when using the Intel GPU, its still very bad, i can get a slow mo screen record if its of any use (My laptop screen is 144hz)

ZaWertun commented 4 years ago

After more experimenting, it appears the issue is fixed when using my NVIDIA GPU, however when using the Intel GPU, its still very bad, i can get a slow mo screen record if its of any use (My laptop screen is 144hz)

I see very similar slowdowns on old NVIDIA card (using 340.108 driver). FPS drops to ~30 from 60. After disabling blur - all is OK.

tildearrow commented 4 years ago

It appears this could be a performance problem...

tildearrow commented 4 years ago

Did this happen before 5.19 or not?...

ZaWertun commented 4 years ago

Yep, I have this problem long ago 5.19 (on vanilla kwin too). For me it looks like hardware or/and drivers problem. Plus I don't think it's worth to support such old hardware as my nvidia card on 340.x driver :)

tildearrow commented 4 years ago

This seems like a performance problem. KWin-lowlatency auto-adjusts the latency depending on performance, in an attempt to avoid halving the frame-rate.

ZaWertun commented 4 years ago

Looks like things get better after update to 5.19.1 and using blurry window (konsole). @rnd-ash Could you test version 5.19.1 on Intel?

tildearrow commented 3 years ago

Apparently I found out what is causing the issue.

When a blurred window is around, the compositor decides to repaint the whole screen instead of just the damage region. This is more expensive and therefore introduces latency (to ensure it won't stutter). I would have to see if there is a way to blur without having to do a full repaint...

rnd-ash commented 3 years ago

Wouldn't this require a patch to upstream kwin? - rather than patching kwin-lowlatency

tildearrow commented 2 years ago

Apparently in 5.22/5.23 blur no longer repaints the entire screen, at least in some testing I did. Marking as fixed.