Tombuntu

Make Compiz Run Smoothly and Without Tearing

For a long time it has bothered me that Compiz does not seem to run as smoothly as Metacity on my desktop system. With desktop effects switched off, moving windows around the screen would seem smoother. With desktop effects switched on, I’d also notice tearing in areas of the screen with fast motion including in videos. I was fiddling with Compiz settings recently and managed to fix the problem entirely. Now, if your graphics card struggles to run Compiz this will probably not help you. But if you have a decent graphics card (mine is a nVidia GeForce 8600 GT) give this a try if you have noticed this problem.

If you haven’t already, you’ll need to install the advanced Compiz configuration utility. Install CompizConfig Settings Manager from the package compizconfig-settings-manager (click the link to install), or by running the command below in your terminal:

sudo apt-get install compizconfig-settings-manager

Start CCSM from System->Preferences->CompizConfig Settings Manager. Under the category General, select General Options. Select the Display Settings tab. De-select the Detect Refresh Rate option. Set the Refresh Rate option to match the vertical refresh rate of your display. (I checked my monitor’s on-screen display to verify that it was running 60 Hz.) Finally, select the Sync To VBlank option.

These settings should take effect immediately. If Compiz is still not completely smooth, it won’t hurt to turn the refresh rate up higher.

Archived Comments

Brett Howard

I found that I’m currently refreshing at 60Hz but found that the smoothest setting for me was at 2x my refresh rate.

But thanks for the input!

Tomas

I have been digging this for a long time and tryinG figure out wtf was wrong whEn I played a video and a camera moved horizontally. There’s ONE AND ONLY ONE fix, and people don’t know what it is, even Tombuntu doesn’t get it right. His explanation SUCKS. The compiz programmers f-u-c-k-e-d it. How the f… normal people should find it out?? That’s why they say linux sucks. And why compiz programmers hasn’t yet switched the option on? Its beyond my perception. Many people will think they are idiots now. But thank me a lot guys for revealing the SECRET, that noone knows!!! THE ONLY THING YOU HAVE TO SWITCH ON IN COMPIZ SETTINGS IS TURNING ON VSYNC TO BLANK. THE END OF THE STORY.
How the f… poor people shoul know that??

John

Sorry Mr Tom, but I don’t agree with you.

In Ubuntu 9.10 this tip only works for Compiz. I have a video tearing no matter what. If I apply these tips the video tearing on a horizontal camera or object move remains.

In Ubuntu 9.04 I had to only turn on “sync to vblank” and I didn’t have to touch other settings at all. In Ubuntu 9.10 this and your tip do not work at all. I tried the drivers 1.85 (included) and 1.9xx. It doesn’t help- the video tearing remains.

I susspect somethning fishy as MS added a code to the kernel, as well as Intel and Nvidia have sued each other havily recently and Intel was working like crazy on the drivers for Linux (bribing the developer or adding sth to the kernel).

This is a havy regression, that for me is a complete showstopper. Just after 2 years adventure with Ubuntu and its foibles with audio and Nvidia video drivers. This also means that I’m writing this text under Win 7 beta. And one more thing: the video quality of Xvid is much better in Win 7.

I would like to come back to Ubuntu, but I’m just a user, not a reverse engeneer for graphics.

Emil  Begtrup-Bright

Hmm doesn’t seem to help me though. Even with the refresh rate at the highest there is a visible tearing. My GPU is an 1 GB ATI HD 4890, so that shouldn’t be the problem.

LaPeGa

Thanks a lot!!!
I now works smoooth…!!!

Robert Jensen

Note to developers of Compiz:

Why don’t you just default the thing to automatically use the card/monitor VSync in the first place? In previous versions of Linux I had to usually manually set up the video card/monitor settings but for the past year or so its been set automatically. If they can do it, you can do it too.

Tom, thanks for the very helpful tip!

Mohan

Very cool tip!

Matthew

Will this also fix tearing on the secondary screen in a dual screen setup when both displays have different refresh rates?

Pau

I can’t “feel” any change :(. I wish Compiz effects where as smooth as the MacOSX’s are…

zabus

nope..didnt work for me, got things worse. i have a nice ati card.

cory

Thank you! This irked me for so long! No more torn videos! Totam visualizer is smoother , too! Awesome!

AtkinsSJ

Thanks! It had always annoyed me that it tore for no real reason, and I hadn’t realised those settings were there. Nice. :D

lukeen

If I select Sync to VBlank everything totally lags, like a framerate of 2 seconds. I’m using UXA on a Intel 4500HD and everything runs totally smooth :) so this doesn’t seem to work for every configuration…

detcader

same as lukeen; everything lags, doesn’t work for me.

Henrik

Thanx a lot! The non-smothness of Compiz have bothered me for sometime, but I just thought I had to live with it, but now I don’t have to. Really a great tip!

J.P.

Worked a treat (nVidia 7600GT) on a fresh Ubuntu install. I used a frame rate of double the monitor refresh rate.

Shifty

I made this change to an old P4 (Dell GX240) and the difference is amazing. The computer is now usable for general tasks without any frustration. Thanks Tom!

banavara

Excellent tip, I also have nVidia 8600 and the tip works just nice. I had been envying the glass plate like windows in Vista and no more now.

Now only if there is something that reduces jagginess while rotating the cube.

rsvr85

Great tip!! It’s nice and smooooooth now :)
Works perfectly for my NVIDIA GeForce Go7600

rsvr85

P.S I noticed that Compiz was detecting 50, my monitor is benchmarked at 62, i’ve had to push the refresh rate up to 100 in order to get ‘ultimate smoothness’. What (if any) detrimental effects/heavy loading will this have on my other hardware??

Linux

Great tip! It really makes a difference.

Rob

This problem was really putting me off Ubuntu and Mint. Thank you so much for your help. It works beautifully with my Nvidia 8400GS super and LG W2452T on DVI. You have saved me a lot of frustration. It is really refreshing to find someone who explains clearly.

Lucrian

Today I figured out one thing that caused me to have tearing at the top of the screen:

--loose-binding under nvidia seems to cause tearing on my computer

I had to do a

sudo kate /usr/bin/compiz

# if check_nvidia; then
# if [ “x$INDIRECT” != “xyes” ]; then
# COMPIZ_OPTIONS=“$COMPIZ_OPTIONS –loose-binding”
# fi
# fi

As you can see, I uncommented out those lines using #. Loose-binding, while making it faster on some systems, seems to increase my tearing. Using this and setting my refresh rate to 60 (my monitor’s) seemingly has fixed my tearing and smoothness problems.

ihatethetv

This worked great for me. I was about to puke with all the tearing. IT’s not totally smoothe now, but its liveable now.

Working on a stinkpad with a nvidia quadro something or other in it.

Tom Albrecht

Thanks so much! This fixed my problem, and my XBMC install looks fantastic.

iDVB

DOH! Fixes didn’t work on my system.

Here’s the weird part. Compiz worked fine on 9.04 with Uber-smooth video with no tweaking required.

Ubuntu 9.10
Dell XPS M170
NVidia Geforce Go7800 GTX
2GB RAM

I tried:
VBlank ON and OFF for both NVidia and Compiz
Tried manually setting NVidia Refresh rate 60
Tried manually setting Compiz Refresh Rate 60, 100, 120
Tried setting Compiz Detect Refresh Rate off and on
…and combos of each.
no luck.

Tortured Utopian

Please check this post for a complete way to get a good compiz display with no tearing : http://www.nvnews.net/vbulletin/showthread.php?t=110854

Tortured Utopian

(you have to disable DynamicTwinView with Nvidia drivers, otherwise, they do return an invalid vertical frequency…)

rodislav

thanks man! :) now its better

Hanz

Thank you so much!!
I have a 9800gt and it was painful to move my cube desktop. Now everything is smooth as silk :)

Matt

Just writing to say thanks! This fixed an annoying flicker when moving windows on my mint + nvidia setup.

ActionParsnip

Just ditch compiz and use Metacity, or even openbox. no issues here :)

pst007x

I have tried everything possible. Updating NVidia drivers, to tweaking compiz, etc. There is and always have been an issue with linux and NVidia. If you really want a smooth PC, with no driver issues, use Windows! Ubuntu is ok, Unity is buggy, no matter what anyone says! Unfortunately since 8.04, with regards to NVidia there have always been issues, I have been able to fix in earlier versions but since Unity it has gone horribly wrong. I appreciate all the developers putting their time into an open source OS, and drivers, etc… but sorry guys still does not work, and Ubuntu 11.10 is terrible! Sorry :-(

Respond via email