Screen tearing in multi-monitor setup - 346.16

Grretings,
I am running a EVGA SC GTX 760 with 2 monitors both connected via DVI. 1 monitor is a Asus VW246H (24") and the other is an Asus VH236H (23"). They’re both 60Hz monitors.

I use Xubuntu 14.04.1 which uses the XFCE 4.10 desktop environment, XFWM4 window manager. I don’t want to use sync to vblank because then my games are limited to 60FPS. Should a compositing engine solve my screen tearing with out having to use sync to vblank? I’ve tried using the built in compositor in XFCE which didn’t help, I’ve tried installing and running compton with glx backend for compositing which is suppose to fix screen tearing and it does but only on the farthest left monitor VW246H. The monitor that’s at +1920,0 has horrid screen tearing on it VH236H.

Within nvidia-settings both monitors appear next to each other and for X configuration pulldown I don’t use Xscreen 0 which changes the graphic of my displays so it appears like there’s only 1 giant screen (without a line down the middle) because I believe that would make my window manager launch new apps directly in the middle of the 2 screens which is not what I want. I want there to be 1 desktop BUT so I can drag windows between them but having 1 being the primary which apps and games open on which is how i have it working right now but i can’t get rid of the horrendous screen tearing on my gaming monitor. Can anyone help me please?

Vsync is the only way to eliminate screen tearing.

really? i was under the impression that a compositor could solve the issue? if i enable sync to vblank in the nvidia-settings all games i try to play are locked at 60FPS.

UPDATE: finally figured it out but i’m not sure which change actually fixed it. I did a whole slew of changes and maybe someone can definitively inform me which one most likely did it. I added the following to my /etc/environment file

__GL_SYNC_DISPLAY_DEVICE="DFP-0"
CLUTTER_PAINT=disable-clipped-redraws:disable-culling
CLUTTER_VBLANK=True

I created a file /etc/profile.d/tearing.sh which contains

#!/bin/bash
export __GL_YIELD="USLEEP"

and the thing that actually flips screen tearing on and off live right in front of my eyes is within nvidia-settings enabling PowerMizer and settings Prefer Maximum Performance. Is there some script that can set this from the command line? I’m more concerned about running my card full throttle constantly. I saw another forum thread in here that mentions that doing so will add about $150/year in electrical costs. So maybe I’ll write a script for setting the powermizer to max performance right before i start watching videos or gaming and then a script to disable it when I’m done doing those things.

Any thoughts from others?

I’m pretty sure that “CLUTTER_VBLANK=True” turned Vsync on. If that didn’t also lock games to 60fps, it might be because the compositor automatically disables itself for fullscreen applications.

Anyway, since the compositor is what actually finally makes the frame visible, there is no way to make applications within the compositor tear-free without making the compositor itself tear-free. There is also no way to make the compositor tear-free besides enabling Vsync, since Vsync is the only way to ensure that frames are copied or flipped to be visible while the display is scanning the active area. Simply put, Vsync is the only way to avoid tearing.

as I stated, not until i turn powermizer to “prefer max performance” do I get a tear free experience on the monitor located at +1920,0 without setting vsync (sync to vblank) or setting vsync in any games it’s just that my card has to run full throttle.

compton is doing my compositing