Bug 229863 - Desktop V-Sync not working properly with NVIDIA based GPU's afecting all KDE 4 releases (up to SC 4.4)
Summary: Desktop V-Sync not working properly with NVIDIA based GPU's afecting all KDE ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 229990 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-07 19:32 UTC by Fjtorsol
Modified: 2010-11-27 16:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
V-sync bug explanatory image (946.54 KB, image/png)
2010-03-14 14:44 UTC, Fjtorsol
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fjtorsol 2010-03-07 19:32:02 UTC
Version:            (using KDE 4.4.1)
Installed from:    Ubuntu Packages

Since KDE 4 first release V-Sync has not worked properly, a half of the desktop, the top part, is not verticaly synchronized causing strange lag and tearing effects in the afected area of the screen. This bug happens even with video playback, making it unwatchable in most of cases. The afected hadware seems to be NVIDIA based GPU's and the tested resolution was 1440x900. All NVIDIA driver releases were tested up to 190.53. The tested hadware worked properly with desktop V-Sync enabled under Gnome (enabled with Compiz V-Sync setting), Windows Vista (enabled by default with Aero), Windows 7 (enabled by default with Aero) and Mac OS X (enabled by default with BeamSync).
Comment 1 Thomas Lübking 2010-03-07 20:19:41 UTC
please provide your settings for:
- "nvidia-settings -q SyncToVBlank"
- kwin: "Use VSync"
- kwin: "Enable direct rendering"

and regarding the viseoplayback your vidoe output (x11, xv, xvmc, xover, vdpau, sdl - try with mplayer in doubt for full control and information)

also please ensure that this is not caused by some plugin, i.e. check whether the problem remains with activated composition, but all plugins disabled
Comment 2 Fjtorsol 2010-03-07 20:30:32 UTC
I did not enable SyncToVBlank in NVIDIA settings window I just used default settings but even when it is enabled the bug stills there and the sync issues for video playback dissapear when I disble VSync in KDE appearance options, so the KDEWin VSync seems to be the buggy thing.
Comment 3 Thomas Lübking 2010-03-08 16:38:16 UTC
would you prettyplease consider checking whether the problem only exists for videoplayback using xv and not for gl output from e.g. the xscreensaver hacks or the sdl video out of e.g. mplayer?

i wonder whether it's possible to check for an xv window and suspend syncing...

to "sync" xv with gl you must use indirect rendering what is iirc the default for compiz and required if you use blurring.
nvidia has options to sync video texture and blitter and _sometimes_ it even works ;-)
(don't trust the "applies immediately", restart kwin and the video player after checking it)
this will likely increase the cpu load of kwin and X11 :-(

if you don't sync the buffer is just swapped asap, diminishing the problem (and in case you're on a frequency twice the movie fps and gl and xv sync shifted by half aplitude you just luckily drop into an open slot ;-)
Comment 4 Fjtorsol 2010-03-14 14:33:46 UTC
Sorry for beign so late i had problems with my HD and I'am reinstalling Kubuntu 9.10 today with KDE 4.4 SC packages from ppa-launchpad repository (kubuntu).
I didn't specify before that the non v-syn area of the screen was coincident for window manager (noticieble for displacing windows), OpenGL applications, because of both Flash video playback and video playback, the bug dissapears when the KWin built-in V-Sync option (KDE appearence options) is disbled. Anyway I'am checking it today. This bugs happens with KDE's default settings (as Kwin V-Sync option is enabled by deafult) so for default settings it's abug too. The affected hadware (tested) is NVIDIA 8XXXM series(all 8XM based GPU's).
Comment 5 Fjtorsol 2010-03-14 14:44:52 UTC
Created attachment 41621 [details]
V-sync bug explanatory image

V-sync bug explanatory image
Comment 6 Thomas Lübking 2010-03-14 15:07:47 UTC
(In reply to comment #4)
> I didn't specify before that the non v-syn area of the screen was coincident
> for window manager (noticieble for displacing windows), OpenGL applications,
> because of both Flash video playback and video playback, the bug dissapears
> when the KWin built-in V-Sync option (KDE appearence options) is disbled.

if you've got general tearing with vsync this sounds like the refreshrate of your dispaly is misdetected.
-> Run nvidia-settings, select "X Server Display Configuration", select your display, check the refresh rate (next to the resolution)
If it's wrong or "auto" set the proper rate (depending on your home, most likely 60Hz with TFTs - pick any high value supported by your CRT - iff you use one) apply, in doubt restart KWin (or suspend/resume compositing) and see whether the problem remains.

(Please notice that the output of "xrandr -q" regarding the refreshrate can be described as "bullshit" with the nvidia driver - i.e. there's no connection to reality at all ;-)
Comment 7 Thomas Lübking 2010-03-14 22:29:03 UTC
*** Bug 229990 has been marked as a duplicate of this bug. ***
Comment 8 RussianNeuroMancer 2010-07-09 20:00:59 UTC
Thomas, even refrash rate properly detected by xrandr (it is possible with nVidia driver if option DynamicTwinView is disabled in xorg.conf - see nVidia driver documetation: http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9755/README/appendix-d.html ) enabling of VSync in KWin option give bad result for composite mode and video playback.

Also KWin can get correct frash rate even option DynamicTwinView in default state (enabled) by parse output of "nvidia-settings -q RefreshRate" command. It is possible to impement this and fix tearing bug until KDE 4.5 release?
Comment 9 Thomas Lübking 2010-11-27 16:29:26 UTC
support nvidias proprietary refreshrate through asking nvidia-settgins

r1201396