RESOLVED FIXED 118253
[texmap][GStreamer][GTK] composited video shows tearing
https://bugs.webkit.org/show_bug.cgi?id=118253
Summary [texmap][GStreamer][GTK] composited video shows tearing
Víctor M. Jáquez L.
Reported 2013-07-01 10:16:18 PDT
Composited video using nvidia cards (tested on ion and quadro nvs, either nouveau or the closed-source driver) shows a screen tearing artifacts, in non-composited window managers, no matter if the vblank sync configuration is enabled.
Attachments
Update the texture _only_ when it is going to be painted. (7.00 KB, patch)
2013-07-04 04:05 PDT, Víctor M. Jáquez L.
no flags
Call glXSwapInterval(1) if available (1.81 KB, patch)
2013-07-04 04:07 PDT, Víctor M. Jáquez L.
no flags
opengl trace of a webkit1 session (438.88 KB, text/x-log)
2013-07-04 07:21 PDT, Víctor M. Jáquez L.
no flags
Patch (2.31 KB, patch)
2013-07-30 12:09 PDT, Zan Dobersek
no flags
Víctor M. Jáquez L.
Comment 1 2013-07-01 10:19:05 PDT
I experimented with glXSwapIntervalEXT and it doesn't improve the tearing issue.
Víctor M. Jáquez L.
Comment 2 2013-07-01 10:22:24 PDT
I'm wondering if we should add some kind of vblank handling as cogl does: https://git.gnome.org/browse/cogl/tree/cogl/winsys/cogl-winsys-glx.c#n1741
Víctor M. Jáquez L.
Comment 3 2013-07-04 04:05:59 PDT
Created attachment 206071 [details] Update the texture _only_ when it is going to be painted.
Víctor M. Jáquez L.
Comment 4 2013-07-04 04:07:48 PDT
Created attachment 206073 [details] Call glXSwapInterval(1) if available
Víctor M. Jáquez L.
Comment 5 2013-07-04 07:21:09 PDT
Created attachment 206086 [details] opengl trace of a webkit1 session The FB Context is created without double buffer!
Martin Robinson
Comment 6 2013-07-04 09:20:24 PDT
Comment on attachment 206073 [details] Call glXSwapInterval(1) if available View in context: https://bugs.webkit.org/attachment.cgi?id=206073&action=review > Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:155 > + glXSwapInterval = reinterpret_cast<PFNGLXSWAPINTERVALSGIPROC>(glXGetProcAddress(reinterpret_cast<const GLubyte*>("glXSwapIntervalSGI"))); Something like this belongs in OpenGLShims. > Source/WebCore/platform/graphics/glx/GLContextGLX.cpp:253 > + if (m_window) { > + bool ret = glXMakeCurrent(sharedX11Display(), m_window, m_context); > + if (glXSwapInterval) > + glXSwapInterval(1); > + XSync(sharedX11Display(), False); > + return ret; > + } Does it make sense to call this even if we are running under a composited window manager?
Martin Robinson
Comment 7 2013-07-04 09:21:39 PDT
You've got a couple different patches here, but none of them are up for review. If you want them reviewed, I recommend making this patch a meta bug and creating one dependent bug for each patch.
Víctor M. Jáquez L.
Comment 8 2013-07-04 15:46:27 PDT
(In reply to comment #7) > You've got a couple different patches here, but none of them are up for review. If you want them reviewed, I recommend making this patch a meta bug and creating one dependent bug for each patch. I didn't ask for review because those patches don't solve the problem. I uploaded them a as reference of what I have tried.
Xabier Rodríguez Calvar
Comment 9 2013-07-08 07:38:18 PDT
I am having trouble with both WebKit and direct gst-launch. I have an Intel 915 and I tried with GStreamer 1.0.4, 1.0.7 and today's master with same tearing result. I am adding CCing Sebastian in case he can shed some light.
Sebastian Dröge (slomo)
Comment 10 2013-07-09 00:05:14 PDT
If you see tearing it most probably is caused by doing rendering during vsync. To get around that you should synchronize all drawing operations with vsync, i.e. make sure that the drawing operation is started and finished before the next vsync. Something like glXSwapInterval(1) should do that though.
Sebastian Dröge (slomo)
Comment 11 2013-07-09 00:07:21 PDT
Ideally you would have a render loop that renders everything right before the vsync, and separate to that the uploading of the textures. So the render loop would always see finished textures, and always takes the latest of all textures and then immediately renders them. This is also the way how we want to change the GStreamer video sinks in the future.
Víctor M. Jáquez L.
Comment 12 2013-07-10 03:03:37 PDT
Víctor M. Jáquez L.
Comment 13 2013-07-12 01:37:01 PDT
Zan Dobersek
Comment 14 2013-07-30 12:00:29 PDT
This issue is fixed when using GTK+ 3.8, likely due to support for the Window Manager frame synchronization protocol. https://mail.gnome.org/archives/gtk-list/2013-March/msg00019.html I'll upload the patch that bumps the Jhbuild versions of the GTK+ and Glib packages.
Zan Dobersek
Comment 15 2013-07-30 12:03:04 PDT
(In reply to comment #14) > I'll upload the patch that bumps the Jhbuild versions of the GTK+ and Glib packages. Err, GTK+ and Gdk-Pixbuf.
Zan Dobersek
Comment 16 2013-07-30 12:09:03 PDT
Zan Dobersek
Comment 17 2013-07-31 05:40:56 PDT
Comment on attachment 207754 [details] Patch Clearing flags on attachment: 207754 Committed r153518: <http://trac.webkit.org/changeset/153518>
Zan Dobersek
Comment 18 2013-07-31 05:41:03 PDT
All reviewed patches have been landed. Closing bug.
WebKit Commit Bot
Comment 19 2013-08-01 02:10:47 PDT
Re-opened since this is blocked by bug 119386
Zan Dobersek
Comment 20 2013-08-01 02:15:15 PDT
(In reply to comment #19) > Re-opened since this is blocked by bug 119386 Rolling out the Jhbuild dependency bump. The bump wasn't required by the layout tests and is causing problems with the increased Pando dependency, but do note that the fix is still valid - when using GTK+ >= 3.8, the screen tearing is no longer present.
Zan Dobersek
Comment 21 2013-08-01 02:32:25 PDT
Closing as fixed as per comment #20.
Xabier Rodríguez Calvar
Comment 22 2013-08-04 02:10:55 PDT
(In reply to comment #21) > Closing as fixed as per comment #20. I applied the patch and compiled WebKit with "Tools/Scripts/build-webkit --gtk --enable-webkit2 --disable-gtk-doc --enable-introspection=no --no-svg" and run the example with "Tools/Scripts/run-launcher --gtk --enable-accelerated-compositing=TRUE url" in GNOME Classic and I still can see the tearing. It's less noticeable, but it is still there. I think we should reopen this.
Zan Dobersek
Comment 23 2013-08-05 00:28:35 PDT
Reopening.
Víctor M. Jáquez L.
Comment 24 2013-08-05 02:04:46 PDT
(In reply to comment #22) > (In reply to comment #21) > > Closing as fixed as per comment #20. > > I applied the patch and compiled WebKit with "Tools/Scripts/build-webkit --gtk --enable-webkit2 --disable-gtk-doc --enable-introspection=no --no-svg" and run the example with "Tools/Scripts/run-launcher --gtk --enable-accelerated-compositing=TRUE url" in GNOME Classic and I still can see the tearing. It's less noticeable, but it is still there. I think we should reopen this. Confirming using a Nvidia gpu, the tearing is still there.
Martin Robinson
Comment 25 2013-08-05 02:11:45 PDT
(In reply to comment #24) > Confirming using a Nvidia gpu, the tearing is still there. Can you guys confirm whether you are seeing this with the version of GTK+ that reported to have fixed this issue?
Víctor M. Jáquez L.
Comment 26 2013-08-05 02:31:18 PDT
(In reply to comment #25) > (In reply to comment #24) > > > Confirming using a Nvidia gpu, the tearing is still there. > > Can you guys confirm whether you are seeing this with the version of GTK+ that reported to have fixed this issue? $ jh run ldd WebKitBuild/Debug/.libs/libwebkitgtk-3.0.so.0.19.3 | grep libgtk libgtk-3.so.0 => /home/sicom/WebKit/WebKitBuild/Dependencies/Root/lib/libgtk-3.so.0 (0xb2b16000) $ ls -la /home/sicom/WebKit/WebKitBuild/Dependencies/Root/lib/libgtk-3.so.0 lrwxrwxrwx. 1 sicom sicom 19 Aug 4 12:17 /home/sicom/WebKit/WebKitBuild/Dependencies/Root/lib/libgtk-3.so.0 -> libgtk-3.so.0.800.2 libgtk+-3.8.2
Zan Dobersek
Comment 27 2013-08-05 05:48:49 PDT
(In reply to comment #24) > (In reply to comment #22) > > I applied the patch and compiled WebKit with "Tools/Scripts/build-webkit --gtk --enable-webkit2 --disable-gtk-doc --enable-introspection=no --no-svg" and run the example with "Tools/Scripts/run-launcher --gtk --enable-accelerated-compositing=TRUE url" in GNOME Classic and I still can see the tearing. It's less noticeable, but it is still there. I think we should reopen this. > > Confirming using a Nvidia gpu, the tearing is still there. What drivers are you using? FWIW, I got no tearing after upgrading to 3.8 and using the Nvidia blob.
Víctor M. Jáquez L.
Comment 28 2013-08-05 06:02:15 PDT
(In reply to comment #27) > (In reply to comment #24) > > (In reply to comment #22) > > > I applied the patch and compiled WebKit with "Tools/Scripts/build-webkit --gtk --enable-webkit2 --disable-gtk-doc --enable-introspection=no --no-svg" and run the example with "Tools/Scripts/run-launcher --gtk --enable-accelerated-compositing=TRUE url" in GNOME Classic and I still can see the tearing. It's less noticeable, but it is still there. I think we should reopen this. > > > > Confirming using a Nvidia gpu, the tearing is still there. > > What drivers are you using? I'm using the closed nvidia blob as well. > > FWIW, I got no tearing after upgrading to 3.8 and using the Nvidia blob.
Zan Dobersek
Comment 29 2013-08-29 01:07:28 PDT
I've retested this yesterday. With a fresh build and using the default set of dependencies (i.e. GTK+ 3.6) I got no tearing (even though I experienced it about a month back, when upgrading to GTK+ 3.8 fixed the issue for me). I've tested with both nouveau and the Nvidia blob drivers on an Nvidia system, and with the i915 driver on an Intel system. I was using Ubuntu 13.04 in all cases. Can anyone else still reproduce this? I'm hoping this has been somehow fixed recently by changes in the WebKit tree.
Zan Dobersek
Comment 30 2013-09-05 06:53:13 PDT
To expand on comment #29, I also tested a build of a month-old revision (from around the time when r153518 landed -- comment #17), and while I was able to reproduce the tearing back then, I couldn't reproduce it this time. This is turning quite odd on my part, so I'd like to gather information about what software people still experiencing the problem are using. Specifically, I'm interested in the following: - distribution being used, along with the version, - the X system version being used if it differs from the version the distribution provides by default, - the graphics driver being used, along with the version. With this information I would hopefully be able to (again) reproduce the tearing on my hardware. Thanks in advance!
Víctor M. Jáquez L.
Comment 31 2013-10-09 10:53:25 PDT
(In reply to comment #30) Using r157159, GTK+ 3.8.2, debug build, GtkLaunch, and I still see the tearing in scenes with high movement. > To expand on comment #29, I also tested a build of a month-old revision (from around the time when r153518 landed -- comment #17), and while I was able to reproduce the tearing back then, I couldn't reproduce it this time. > > This is turning quite odd on my part, so I'd like to gather information about what software people still experiencing the problem are using. > > Specifically, I'm interested in the following: > - distribution being used, along with the version, Fedora17 > - the X system version being used if it differs from the version the distribution provides by default, xorg-x11-server-Xorg-1.12.4-7.fc17.i686 > - the graphics driver being used, along with the version. NVIDIA Driver version 304.88 > > With this information I would hopefully be able to (again) reproduce the tearing on my hardware. Thanks in advance!
Víctor M. Jáquez L.
Comment 32 2013-12-03 00:55:29 PST
Confirming what Zan Dobersek said in comment #20: Using Fedora20, with xorg-x11-server-Xorg-1.14.4-5.fc20.i686 gtk3-devel-3.10.5-1.fc20.i686 nvidia version 304.108 And there is _NOT_ tearing. Recent developments in Xorg and GTK+ added frame displaying control, avoiding the tearing effect. Hence, I'm closing this bug.
Xabier Rodríguez Calvar
Comment 33 2014-04-28 01:29:24 PDT
(In reply to comment #32) > Confirming what Zan Dobersek said in comment #20: > > Using Fedora20, with > > xorg-x11-server-Xorg-1.14.4-5.fc20.i686 > gtk3-devel-3.10.5-1.fc20.i686 > nvidia version 304.108 I am using xserver 1:7.7+7 in my Debian testing with the internal jhbuild dependencies in GNOME 3.8.4 in Flashback mode and I still see tearing. Víctor was with me so he can confirm it. I think we should reopen this.
Martin Robinson
Comment 34 2014-04-28 08:44:58 PDT
(In reply to comment #33) I am using xserver 1:7.7+7 in my Debian testing with the internal jhbuild dependencies in GNOME 3.8.4 in Flashback mode and I still see tearing. Víctor was with me so he can confirm it. > > I think we should reopen this. 1:7.7+7 is less than 1.14.4-5 right? Have you tried with a more recent version of Xorg?
Xabier Rodríguez Calvar
Comment 35 2014-04-28 09:15:34 PDT
(In reply to comment #34) > (In reply to comment #33) > I am using xserver 1:7.7+7 in my Debian testing with the internal jhbuild dependencies in GNOME 3.8.4 in Flashback mode and I still see tearing. Víctor was with me so he can confirm it. > > > > I think we should reopen this. > > 1:7.7+7 is less than 1.14.4-5 right? I am not sure, though it doesn't seem to. Any way to check it? > Have you tried with a more recent version of Xorg? Nope, it's the one that I have.
Zan Dobersek
Comment 36 2014-04-29 01:33:45 PDT
(In reply to comment #33) > (In reply to comment #32) > > Confirming what Zan Dobersek said in comment #20: > > > > Using Fedora20, with > > > > xorg-x11-server-Xorg-1.14.4-5.fc20.i686 > > gtk3-devel-3.10.5-1.fc20.i686 > > nvidia version 304.108 > > I am using xserver 1:7.7+7 in my Debian testing with the internal jhbuild dependencies in GNOME 3.8.4 in Flashback mode and I still see tearing. Víctor was with me so he can confirm it. > > I think we should reopen this. What graphics card? Driver?
Xabier Rodríguez Calvar
Comment 37 2014-04-29 01:46:13 PDT
(In reply to comment #36) > What graphics card? Driver? Intel Sandybridge with the i915.
Zan Dobersek
Comment 38 2014-04-29 01:55:33 PDT
I'll try and reproduce this. I think Victor and I were both using the Nvidia blob drivers when this got fixed on its own by using a combination of newer versions of GTK+ and the X server.
Note You need to log in before you can comment on or make changes to this bug.