! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Use GLX for compositing instead of Xrender
Status:
RESOLVED: FIXED

Comments

Description Felipe Contreras 2013-10-27 05:47:34 CET
There's a lot of bugs regarding tearing of windows because Xfwm uses a subpar method of compositing, it should use GLX in order to avoid tearing, there's no other option.


All other compositing window managers do that, and they look much better.

Even compton using the xrender method for compositing has less tearing than Xfwm with compositing.

See bug #7237, bug #10416, bug #6371, bug #10407.
Comment 1 Alistair Buxton 2014-02-17 21:22:31 CET
Actually there is another option: DRI3 and Present. This is a better solution than GLX because it doesn't require a powerful 3D card to completely eliminate tearing and doesn't destroy performance in games.

If you still want an OpenGL compositor, turn off the xfwm4 compositor and give Compton a try.
Comment 2 Tamir 2014-03-19 13:23:20 CET
What progress?
Comment 3 Yan Pas 2015-03-04 12:55:00 CET
Does the bug presents in xfce 4.12? Also the bug occurs on my desktop with Nvidia drivers, on my notebook with intel graphics card everything works good
Comment 4 Yan Pas 2015-03-30 07:55:29 CEST
Take a look at https://bugzilla.xfce.org/show_bug.cgi?id=11642
A great progress was made
Comment 5 Yan Pas 2015-04-08 19:54:56 CEST
For those who use NVidia there is a solution, that fixes tearing in any compositor:

Generate /etc/X11/xorg.conf via sudo nvidia-xconfig

Write to /etc/X11/xorg.conf
Section "Device"
 Identifier     "Device0"
 Driver         "nvidia"
 Option "Metamodes" "HDMI-0: 1920x1080 { ForceCompositionPipeline = On }"
 VendorName     "NVIDIA Corporation"
EndSection

HDMI-0: 1920x1080 is for my configuration. If you configuration differs - edit this line

https://devtalk.nvidia.com/default/topic/823711/linux/tearing-add-frame-buffer-please/?offset=7#4503217

I'm sure AMD has something similar. Try Option "TrippleBuffer" "True" too.
Comment 6 Olivier Fourdan editbugs 2015-04-24 22:52:52 CEST
Experimental support for OpenGL/GLX has been added to git master.

Note that comment #0 is not necessarily correct, OpenGL/GLX does not guarantee to be tear-free, it still depends on the driver and hardware.
Comment 7 jeremy9856 2015-06-01 02:54:33 CEST
Hi Olivier,

Is this help to avoid tearing with Nvidia proprietary drivers ?

If yes how can I do it ? 
Else is there a way to avoid tearing with Nvidia proprietary drivers?

I use xfwm4 4.12.3 from here ppa:unit193/xfce on Xubuntu 15.04 x64
Comment 8 Olivier Fourdan editbugs 2015-06-01 09:14:27 CEST
(In reply to jeremy9856 from comment #7)

> Is this help to avoid tearing with Nvidia proprietary drivers ?

Unfortunately not, for some reason that I do not (and don't want to) understand, NVidia proprietary driver behaves differently, I've been told.
 
> If yes how can I do it ? 
> Else is there a way to avoid tearing with Nvidia proprietary drivers?

Yes, there is, I reckon it's even mentioned in this very same bugzilla in comment 5 - But I have not tested and have no intention to install the proprietary driver on my system with compatible hardware.
Comment 9 jeremy9856 2015-06-01 11:13:27 CEST
I already tried a few days ago { ForceCompositionPipeline = On } and "TrippleBuffer" but that didn't work. I tried again and this time it worked.

May I ask you why you seem to hate the best GPU drivers on Linux ?
Comment 10 Olivier Fourdan editbugs 2015-06-01 11:24:20 CEST
(In reply to jeremy9856 from comment #9)
> May I ask you why you seem to hate the best GPU drivers on Linux ?

No, you may not. I'll leave this comment to you.

Appearance can be deceiving, I don't hate nor love anything hardware related and will certainly not go into any discussion about value of any specific hardware or vendor in a public xfce bugzilla, this is certainly most irrelevant here.
Comment 11 jeremy9856 2015-06-01 11:34:14 CEST
I think it's relevant to talk about a xfce bug with this hardware on the xfce bugzilla...

I think it's normal to use the official driver for your hardware and you lack of respect to the user of xfce when you don't care if it's working or not for them.
Comment 12 Olivier Fourdan editbugs 2015-06-01 11:40:16 CEST
It works with nouveau and this is what matters - This bug is about implementing GLX and this is done, so this bug is fixed.

Hardware/driver specific issues are irrelevant here, xfce is hardware agnostic and there will be no code added/changed to support and specific driver, even less proprietary ones.

Your comments about respect of users are completely irrelevant in a bugzilla.
Comment 13 jeremy9856 2015-06-01 11:45:02 CEST
Ok you are stubborn so I stop here.
Comment 14 Olivier Fourdan editbugs 2015-06-01 11:51:47 CEST
(In reply to jeremy9856 from comment #13)
> Ok you are stubborn so I stop here.

Being insulting won't help your cause, I'm afraid.

You asked a question in comment 7, that was already answered in comment 5 and yet I kindly replied your question in comment 8. You even even stated in comment 9 that it worked... The rest is just background noise at best.
Comment 15 jeremy9856 2015-06-01 17:31:44 CEST
I'm really sorry and I apologize, I was upset.

The option in comment 5 is a workaround but it's at the cost of 20 to 30% performance loss. Is it possible that you agree to make it works for all Nvidia users that need official drivers ?

Maybe you can have some infos from the nvidia developers here ?

https://devtalk.nvidia.com/default/board/98/

I don't want to try to force you of doing anything but I think it's important for a lot of users.
Comment 16 Olivier Fourdan editbugs 2015-06-01 17:40:51 CEST
On nvidia, it appears that xfwm4 fails to find a matching visual for the frame buffer config it's expecting and thus disable GLX so obviously it won't help with tearing.

You can see that by starting xfwm4 (from git master) from a terminal, it will complain that it "Cannot find a matching GLX config, vsync disabled".

Relaxing the requirements does not help either, even if it can find a matching visual, nothing shows up on screen (which is a lot worse than tearing).
Comment 17 Yan Pas 2015-06-01 17:44:01 CEST
@jeremy
I do not use this option anymore, cause video card won't produce smooth picture anymore. Playing cs go has become uncomfortable. The best solution is to use "compton --backend glx --vsync opengl". And do not forget to disable xfce compositor (wm effects) and put compton to autoload. 

I will post my compton settings with configured shadows if you want to.

@olivier
Xfwm finds glx if after running it reenable compositor. I used this workaround for some time period
Comment 18 Olivier Fourdan editbugs 2015-06-01 17:55:06 CEST
(In reply to yanpaso from comment #17)
> I will post my compton settings with configured shadows if you want to.

This is a bug in xfce bugzilla database, not a mailing list nor a forum about how to use compton or any other software, please, keep focused and don't pollute the bug with such comments, post in a forum instead. 

> Xfwm finds glx if after running it reenable compositor. I used this
> workaround for some time period

Quite frankly, this is nonsense, this is not the same code you tried anyway. The list of available visuals won't change, no matter how many times you try.
Comment 19 Olivier Fourdan editbugs 2015-06-15 21:45:31 CEST
Tearing was occurring because GL support was not enabled on NVidia proprietary driver because xfwm4 could not find a suitable GL FB config.

Can you retry with current code from git master?

I have tear-free compositing working here with GL support on proprietary NVidia driver with current code.
Comment 20 Yan Pas 2015-06-15 21:46:47 CEST
I will try in a week
Comment 21 Yan Pas 2015-06-16 21:45:21 CEST
Just ran 4.12.0git.5b4ddd6 with vsync enabled, tearing still exists. Maybe I should do something additional?
Nvidia driver 352, kernel 3.16.
Comment 22 Olivier Fourdan editbugs 2015-06-17 11:35:09 CEST
(In reply to yanpaso from comment #21)
> Just ran 4.12.0git.5b4ddd6 with vsync enabled, tearing still exists. Maybe I
> should do something additional?

You need to enable "Allow flipping" and "Sync to VBlank" in OPenGL settings from nvidia-settings.

Enabling "Synchronize drawing to vertical blank" should not even be needed in xfwm4-tweaks.

You may want to run xfwm4 from a terminal to see if it logs any error regarding OpenGL support.
Comment 23 Yan Pas 2015-06-17 12:43:11 CEST
These options were already turned on in driver settings. Sync drawing in xfwm4-tweaks makes no effect. Tearing still exists.
Try to watch this video fullscreen in chrome or VLC https://youtu.be/cuXsupMuik4
Comment 24 Olivier Fourdan editbugs 2015-06-17 13:05:24 CEST
(In reply to yanpaso from comment #23)
> These options were already turned on in driver settings. Sync drawing in
> xfwm4-tweaks makes no effect. Tearing still exists.
> Try to watch this video fullscreen in chrome or VLC
> https://youtu.be/cuXsupMuik4

Yes, that's the same video I use to test tearing so I know about it and it's tear free here.

Can you try with mozilla instead (I don't know about vlc, but I had tearing with chrome independently of the compositor in the past).

Can you also do this as per comment 22:

> You may want to run xfwm4 from a terminal to see if it logs any error
> regarding OpenGL support.
Comment 25 Olivier Fourdan editbugs 2015-06-17 13:10:21 CEST
(In reply to yanpaso from comment #23)
> > Try to watch this video fullscreen in chrome or VLC
                            ^^^^^^^^^^

Oh wait, fullscreen override redirect windows may get unredirected, ie it's not using the compositor so vsync code in xfwm4 may not be used at all.

What it *not* fullscreen ?
Comment 26 Yan Pas 2015-06-17 13:24:11 CEST
I ran xfwm4 --replace in terminal, output is empty except "Waiting for current window manager (Xfwm4) on screen :0.0 to exit: Done"
Tearing immediatly appears when you quickly drag windows from left to right. Switching off and on Effects (xfce-compositor) in xfwm4-tweaks cures this trouble a  bit.
Firefox with adobe flash 11 has worse situation: there are about 7 little breaks all along the white stripe. No matter full screen or not. In chrome and VLC only one break, no matter full screen too. I will record video in a minute
Comment 27 Olivier Fourdan editbugs 2015-06-17 13:28:48 CEST
(In reply to yanpaso from comment #26)
> I ran xfwm4 --replace in terminal, output is empty except "Waiting for
> current window manager (Xfwm4) on screen :0.0 to exit: Done"

Which seems ok, otherwise it would have complained.

Can you post the output of "xfwm4 --version" just to be sure?

> Tearing immediatly appears when you quickly drag windows from left to right.
> Switching off and on Effects (xfce-compositor) in xfwm4-tweaks cures this
> trouble a  bit.

Placebo effect most likely.

> Firefox with adobe flash 11 has worse situation: there are about 7 little
> breaks all along the white stripe.

Sorry I did not mean adobe flash player, you don;t need this to play videos on youtube.

> No matter full screen or not. In chrome
> and VLC only one break, no matter full screen too. I will record video in a
> minute

No need, a video capture is unlikely to demonstrate anything.
Comment 28 Yan Pas 2015-06-17 13:46:10 CEST
Created attachment 6313 
Nvidia bug report

>Can you post the output of "xfwm4 --version" just to be sure?
$ xfwm4 --version
	This is xfwm4 version 4.12.0git.5b4ddd6 (revision 5b4ddd6) for Xfce 4.10
	Released under the terms of the GNU General Public License.
	Compiled against GTK+-2.24.23, using GTK+-2.24.23.

	Build configuration and supported features:
	- Startup notification support:                 Yes
	- XSync support:                                Yes
	- Render support:                               Yes
	- Xrandr support:                               Yes
	- Xpresent support:                             No
	- Embedded compositor:                          Yes
	- Epoxy support:                                No
	- KDE systray proxy (deprecated):               No
>Sorry I did not mean adobe flash player, you don;t need this to play videos on
youtube.
With firefox HTML player all the same behavior

I was capturing via iphone, so you will see tearing https://youtu.be/lZmbYTUqxpw

I also ran # sh /usr/bin/nvidia-bug-report.sh
Comment 29 Olivier Fourdan editbugs 2015-06-17 13:49:05 CEST
(In reply to yanpaso from comment #28)
> Nvidia bug report

Not needed.

> >Can you post the output of "xfwm4 --version" just to be sure?
> $ xfwm4 --version
> [...]
> 	- Epoxy support:                                No
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

=> Without epoxy you don't have OpenGL support so you are not testing anything useful here!! Just wasting time...

Please majke sure to have epoxy devel installed and xfwm4 built with epoxy support before testing.
Comment 30 Yan Pas 2015-06-17 14:04:53 CEST
Installed libepoxy-dev, recompiled, reinstalled, ran - no tearing! I have even suspended and woken up PC.
Thanks a lot for fix
Comment 31 Olivier Fourdan editbugs 2015-06-17 14:09:45 CEST
(In reply to yanpaso from comment #30)
> Installed libepoxy-dev, recompiled, reinstalled, ran - no tearing! I have
> even suspended and woken up PC.

Thanks for testing, closing then - Seems to work reasonably well enough with both open source and closed source driver.

Only hardware/driver not tested is ATI/fglrx.
Comment 32 jeremy9856 2015-06-17 14:11:29 CEST
Thanks a lot for fixing this !
Comment 33 Olivier Fourdan editbugs 2015-06-29 17:29:39 CEST
*** Bug 11642 has been marked as a duplicate of this bug. ***
Comment 34 jeremy9856 2017-12-31 12:32:02 CET
Too bad this feature is still not in a release. Can you confirm it will be in 4.14 ?
Thanks !

Bug #10439

Reported by:
Felipe Contreras
Reported on: 2013-10-27
Last modified on: 2019-09-04
Duplicates (1):

People

Assignee:
Olivier Fourdan
CC List:
9 users

Version

Version:
4.12.0

Attachments

Nvidia bug report (105.38 KB, application/gzip)
2015-06-17 13:46 CEST , Yan Pas
no flags

Additional information