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 588653 - glimagesink fails to render I420 and YV12 frames properly
glimagesink fails to render I420 and YV12 frames properly
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-gl
git master
Other Windows
: Normal minor
: 0.10.2
Assigned To: Julien Isorce
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-15 13:18 UTC by LRN
Modified: 2010-02-09 11:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GLExt report (3.95 KB, text/plain)
2009-07-15 13:19 UTC, LRN
  Details
fixes bug 588653 for (every?) ATI HD cards (915 bytes, patch)
2009-10-17 10:33 UTC, Luc
none Details | Review

Description LRN 2009-07-15 13:18:40 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
Comment 1 LRN 2009-07-15 13:19:17 UTC
Created attachment 138438 [details]
GLExt report
Comment 2 Filippo Argiolas 2009-07-15 13:55:50 UTC
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.
Comment 3 Julien Isorce 2009-07-15 14:45:08 UTC
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) )

Comment 4 LRN 2009-07-15 19:28:44 UTC
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


Comment 5 Julien Isorce 2009-07-16 08:42:31 UTC
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.


Comment 6 Julien Isorce 2009-07-28 11:43:21 UTC
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.

Comment 7 Jae Stutzman 2009-07-29 15:14:04 UTC
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
Comment 8 Julien Isorce 2009-07-29 17:13:37 UTC
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 ?
Comment 9 Luc 2009-10-17 10:24:23 UTC
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 :)
Comment 10 Luc 2009-10-17 10:33:53 UTC
Created attachment 145654 [details] [review]
fixes bug 588653 for (every?) ATI HD cards

ATI drivers are rotten
Comment 11 Filippo Argiolas 2009-10-17 10:52:31 UTC
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...
Comment 12 Luc 2009-10-31 03:50:40 UTC
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.
Comment 13 Luc 2009-11-04 01:26:49 UTC
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 :)
Comment 14 Julien Isorce 2009-11-04 08:02:54 UTC
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)
Comment 15 Julien Isorce 2009-11-05 14:15:00 UTC
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
Comment 16 Julien Isorce 2009-11-05 14:16:57 UTC
oh sorry I missed the author: Luc Deschenaux <luc.deschenaux@freesurf.ch>