Bug 331720 - vsync doesn't work until setting is changed and compositing disabled/enabled
Summary: vsync doesn't work until setting is changed and compositing disabled/enabled
Status: RESOLVED DUPLICATE of bug 322060
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 4.11.6
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-04 04:55 UTC by Philip Sequeira
Modified: 2014-03-06 20:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Sequeira 2014-03-04 04:55:34 UTC
When I first log in, I experience tearing, even though I have vsync enabled. If I change the vsync type option, apply it, and then disable and re-enable desktop effects, the tearing goes away.

Maybe there is some code that is run when changing the vsync type that should also be run when kwin initially starts up, but isn't for some reason.

Reproducible: Always

Steps to Reproduce:
1. Log in.
2. Observe tearing.
3. Change System Settings -> Desktop Effects -> Advanced -> OpenGL Options -> Tearing Prevention (VSync) option.
4. Disable desktop effects.
5. Re-enable desktop effects.
6. Observe that tearing is gone.
Actual Results:  
There is tearing.

Expected Results:  
As I have vsync enabled, there should not be tearing.

GeForce GTX 670
NVIDIA proprietary driver version 331.49
Comment 1 Thomas Lübking 2014-03-04 09:30:01 UTC
Please post the output of:
   grep -i triple /var/log/Xorg.0.log
and
   cat /proc/`pidof kwin`/environ

See bug #322060
There seems a redetection error about the availability of triple buffering, so you might end up with vsync *invalidly* being enabled.
Comment 2 Philip Sequeira 2014-03-04 17:04:32 UTC
The grep command yields no output.

kwin's environ:
XDG_VTNR=7
SSH_AGENT_PID=436
XDG_SESSION_ID=1
DM_CONTROL=/var/run/xdmctl
GPG_AGENT_INFO=/tmp/gpg-079kbg/S.gpg-agent:439:1
SHELL=/bin/zsh
XDM_MANAGED=method=classic,auto
GS_LIB=/home/qmega/.fonts
GTK_MODULES=canberra-gtk-module
KDE_FULL_SESSION=true
USER=qmega
XCURSOR_SIZE=0
SSH_AUTH_SOCK=/tmp/ssh-3wxAMquR42L5/agent.435
PAGER=less
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/vendor_perl:/usr/bin/core_perl
MAIL=/var/spool/mail/qmega
DESKTOP_SESSION=kde-plasma
HG=/usr/bin/hg
PWD=/home/qmega
JAVA_HOME=/usr/lib/jvm/java-7-openjdk
EDITOR=emacs --maximized
KDE_SESSION_UID=1000
LANG=en_US.UTF-8
SSH_ASKPASS=/usr/bin/ksshaskpass
HOME=/home/qmega
XDG_SEAT=seat0
SHLVL=1
KDE_SESSION_VERSION=4
XCURSOR_THEME=Adwaita
LESS=iMR
LOGNAME=qmega
VISUAL=emacs --maximized
XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ms0gIsGmBO,guid=2cca3f010c73980fe9dbcf945314bba5
LESSHISTFILE=/dev/null
WINDOWPATH=7
DISPLAY=:0
XDG_RUNTIME_DIR=/run/user/1000
QT_PLUGIN_PATH=/home/qmega/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/
XDG_CURRENT_DESKTOP=KDE
_=/usr/bin/kwrapper4
SESSION_MANAGER=local/albatross:@/tmp/.ICE-unix/496,unix/albatross:/tmp/.ICE-unix/496
LANGUAGE=
Comment 3 Thomas Lübking 2014-03-04 17:45:23 UTC
see dupe.
activating vsync is actually a bug (improper redetection after reconfigure)
do you get "higher" cpu load with working vsync (and no triple buffering nor usleep yielding)?

*** This bug has been marked as a duplicate of bug 322060 ***
Comment 4 Philip Sequeira 2014-03-06 17:20:31 UTC
kwin uses very little cpu power when vsync is working, but I haven't checked it when broken to compare; I'll do that when I get a chance.
Comment 5 Philip Sequeira 2014-03-06 20:16:49 UTC
No perceptible difference in cpu load between before and after.

Using usleep yielding (through a script in ~/.kde4/env) does workaround the problem for me, and doesn't seem to cause any more cpu load, at least as far as I can tell; haven't tested extensively. I'm going to keep that for now, so I'll report if I notice any problems.

By the way, issue still exists on kwin 4.11.7 and nvidia driver 334.21.

(Sorry for posting in the dup bug, if that's not what you wanted me to do. I'm just replying here because you asked here. I'll post in the main bug in the future if anything changes.)
Comment 6 Thomas Lübking 2014-03-06 20:19:47 UTC
If at all, yielding usleep is supposed to lower the CPU load (for double buffering)
It's ok to post to the bug, it's yours ;-)