Bug 335330 - Screen flickering after Triple buffering detection: "NOT available"
Summary: Screen flickering after Triple buffering detection: "NOT available"
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: scene-opengl (show other bugs)
Version: 5.1.95
Platform: Exherbo Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-25 10:22 UTC by Bernd Steinhauser
Modified: 2022-11-12 15:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Output of glxinfo (56.87 KB, text/plain)
2014-05-25 10:25 UTC, Bernd Steinhauser
Details
qdbus org.kde.KWin /KWin supportInformation (4.47 KB, text/plain)
2014-05-26 18:54 UTC, Bernd Steinhauser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Steinhauser 2014-05-25 10:22:56 UTC
So this one is a bit tricky. When I start a fresh kwin session, everything works as expected, there is no flickering, tearing. However, after some time (sorry, couldn't find an exact way to trigger), on focus changes, it starts flickering. It looks a bit like some sort of race condition, where the focus between two windows changes back and forth very fast a few times until it eventually settles.
Sometimes, it was triggered by the screensaver (blanking of the screen after some time), but not every time.
This issue is gone (until triggered again) when switching the rendering backend or restarting kwin. It happens with both the 2.0 and the 3.1 rendering backend¹. Haven't tried the XRender backend, but if that would be interesting, I can try.
Without compositing, I haven't observed such behaviour.

¹ When using the 3.1 backend, I still get the message that it's using OpenGL 2?

Initialization information:
Initializing OpenGL compositing
Drawable visual (depth  24 ): 0x "210"
Drawable visual (depth  32 ): 0x "6d"
Buffer visual (depth  24 ): 0x "212"
Direct rendering: true 
Color correction: false
OpenGL 2 compositing successfully initialized
Vertical Refresh rate  60 Hz

Reproducible: Sometimes
Comment 1 Bernd Steinhauser 2014-05-25 10:25:53 UTC
Created attachment 86811 [details]
Output of glxinfo
Comment 2 Martin Flöser 2014-05-26 06:24:16 UTC
Could you please run KWin from a terminal and check the output for:

"Triple buffering detection"

when the problem arises. If you see something like that, please paste the 
debug output of that line into the bug report.

Please also provide the output of:
qdbus org.kde.KWin /KWin supportInformation
Comment 3 Bernd Steinhauser 2014-05-26 18:51:46 UTC
(In reply to comment #2)
> Could you please run KWin from a terminal and check the output for:
> 
> "Triple buffering detection"
> 
> when the problem arises. If you see something like that, please paste the 
> debug output of that line into the bug report.
Triple buffering detection: "NOT available"  - Mean block time: 5.60969 ms
Comment 4 Bernd Steinhauser 2014-05-26 18:54:48 UTC
Created attachment 86837 [details]
qdbus org.kde.KWin /KWin supportInformation
Comment 5 Thomas Lübking 2014-05-26 18:55:52 UTC
The output will occur unconditionally - the interesting question is whether it occurs coincidental with the prooblem (ie. no problem before detection, but arises after)

Can you prevent the problem by

export KWIN_TRIPLE_BUFFER=1
kwin --replace &

?
Comment 6 Bernd Steinhauser 2014-05-26 20:52:47 UTC
(In reply to comment #5)
> The output will occur unconditionally - the interesting question is whether
> it occurs coincidental with the prooblem (ie. no problem before detection,
> but arises after)
Well, this is the only time I got that message, afaics. It was one of the last lines when the problem first occurred in this session, so I think it's correlated.

> export KWIN_TRIPLE_BUFFER=1
> kwin --replace &
Will try tomorrow.
Comment 7 Bernd Steinhauser 2014-05-30 11:58:23 UTC
(In reply to comment #6)
> > export KWIN_TRIPLE_BUFFER=1
> > kwin --replace &
> Will try tomorrow.
Ok, so I tried with KWIN_TRIPLE_BUFFER=1 for a couple of days and didn't observe and flickering anymore, so that seems to work around the issue.

On a related note, I get similar (but not quite the same) issues when switching the platform interface to EGL (which doesn't work that well over here) and back to GLX again.
Then the compositor goes berserk, shows lot of flickering and some areas are not or not properly updated anymore.

This goes on until vsync is deactivated. (Backend change doesn't help here)

Don't know if that is a different issue or if the two are related.
Comment 8 Martin Flöser 2014-05-30 12:37:01 UTC
> Ok, so I tried with KWIN_TRIPLE_BUFFER=1 for a couple of days and didn't
> observe and flickering anymore, so that seems to work around the issue.

hmm, I think I need to try that :-)
> 
> On a related note, I get similar (but not quite the same) issues when
> switching the platform interface to EGL (which doesn't work that well over
> here) and back to GLX again.
> Then the compositor goes berserk, shows lot of flickering and some areas are
> not or not properly updated anymore.

I can confirm that, experienced that as well. I do not think that they are 
related, but might indicate that we either do not tear down the egl backend 
correctly or need to restart KWin when switching the interface.
Comment 9 Bernd Steinhauser 2014-06-05 18:59:35 UTC
Actually, this problem went away completely now, even without exporting KWIN_TRIPLE_BUFFER=1 as suggested above.
Unfortunately, I can't tell you if the update of Mesa (10.1.3 -> 10.1.4) fixed it or some commit in KF5/kwin.
Anyway, I didn't observe this anymore, so feel free to mark as fixed.
Comment 10 Thomas Lübking 2014-06-05 19:15:17 UTC
Do you have 902e424f8171719a07f6376a9b1ebe47ecb322b0 ?
Comment 11 Bernd Steinhauser 2014-06-05 19:29:16 UTC
No, the currently installed and used id is 0bf9ed5317540eb14c8d0a1554471ba6cbd42b9f.
Comment 12 Bernd Steinhauser 2014-06-05 19:43:06 UTC
On a second glance, I noted that I was running kwin with vsync turned off for the last few days. Let me try git master with vsync set to automatic again and see what happens.
Comment 13 Bernd Steinhauser 2014-06-07 08:56:55 UTC
Ok, so at abe620 I still observe this unless setting KWIN_TRIPLE_BUFFER=1 or disabling tearing prevention.
Comment 14 Justin Zobel 2021-03-10 00:12:28 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 15 Bernd Steinhauser 2022-11-12 15:07:20 UTC
I do still see some flickering in kwin, but I don't think it's related to this bug, so closing this as resolved.