Tearing with nVidia drivers and mplayer with “-vo xv”

Well, let’s start with the conclusion: setting XV_SYNC_TO_VBLANK has no effect, if a second monitor is attached.

But let’s start at the very beginning: What is tearing? Well, this is how Wikipedia defines it:

Screen tearing is a phenomenon in video where a previously rendered frame overlaps a newly rendered frame, creating a torn look as two parts of an object (such as a wall) don’t line up…

I’m running MyMediaSystem on my living-room and suffer from this annoying tearing. If you suffer from tearing, there’s a simple solution to it. Activate either something like DOUBLEBUFFER or V-SYNC somewhere in your video driver settings, and the problem is suppose to disappear. You just can start nvidia-settings and try this with OpenGL, and you’ll see it’s working (If you had tearing problems before). If you try the same with XVideo (xv) with the same tool, you might won’t see any changes/improvements.
The problem is, I can’t use OpenGL as output device (-vo gl), because OpenGL slows my frames per second rate extremely down when watching FullHD (1920×1080) content.
I’ve been looking through the whole Internet twice ;-) , but couldn’t find any solution for it. To be honest, it’s actually not clear to me, which part of my system is affected at all. Is it xv? If you read this, you might think, it’s not xv, but mplayer, because the explanation is pretty smart. I’ve read also (FIXME), that xv is affected, and it’s a known and confirmed bug in the Xorg server, or that using VSYNC with composite doesn’t work for some reasons.

I’ve tried this one, but didn’t help.

I’ve read also turning off composite/compiz, and/or TwinView should help.

I’ve tried to set the port for mplayer, like said in this post, with no effect either.

But all suggestions weren’t the right one for me. I had to do three very simple things.


Way of solution

  • The first one was to set the XV_SYNC_TO_VBLANK with nvidia-settings.See picture to the right.
    nvidia-settings:XV_SYNC_TO_VBLANK=1

    nvidia-settings:XV_SYNC_TO_VBLANK=1


    UPDATE: It turned out, the tearing problem is gone, if you only detach the second monitor. It seams that the nvidia module doesn’t care for these switches (see below) in the ~/.nvidia-settings-rc:

    .
    0/XVideoTextureSyncToVBlank=0
    0/XVideoBlitterSyncToVBlank=0
    .

  • The second step was to detach my second Monitor (CRT-0, it’s an old Iiyama 20″ HM204DT). Simply unplug the cable,
  • and the third step was to simple reboot, so the nvidia module was loaded from scratch (I know, it’s an old Windows habbit).

A Ctrl+Alt+F1 for console mode and a

/etc/init.d/kdm stop
modprobe -r nvidia
modprobe nvidia

should have done the same trick. Yes, Ctrl+Alt+Backspace wasn’t enough.
I’ve also compared my /etc/X11/xorg.conf before and after the detachment of my CRT-0, and there were no changes at all. The diff gave me nothing back, what means the files are identical.

I’m on Fedora 8, and for those who might need more info about my system: here it is:

X Window System Version 1.3.0
Release Date: 19 April 2007
X Protocol Version 11, Revision 0, Release 1.3
Build Operating System: Fedora 8 Red Hat, Inc.
Current Operating System: Linux moon 2.6.25.14-69.fc8 #1 SMP Mon Aug 4 14:20:24 EDT 2008 i686
Build Date: 24 July 2008
Build ID: xorg-x11-server 1.3.0.0-47.fc8
.
.
(II) NVIDIA dlloader X Driver 173.14.12 Thu Jul 17 18:15:54 PDT 2008

Case closed :-)

3 thoughts on “Tearing with nVidia drivers and mplayer with “-vo xv”

  1. Emil

    @Florentin what is ccsm?

    I have had problems with tearing with Nvidia cards using mplayer with either xv and vdpau output. I only have one monitor connected to the equipment.

  2. Pingback: geforce

Comments are closed.