GNOME Bugzilla – Bug 588653
glimagesink fails to render I420 and YV12 frames properly
Last modified: 2010-02-09 11:20:37 UTC
gst-launch-0.10 videotestsrc ! video/x-raw-yuv,format='(fourcc)'YV12 ! glimagesink Displayed image is borken: its Y-component's width and height are halved (only top-left quadrant of the whole image is shown) and its U and V components are distorted/displaced beyond recognition. Sample output: http://bayimg.com/image/cacjcaacj.jpg Output is the same for I420 colorspace. For other supported colorspaces (packed ones, since I420 and YV12 are the only planar colorspaces supported) output is correct. Appears on Windows XP x64 SP2, ATI RV770, driver version 09.4
Created attachment 138438 [details] GLExt report
Works fine here (nvidia geforce go 7200). I'm extremely tired of different vendors, different chipsets, different driver versions, different platform all that interpret the spec in their own way. As far as I remember there was some workaround for ATI cards, maybe with a recent driver that's not needed anymore. CC-ing Julien as he might have more clue.
Could you try to recompile gst-plugins-gl after doing the following small change in the source code: line 935 of http://cgit.freedesktop.org/gstreamer/gst-plugins-gl/tree/gst-libs/gst/gl/gstgldisplay.c check this is not ATI Radeon HD. I mean, I have an old ATI (ATI Radeon 9800 pro), so maybe the radeon HD serie works just fine. (or replace if (g_ascii_strncasecmp ("ATI", (gchar *) glGetString (GL_VENDOR), 3) == 0), by if (0) )
Yes, that helps: diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index 0f4dbcf..64dd490 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -932,8 +932,9 @@ gst_gl_display_thread_init_upload (GstGLDisplay * display) { #ifndef OPENGL_ES2 gchar text_shader_upload_I420_YV12[2048]; - if (g_ascii_strncasecmp ("ATI", (gchar *) glGetString (GL_VENDOR), - 3) == 0) +/* if (g_ascii_strncasecmp ("ATI", (gchar *) glGetString (GL_VENDOR), + 3) == 0)*/ + if (0) sprintf (text_shader_upload_I420_YV12, display->text_shader_upload_I420_YV12, "*0.5", ""); else
ok so it seems that radeon HD serie is not concerned by this ati shader bug I noticed several months ago on a 9800. I have to test with the current most recent driver 9.3.1, to check if I still need the workaround with radeon 9800 pro, and radeon X800.
I have already the most recent driver (v 9.3.1) that my ATI Radeon 9800 Pro can support (not possible to install v9.7). So the shader ati bug is not fixed in the version 9.3.1 of the ati driver. So could you try to install the driver 9.3.1 and recompile gst-gl without any change. (would be cool if you could also try to test with 9.4) If gst-launch-0.10 videotestsrc ! "video/x-raw-yuv,format=(fourcc)YV12" ! glimagesink then we could check the driver version instead of only checking the GL_VENDOR.
I have a Panasonic Toughbook with integrated ATI Radeon Mobility HD 3650. I can confirm that removing the ATI specific from comment 3 and 4 fixes my issue as well. Driver Version from device properties: 8.493.0.0
ok good so I think we can say that there is no problem with every ATI HD devices. I mean we do not need the ATI specific thing. We need the check only for old ATI devices. So instead of only checking that there is a "ATI" string in the GL_VENDOR we could just check there is an "ATI" string and ( no "ATI Radeon HD" or "ATI Radeon Mobility HD" ) Could you make a patch ?
The problem is not in glimagesink but in glupload I've got the same half resolution scaled and weird color feedback problem with my rotten ATI Mobility Radeon HD 2600 driver GL_VERSION: 2.1.8575 GLEW_VERSION: 1.5.0 GL_SHADING_LANGUAGE_VERSION: 1.20 GL_RENDERER: ATI Mobility Radeon HD 2600 Here's the welcomed patch, but you could have spare other's time doing it :)
Created attachment 145654 [details] [review] fixes bug 588653 for (every?) ATI HD cards ATI drivers are rotten
Can we find a better way to discriminate which cards or drivers the current workaround applies to? I'd say the bug has been fixed either at driver level from 9.04 up or at hardware level from r600 up. As far as I can tell GL_VERSION doesn't include the Catalyst version... Any idea about how to get the exact driver version from GL_* strings? or to extrapolate it from the GL_VERSION string? maybe those minor version numbers have a meaning. I don't really think relying on the commercial model name is safe...
I think that relying on "ATI" is the worse thing to do, and that relying on the name of the non-bugged models is not a good solution. It would be better to add a test for known bugged models, and/or to add a glupload property to enable the workaround.
With other words: The actual ati "workaround" must not be the default. It was effective only for one bugged Radeon 9800, to my knowledge. (sorry if it's yours Julien :) New models are not affected, to our knowledge. The workaround is now the bug. The bug can be detected using glupload ! gldownoad and comparing input and output images. Most ati owners trying gst-plugins-gl won't submit a bug request and just stop trying, thinking the culprit is the ati proprietary driver. (Like me, one or two years ago.) It's good to promote nvidia, i'm not against this; but better promoting nvidia without bullying owners of not so bugged cards :) Beside this I hate having to reverse patch and patch again for each git pull :)
You are right, we have to put the correct code by default. And find a way to activate the workaround manually (a property or something else as you said)
As we have not a better solution or time to do more right more, just add the ATI Radeaon HD in the check commit 9ac2f4102ead9d62aceab43102c7eb5a53bec9d1 Author: Julien Isorce <julien.isorce@gmail.com> Date: Thu Nov 5 14:53:35 2009 +0100 gstgldisplay: no need the I420 work around if ATI Mobility fix #588653
oh sorry I missed the author: Luc Deschenaux <luc.deschenaux@freesurf.ch>