GNOME Bugzilla – Bug 562669
Compositor: unredirect fullscreen windows
Last modified: 2020-11-07 12:36:12 UTC
Launch Metacity with composite activate broke video sync: I note this when I play video game using opengl or play a movie (here with totem gstreamer). I have a NVIDIA 9600GT video card and use nvidia 173.14.12 driver. Setting "Sync to VBlank" in "Video Texture Adaptor" section with nvidia-setting not solve the problem. Launch metacity with --sync option give me a seg fault... Voilà ;)
I can confirm that I see tearing when watching videos with metacity 2.23.21 and later. (with the compositor active). This is also with an NVIDIA card but with the open nouveau driver.
This is a really annoying bug, I spent a couple of days trying to find out what causes video tearing until I found I have to disable compositing ... I have my second head connected to a 46" LCD TV and wasn't expecting to see such a jerky motion, especially in horizontal scrolling scenes.
This happens to me when playing videos with MPlayer, once I disable the composite, the tearing disappears, FYI I have vsync=yes in my mplayer config.
Might this be due to the compositor being limited to 50 fps? http://jeremy.visser.name/2008/10/25/make-metacity-compositing-smoother/ I have tried to increase the refresh rate in compositor/compositor-xrender.c but tearing is still visible, so maybe it's xrender related? (This bug should probably be added to the compositor component, or maybe somebody can CC Iain?)
I can confirm this on Ubuntu 8.10 64 bit with free ATI driver (6.9). Opengl applications (sdlmame for example but also glxgears) show massive tearing when metacity composite is active.
Okay, so at least for video playback on Intel cards, this is a bug in the video driver. Video sync at the moment only works in a non-composited environment.
Why doesn't this get CONFIRMED? this bug is really annoying. I know the Metacity's compositor is not an official standard (yet), but it's there in a stable build and it forces me to disable it when I watch movies or play games. Other compositors don't do that (no, I won't use them, they're crappy in everything else... except Xfce, but it doesn't integrate that well with themes). Come on guys, it's been over half a year already, it can't be that hard to see how Xfce does it (or even xcompmgr or Compiz) and implement it. At least show some understanding and acknowledge the problem by CONFIRMING. By the way, I'm using nVidia's official drivers.
The status field isn't used that way, often bugs go from UNCONFIRMED directly to FIXED. Anyway, most drivers should handle vsync with a gl compositor. Considering that GNOME Shell will have one of those, it's probably not worth the effort to fix this in Metacity? A better work around, which xfwm uses, is to disable the compositor for fullscreen windows. It should take care of both movies and games.
Aleksander, if you're fine with a temporary hack, you may try this patch: http://cs.ozerki.net/zap/pub/rpm/metacity-2.26-screen-restrict.patch The patch is from Thomas Thurman, he posted it in bug #351647. After you recompile metacity with the patch, do the following: # mv /usr/bin/metacity /usr/bin/metacity.bin # cat >/usr/bin/metacity <<EOF #!/bin/sh exec /usr/bin/metacity.bin -S 1 $* EOF # chmod a+x /usr/bin/metacity After this you must be able to watch video without tearing on your TV (I assume it is :0.1) and still use compositing on :0.0.
"Video sync" doesn't make sense for a redirected window; you'd have to sync to the compositor redraw cycle instead. (redirected means that it is drawn to an offscreen buffer than the compositing manager draws it to the screen.) compiz and, as noted above, xvfm, take the approach of unredirecting fullscreen windows, so that you get full performance and features for such windows It could be done for the Metacity compositor in theory as well; I'm retitling this bug accordingly, since its' the only real fix for what is reported here. (Given the move to Mutter as a solution for composited environments, I suspect that WONTFIX is probably the right resolution here.)
Maybe it would make sense to force metacity always sync when it is in compositing mode. If animations are properly written, their timing does not depend on FPS, and using synced output will make them smoother (are there any reasons to display just unfinished pieces of flying windows when animation FPS is larger than screen refresh rate?). This should fix both windowed and fullscreen movie playback.
- Syncing the compositor output is a good idea, but unfortunately, there are no X server APIs currently to do sync-to-vblank except for GL applications. So this isn't really possible for the XRENDER based compositor in Metacity. Mutter (Metacity turned into a GL-based compositor) does sync-to-vblank. (Assuming that it's working properly in Clutter and in the GL stack; Right now, with the transition to DRI2, sync-to-vblank is a bit uncertainly working in the GL stack.) - Syncing in the compositor doesn't necessarily help applications that much - yes, it prevents tearing, but it doesn't allow the application to throttle and only draw the frames it needs to draw. See http://mail.gnome.org/archives/wm-spec-list/2009-June/msg00006.html for a rough proposal about how proper throttling could work in a composited world.
*** Bug 518712 has been marked as a duplicate of this bug. ***
*** Bug 574718 has been marked as a duplicate of this bug. ***
*** Bug 582801 has been marked as a duplicate of this bug. ***
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old feature requests in Bugzilla which have not seen updates for many years. If you still use metacity and if you are still requesting this feature in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/metacity/-/issues/ Thank you for reporting this issue and we are sorry it could not be implemented.