|10-29-09, 05:25 AM||#1|
Vsync problems and compositing issues
I have compiz + kde4 on Gentoo with nvidia drivers. My xorg.conf is
configured for laptop monitor.The laptop is DELL M2400 with Quadro FX 370M. Xorg server is 188.8.131.521-r2 stable.
VSync in videos works on laptop monitor. If I enable external monitor/disable
laptop monitor through nvidia-settings gui I start to have VSync
problems(tearing) on videos. If I logout and login in the tearing is
gone and vsync works on external monitor. If I switch it back to laptop
monitor again through nvidia-settings gui Vsync again works. I think
that there must be a problem in which nvidia-settings gui works with
xorg server when enabling/disabling monitors, maybe there is some issue
in the way how nvidia-settings "resets" xorg server.
Also in kwin manager when I switch to external monitor/disable laptop
monitor through nvidia-settings gui the compositing is suspended. If I
enable it the screen goes grey with only the mouse cursor showing. And
if I start clicking on the grey screen( for example where the menu is
beneath or opening some app) then if I turn off compositing the screen
is back and I can see what I've clicked and opened when it was
grey...Weird. And again if I logout and login everything works.
Btw. when I logout in kde 4 the screen stays on external monitor(which
was enabled in nvidia-settings gui before and laptop monitor disabled)
but I think it shoud turn on to the laptop monitor because, I presume,
the logout should restart xorg and read again xorg.conf...
I've changed versions of nvidia-drivers and the problem persits. Btw.
this happened when I've upgraded from xorg 1.5 to xorg 1.6 and now when I
downgrade back to 1.5. the problem stays. I've followed the instructions
on Gentoo site on how to properly upgrade to xorg 1.6 and everything
went ok, beside this problem...
Anybody know whats going on with this, it's driving me nuts?
|11-02-09, 12:02 PM||#2|
Join Date: May 2008
Re: Vsync problems and compositing issues
Yes, it is a big pain, I agree. This is my layman's terms understanding of how nvidia-composite-vsync-etc works.. It took me about 2 years to finally get it all straight.
- Composite needs to be disabled in order to get rid of tearing problems. New driver versions seem to be improved but they are still not 100% vs simply disabling compositing and not using things like Compiz.
- You'll have tearing problems when using more than one monitor. You need to use the environment variables to specify which monitor to sync to when using windowed apps, and even this is a not always a sure thing. The best bet is to use metamodes to switch monitors off and on when using fullscreen apps, especially with OpenGL fullscreen apps (SDLMAME, various games, graphics demos in Wine, etc).
- Don't use any options in your xorg.conf in an attempt to "fix" problems, it will only make things worse with contemporary X versions. Notable examples include "triplebuffer" and "useevents", these options caused me no end of problems with intermittent tearing, stuttering, and CPU spikes until I just got rid of them and followed my advice above. The only important thing to have is a metamode line (if you have more than one monitor).
- Use VDPAU for video playback, it's excellent. Use it in combination with the environment variable to specify the device to sync to. It's great, no tearing and almost no CPU usage.
- If you use a distro like Ubuntu which has a lot of apps running by default, look at your CPU usage history and start disabling stuff you don't need. Also in the case of desktop "widgets" under whatever environment you use, turn this stuff off completely or reduce its polling time (CPU monitors, hard drive monitors, temp monitors, etc). These widgets take up a ton of CPU time and can cause stuttering and performance problems.
- Dump your screensaver program. There's no point to screensavers anymore and in some cases they keep polling the system and lead to performance problems.
|11-05-09, 07:36 AM||#3|
Re: Vsync problems and compositing issues
I only use one monitor at a time. I've found a workaround, I've made three diferrent xorg.conf files, each one for one monitor and a script which prompts for "select monitor" on which the startx/kdm will start It's very basic but it works. And also I've turned on "Unredirect fullscreen windows" in General options tab of Compiz, that solved occasion laggs in full screen videos and opengl screensavers.
Btw. when I switch video driver in (s)mplayer to vdpau the cpu is on 3-4% and I see the vsync is not working. If the video driver is set to xv or gl(2) the cpu is at 22% and I see NO vsync problems. It appears that vdpau and compiz has to be polished some more in that area and default deiterancing filters of smplayer doesn't work with vdpau, which is ok because they are related to xv/gl but vdpau deiterancing filters perform worse than xv with double framrate yadif for example... So for me it's xv,with cpu at 22% with which I can live, and also vsync works and everything is really smooth and very quick performing(Gentoo is the fastest of them all )