After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 562669 - Compositor: unredirect fullscreen windows
Compositor: unredirect fullscreen windows
Status: RESOLVED OBSOLETE
Product: metacity
Classification: Other
Component: general
2.25.x
Other Linux
: Normal enhancement
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
: 518712 574718 582801 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-11-29 12:29 UTC by Sebastien LOSS
Modified: 2020-11-07 12:36 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Sebastien LOSS 2008-11-29 12:29:57 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à ;)
Comment 1 Peter Sääf 2008-12-18 09:59:21 UTC
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.
Comment 2 Andrew Zabolotny 2009-01-14 23:05:49 UTC
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.
Comment 3 roberth.sjonoy 2009-02-12 00:11:55 UTC
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.
Comment 4 Sven Arvidsson 2009-03-10 00:34:10 UTC
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?)
Comment 5 s.malacarne 2009-03-11 20:09:19 UTC
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.
Comment 6 Sven Arvidsson 2009-03-13 14:46:30 UTC
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.

Comment 7 Aleksander Gielnicki 2009-07-03 17:21:00 UTC
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.
Comment 8 Sven Arvidsson 2009-07-03 17:28:09 UTC
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.
Comment 9 Andrew Zabolotny 2009-07-05 15:28:35 UTC
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.
Comment 10 Owen Taylor 2009-07-14 22:09:31 UTC
"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.)
Comment 11 Andrew Zabolotny 2009-07-15 10:31:42 UTC
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.
Comment 12 Owen Taylor 2009-07-15 16:54:07 UTC
- 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.
Comment 13 Sven Arvidsson 2009-07-15 20:39:23 UTC
*** Bug 518712 has been marked as a duplicate of this bug. ***
Comment 14 Owen Taylor 2009-11-18 18:39:57 UTC
*** Bug 574718 has been marked as a duplicate of this bug. ***
Comment 15 Owen Taylor 2009-11-18 18:46:56 UTC
*** Bug 582801 has been marked as a duplicate of this bug. ***
Comment 16 André Klapper 2020-11-07 12:36:12 UTC
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.