I have that problem which seemingly afflicts many using the proprietary Nvidia driver:
Video tearing: fine horizontal lines (usually near the top of my display) when there is a lot of panning or action in the video.
(Note: switching back to the default nouveau driver is not an option, as its seemingly nonexistent power-management drains my battery several times faster)
I've tried Totem, Parole, and VLC, and tearing occurs with all of them. The best result has been to use X11 output
in VLC, but there is still tearing with relatively moderate action.
Hardware: MacBook Air 3,2 -- which has an Nvidia GeForce 320M.
There are two common fixes for tearing with Nvidia prop drivers:
Turn off compositing, since Nvidia proprietary drivers don't usually play nice with compositing window managers on Linux (Compiz is an exception I'm aware of). But I use an extremely lightweight window manager (Awesome window manager) which is not even capable of compositing (or any cool effects). I also have this problem in Xfce, where I have compositing disabled.
Enabling sync to VBlank. To enable this, I set the option in
nvidia-settings
and then autostart it asnvidia-settings -l
with my other autostart programs. This seems to work, because when I runglxgears
, I get:$ glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 303 frames in 5.0 seconds = 60.500 FPS 300 frames in 5.0 seconds = 59.992 FPS
And when I check the refresh rate using
nvidia-settings
:$ nvidia-settings -q RefreshRate Attribute 'RefreshRate' (wampum:0.0; display device: DFP-2): 60.00 Hz.
All this suggests sync to VBlank is enabled. As I understand it, this is precisely designed to stop tearing, and a lot of people's problem is even getting something like
glxgears
to output the correct info. I don't understand why it's not working for me.
xorg.conf: http://paste.ubuntu.com/992056/
Example of observed tearing::
One thing to try that may work. Open nvidia-settings and go to the powermizer section. Choose "Maximum Performance" in the drop-down, and you should see your powermizer level jump to the fastest speed.
Once you've done that, try the video.
In the past, I've found that vsync doesn't work when the nvidia card is on the slowest powermizer setting.
If you are using dual monitors, the nvidia driver can only sync to the vblank of one of the displays unless they use exactly the same refresh rate. And I do mean exactly. This is effectively impossible unless both monitors are the exact same type. In case the nvidia driver is syncing to the wrong display (for example, syncing to the built in display when you want to watch a movie on the external TV) you can override it's choice. From the nvidia driver documentation:
I have set this permanently in /etc/environment - just add something like this on a new line:
__GL_SYNC_DISPLAY_DEVICE="DFP-0"
I too was suffering from video tearing in my Intel sandy bridge processor. This worked for me. I put the following lines in "/etc/environment" -
CLUTTER_PAINT=disable-clipped-redraws:disable-culling
CLUTTER_VBLANK=True
and it worked. Press enter at the end and copy paste these lines. It may require restart. Try it.
Here is how I solved vsync issues for video on my ASUS K50IN notebook with the NVIDIA GeForce G102M. I am aware that your mileage may vary since the cards are different, but you can try it out... The trick for me was to use barebones MPlayer (but not MPlayer2!). It doesn't work with any of the other players.
Do the usual compiz magic in ccsm
Do the usual nvidia-settings magic:
Install mplayer and vdpau (NOT mplayer2!!! This is new and experimental and, for me at least, was laggy with VDPAU)
Set up MPlayer (I have tried gnome-mplayer, too, but it doesn't have the same result as hard as I tried)
Change ao to alsa if you removed pulse audio.
Restart X by logging out/in again.
Try it out, YMMV as always. I have found that, especially in non-LTS releases or with beta drivers, this may not work anymore depending on the codec of the video.
Not sure if this will hepl you, but it worked for me. Open nvidia-settings and change the Frecuency from Auto to 60. And press apply. This solved my problems with the video tearing and the general desktop flickering. Sadly I have to do this each time I restart.
This worked for me on an ATI radeon driver, so it might work for you:
Add a configuration file (e.g case /etc/X11/xorg.conf.d/20-nouveau.conf)
consisting of this:
EXA is the framework for compositing video; it doesn't seem to vsnc by default.
It might also be worth trying different software (e.g. vlc) to playback video.
I was experiencing the very same video tear problems. In my case I observed that tear down happens in fullscreen mode only. The problem seems to be at scaling the video to fullscreen. Whenever the original size of the video played and screen resolution ratios do not match there is tear down in the video. Setting the aspect ratio in smplayer to the displays aspect ratio fixed the problem for me.
e.g. I was playing a 1280x714 sized video in fullscreen there was tear in the video. As I forced the aspect ratio of the video to 16:9 the playback was smooth.
I have to note that the root cause of the problem stays there and is annoying. Since the aspect ratio is not kept original, there will be some deformation in the video. However it is better to watch without tears ;)
I use Ubuntu 12.04LTS 64bit and I have an nvidia gtx 660ti.
I was suffering from video tearing for over a month until I found a solution.
Open nvidia x server settings-->PowerMizer-->PowerMizer Settings (near the bottom), and where it says, "Prefered Mode," change the setting from Adaptive to Prefer Maximum Performance.
Upgrading to version 319 from PPA solved the problem:
If after boot, it runs in failsafe mode go into recovery and run
sudo nvidia-xconfig
. Happy video playing!I could pick the window with my cursor, move the window, and it fixed the tearing. So is seems like some callback issues in X.
For me the vlc fix was:
vlc -> tools -> preferences -> video -> in the 'output' dropdown choose
x11 video output(XCB)