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 750185 - gl: Not showing any video on Android (skip glDrawElements, PowerVR SGX 544MP)
gl: Not showing any video on Android (skip glDrawElements, PowerVR SGX 544MP)
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal blocker
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-31 20:21 UTC by Sebastian Dröge (slomo)
Modified: 2015-06-10 11:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
log (78.05 KB, text/plain)
2015-05-31 20:21 UTC, Sebastian Dröge (slomo)
  Details
gl: OES_vertex_array_object is improperly implemented on PowerVR SGX 544MP (1.18 KB, patch)
2015-06-10 09:42 UTC, Sebastian Dröge (slomo)
none Details | Review
gl: OES_vertex_array_object is improperly implemented on PowerVR SGX 544MP (1.19 KB, patch)
2015-06-10 09:43 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2015-05-31 20:21:37 UTC
Created attachment 304328 [details]
log

A simple videotestsrc ! glimagesink pipeline on Android does not produce any video anymore on some devices. It works on Android 5.1.1 on my Nexus 7, but not on 4.2.2 on my phone.

adb logcat gives a lot of lines like the following:
E/IMGSRV  (11113): :0: skip glDrawElements (indices=1(0x0), bindBuffer=1)

Attached is a debug log with GST_DEBUG=3,gl*:6
Comment 1 Sebastian Dröge (slomo) 2015-05-31 20:24:22 UTC
FWIW, RGBA/BGRA also don't work, it's not specific to I420.
Comment 2 Matthew Waters (ystreet00) 2015-06-01 04:37:21 UTC
This smells like a broken glDrawElements with VAO's.  Probably a PowerVR driver bug.

This works on my android 4.1.2 and my 5.0 devices.  Both with Adreno GPU chips in them.

One test is to remove the :OES\0 from gst-libs/gst/gl/glprototypes/vao.h
Or set the four function pointers in that file to NULL after the extension checking has been performed and see if that helps your situation.
Comment 3 Sebastian Dröge (slomo) 2015-06-02 06:58:05 UTC
Yes, removing the OES\0 from voa.h makes it work again. So should we blacklist this driver? Only this version? ...?


Do you have any ideas why it could decide to skip glDrawElements()?
Comment 4 Matthew Waters (ystreet00) 2015-06-02 07:19:43 UTC
(In reply to Sebastian Dröge (slomo) from comment #3)
> Yes, removing the OES\0 from voa.h makes it work again. So should we
> blacklist this driver? Only this version? ...?

Not sure.  Depends on what other PowerVR chips are affected?  Let's start with just that version of the driver and extend it if necessary.

> Do you have any ideas why it could decide to skip glDrawElements()?

The revision section of https://www.khronos.org/registry/gles/extensions/OES/OES_vertex_array_object.txt mentions adding the ELEMENT_ARRAY_BUFFER_BINDING to the list of encapsulated state a month after the original extension was created so the driver could have been written against an old version of the extension.  GL is good like that.  I'm surprised we've gotten this far without introducing a blacklist system ;).
Comment 5 Sebastian Dröge (slomo) 2015-06-02 13:29:38 UTC
Which things would be blacklist then? The combination of
> GL_VERSION: OpenGL ES 2.0 build 1.9@2204701
> GL_VENDOR: Imagination Technologies
> GL_RENDERER: PowerVR SGX 544MP
? Or something else?
Comment 6 Matthew Waters (ystreet00) 2015-06-02 14:34:43 UTC
Whatever is specific enough :)

VENDOR + RENDERER gets you the platform.  VERSION gets you the version of the driver (if it exists after the GL version).  PC games typically uses a list of pci ids to choose features or possibly change runtime paths.  If something similar exists for android, we can use that as well.
Comment 7 Sebastian Dröge (slomo) 2015-06-09 21:00:06 UTC
So what do you suggest to do here? I don't think getting PCI IDs is a good idea here, it's very hardware specific and might not be possible everywhere.
Comment 8 Matthew Waters (ystreet00) 2015-06-10 02:38:31 UTC
The pci id is just another data point that also provides some information on the hardware.  In the end it's all heuristics so whatever limits the impact on other drivers/gpu's is fine.
Comment 9 Matthew Waters (ystreet00) 2015-06-10 02:39:42 UTC
Start with the exact output of the VENDOR/RENDERER/VERSION and we can expand it if necessary.
Comment 10 Sebastian Dröge (slomo) 2015-06-10 08:00:34 UTC
Alright, how would you suggest to do that? Just set those functions to NULL in an if block after GL initialization? Or do you have a more clever idea? :)
Comment 11 Matthew Waters (ystreet00) 2015-06-10 08:09:09 UTC
Just set the functions to NULL, if we need something else later, we'll deal with that when we get there :)
Comment 12 Sebastian Dröge (slomo) 2015-06-10 09:42:38 UTC
Created attachment 304929 [details] [review]
gl: OES_vertex_array_object is improperly implemented on PowerVR SGX 544MP
Comment 13 Sebastian Dröge (slomo) 2015-06-10 09:43:17 UTC
Created attachment 304930 [details] [review]
gl: OES_vertex_array_object is improperly implemented on PowerVR SGX 544MP
Comment 14 Sebastian Dröge (slomo) 2015-06-10 09:44:42 UTC
I didn't include the version in the check here as I think it's probably better to blacklist more things (and potentially work less efficient) than having a user just seeing black video. I also first considered to only check the prefix "PowerVR SGX" of the GL_RENDERER string.
Comment 15 Matthew Waters (ystreet00) 2015-06-10 10:17:00 UTC
Review of attachment 304930 [details] [review]:

Looks good
Comment 16 Sebastian Dröge (slomo) 2015-06-10 11:31:52 UTC
commit e7ca427ddbe4e89dbfc1f0279798891d75af39df
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Wed Jun 10 11:42:06 2015 +0200

    gl: OES_vertex_array_object is improperly implemented on PowerVR SGX 544MP
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750185