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 759131 - glimagesink compiled for GLES/EGL/dispmanx (without X) fails on RaspberryPi
glimagesink compiled for GLES/EGL/dispmanx (without X) fails on RaspberryPi
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-12-07 16:42 UTC by Florent Thiéry
Modified: 2015-12-10 19:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Florent Thiéry 2015-12-07 16:42:52 UTC
I compiled gst-plugins-bad from git using 1.6 branch using the following options

./autogen.sh CFLAGS="-I/opt/vc/include -I /opt/vc/include/interface/vcos/pthreads -I /opt/vc/include/interface/vmcs_host/linux/" LDFLAGS="-L/opt/vc/lib" --disable-gtk-doc --disable-opengl --enable-gles2 --enable-egl --disable-glx --disable-x11 --disable-wayland --enable-dispmanx

My environment is (Arch ARM):
* gst-plugins-base-libs 1.6.1-1
* gst-plugins-good 1.6.1-2
* gstreamer 1.6.1-1
* linux-firmware 20150904.6ebf5d5-1
* raspberrypi-firmware 20151130-1
* raspberrypi-firmware-bootloader 20151130-1
* raspberrypi-firmware-bootloader-x 20151130-1
* raspberrypi-firmware-examples 20151130-1
* raspberrypi-firmware-tools 20151130-1

Running Linux 4.1.13-1-ARCH

When starting a test pipeline, i get a critical error: "glGetString not defined or returned invalid value"

GST_GL_WINDOW=dispmanx GST_GL_API=gles2 GST_GL_PLATFORM=egl gst-launch-1.0 videotestsrc ! glimagesink
[root@rpitest ~]# GST_DEBUG=gl*:5 GST_GL_WINDOW=dispmanx GST_GL_API=gles2 GST_GL_PLATFORM=egl gst-launch-1.0 videotestsrc ! glimagesink
...
0:00:00.382713000 20964   0xac3a80 DEBUG            glimagesink gstglimagesink.c:746:_ensure_gl_setup:<sink> No current context, creating one for <gldisplayegl0>
0:00:00.383909000 20964   0xac3a80 DEBUG              gldisplay gstgldisplay.c:478:gst_gl_display_get_gl_context_for_thread:<gldisplayegl0> returning context (NULL) for thread (nil)
0:00:00.385433000 20964   0xac3a80 INFO               glcontext gstglcontext.c:311:gst_gl_context_new: creating a context for display <gldisplayegl0>, user choice:egl
0:00:00.387033000 20964   0xac3a80 DEBUG              glcontext gstglcontext.c:346:gst_gl_context_new:<glcontextegl0> Done creating context for display <gldisplayegl0> (user_choice:egl)
0:00:00.388236000 20964   0xac3a80 DEBUG              gldisplay gstgldisplay.c:411:gst_gl_display_create_context:<gldisplayegl0> creating context <glcontextegl0> from other context (NULL)
0:00:00.389662000 20964   0xac3a80 DEBUG              glcontext gstglcontext.c:931:gst_gl_context_create:<glcontextegl0>  other_context:(NULL)
0:00:00.390847000 20964   0xac3a80 INFO                glwindow gstglwindow.c:274:gst_gl_window_new: creating a window, user choice:dispmanx
0:00:00.391821000 20964   0xac3a80 DEBUG               glwindow gstglwindow_dispmanx_egl.c:105:gst_gl_window_dispmanx_egl_new: creating Dispmanx EGL window
0:00:00.395037000 20964   0xac3a80 DEBUG              glcontext gstglcontext.c:836:gst_gl_context_set_window:<glcontextegl0> window:<glwindowdispmanxegl0>
0:00:00.397161000 20964   0xac9860 DEBUG              glcontext gstglcontext.c:1235:gst_gl_context_create_thread:<glcontextegl0> Creating thread
0:00:00.398827000 20964   0xac9860 DEBUG               glwindow gstglwindow_dispmanx_egl.c:140:gst_gl_window_dispmanx_egl_open: Got display size: 1920x1080

0:00:00.400130000 20964   0xac9860 INFO               glcontext gstglcontext.c:1293:gst_gl_context_create_thread:<glcontextegl0> Attempting to create opengl context. user chosen api(s) (gles2), compiled api support (gles2) display api (opengl opengl3 gles2)
0:00:00.401446000 20964   0xac9860 DEBUG              glcontext gstglcontext_egl.c:242:gst_gl_context_egl_create_context:<glcontextegl0> Creating EGL context
0:00:00.402607000 20964   0xac9860 INFO               glcontext gstglcontext_egl.c:287:gst_gl_context_egl_create_context: egl initialized, version: 1.4
0:00:00.403708000 20964   0xac9860 INFO               glcontext gstglcontext_egl.c:336:gst_gl_context_egl_create_context: Using OpenGL|ES 2.0
0:00:00.404840000 20964   0xac9860 INFO               glcontext gstglcontext_egl.c:209:gst_gl_context_egl_choose_config: config set: 4, 1
0:00:00.406107000 20964   0xac9860 DEBUG              glcontext gstglcontext_egl.c:347:gst_gl_context_egl_create_context: about to create gl context
0:00:00.407811000 20964   0xac9860 INFO               glcontext gstglcontext_egl.c:384:gst_gl_context_egl_create_context: gl context created: 1
0:00:00.409358000 20964   0xac9860 DEBUG               glwindow gstglwindow_dispmanx_egl.c:192:window_resize: resizing invisible window from 0x0 to 16x16
0:00:00.418794000 20964   0xac9860 DEBUG              glcontext gstglcontext_egl.c:425:gst_gl_context_egl_create_context: Creating EGLSurface from window_handle 0xaed168
0:00:00.420343000 20964   0xac9860 INFO               glcontext gstglcontext_egl.c:457:gst_gl_context_egl_create_context: surface created
0:00:00.455736000 20964   0xac9860 INFO               glcontext gstglcontext.c:1304:gst_gl_context_create_thread:<glcontextegl0> created context
0:00:00.457011000 20964   0xac9860 DEBUG              glcontext gstglcontext.c:692:gst_gl_context_activate:<glcontextegl0> activate:1
0:00:00.458223000 20964   0xac9860 INFO               glcontext gstglcontext.c:1320:gst_gl_context_create_thread:<glcontextegl0> available GL APIs: gles2
0:00:00.459332000 20964   0xac9860 DEBUG              glcontext gstglcontext.c:1339:gst_gl_context_create_thread:<glcontextegl0> Filling info
0:00:00.460885000 20964   0xac3a80 INFO               glcontext gstglcontext.c:952:gst_gl_context_create:<glcontextegl0> gl thread created
0:00:00.462051000 20964   0xac3a80 WARN             glimagesink gstglimagesink.c:821:_ensure_gl_setup:<sink> error: glGetString not defined or returned invalid value
...
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayEGL\)\ gldisplayegl0";
ERROR: from element /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink: glGetString not defined or returned invalid value
Comment 1 Matthew Waters (ystreet00) 2015-12-07 22:44:25 UTC
You probably have mesa installed and it's picking up the mesa libraries at runtime.  To fix you need to either point LD_LIBRARY_PATH to /opt/vc/lib before the system libraries or pass --with-gles2-module-name and --with-egl-module-name pointing to /opt/vc/lib libraries.

You can check which libraries have been loaded with 'info sharedlibrary' in gdb at a strategic point (say gst_gl_display_new()).
Comment 2 Julien Isorce 2015-12-08 07:01:36 UTC
Florent could you try to do the swap I suggested in bug #759133 ?
Comment 3 Florent Thiéry 2015-12-10 10:04:00 UTC
Well, i may be mistinterpreting, but isnt the loaded library the good one ?


(gdb) b gst_gl_display_new
Function "gst_gl_display_new" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (gst_gl_display_new) pending.
(gdb) run videotestsrc num-buffers=1 ! glimagesink
Starting program: /usr/bin/gst-launch-1.0 videotestsrc num-buffers=1 ! glimagesink
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0xb6642470 (LWP 9966)]
[New Thread 0xb5e42470 (LWP 9967)]
[New Thread 0xb54ff470 (LWP 9968)]
[New Thread 0xb4cff470 (LWP 9969)]
Setting pipeline to PAUSED ...

Breakpoint 1, gst_gl_display_new () at gstgldisplay.c:178
178       GstGLDisplay *display = NULL;
(gdb) info sharedlibrary
From        To          Syms Read   Shared Object Library
0xb6fcf8f0  0xb6fea8b8  Yes (*)     /lib/ld-linux-armhf.so.3
0xb6ecd6d8  0xb6f81088  Yes (*)     /usr/lib/libgstreamer-1.0.so.0
0xb6e60b78  0xb6e95910  Yes (*)     /usr/lib/libgobject-2.0.so.0
0xb6d6e6b8  0xb6dec948  Yes (*)     /usr/lib/libglib-2.0.so.0
0xb6d34110  0xb6d4358c  Yes (*)     /usr/lib/libpthread.so.0
0xb6c05e20  0xb6cf77bc  Yes (*)     /usr/lib/libc.so.6
0xb6bd0160  0xb6bdef50  Yes         /usr/lib/libgcc_s.so.1
0xb6bafc88  0xb6bb0d70  Yes (*)     /usr/lib/libgmodule-2.0.so.0
0xb6b35da0  0xb6b68758  Yes (*)     /usr/lib/libm.so.6
0xb6b1c750  0xb6b20000  Yes (*)     /usr/lib/librt.so.1
0xb6b06ac0  0xb6b08fd8  Yes (*)     /usr/lib/libdl.so.2
0xb6af74a8  0xb6afc080  Yes (*)     /usr/lib/libffi.so.6
0xb6a82098  0xb6ad042c  Yes (*)     /usr/lib/libpcre.so.1
0xb6a68f40  0xb6a6e74c  Yes (*)     /usr/lib/gstreamer-1.0/libgstvideotestsrc.so
0xb69fa7a8  0xb6a41d04  Yes (*)     /usr/lib/libgstvideo-1.0.so.0
0xb698dfa8  0xb69d2198  Yes (*)     /usr/lib/libgstbase-1.0.so.0
0xb6914690  0xb6964054  Yes (*)     /usr/lib/liborc-0.4.so.0
0xb68d12e8  0xb68f0cfc  Yes         /root/.local/share/gstreamer-1.0/plugins/libgstopengl.so
0xb6883620  0xb68bcb30  Yes         /root/gst-plugins-bad/gst-libs/gst/gl/.libs/libgstgl-1.0.so.0
0xb68584a8  0xb68667bc  Yes         /root/gst-plugins-bad/gst-libs/gst/base/.libs/libgstbadbase-1.0.so.0
0xb683a8b0  0xb68445c0  Yes         /root/gst-plugins-bad/gst-libs/gst/video/.libs/libgstbadvideo-1.0.so.0
0xb680aa90  0xb681ed5c  Yes (*)     /usr/lib/libgstpbutils-1.0.so.0
0xb67e9950  0xb67f9d04  Yes (*)     /opt/vc/lib/libGLESv2.so
0xb67c3904  0xb67e3448  Yes (*)     /opt/vc/lib/libEGL.so
0xb67a28b8  0xb67afc60  Yes (*)     /opt/vc/lib/libbcm_host.so
0xb678fba4  0xb6794d78  Yes         /opt/vc/lib/libvcos.so
0xb67806ec  0xb6783be0  Yes (*)     /opt/vc/lib/libvchiq_arm.so
0xb6748860  0xb6769360  Yes (*)     /usr/lib/libpng16.so.16
0xb6705a70  0xb6730018  Yes (*)     /usr/lib/libjpeg.so.8
0xb66b29e0  0xb66e64c4  Yes (*)     /usr/lib/libgstaudio-1.0.so.0
0xb668899c  0xb6694b90  Yes (*)     /usr/lib/libz.so.1
0xb6649210  0xb666a9d8  Yes (*)     /usr/lib/libgsttag-1.0.so.0
(*): Shared library is missing debugging information.
(gdb) c
Continuing.
[New Thread 0xb44ff470 (LWP 10612)]
[New Thread 0xb3aff470 (LWP 10613)]
ERROR: Pipeline doesn't want to pause.
[New Thread 0xb3148470 (LWP 10614)]
[Thread 0xb3aff470 (LWP 10613) exited]
Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayEGL\)\ gldisplayegl0";
ERROR: from element /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink: glGetString not defined or returned invalid value
Additional debug info:
gstglimagesink.c(821): _ensure_gl_setup (): /GstPipeline:pipeline0/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink
Setting pipeline to NULL ...
Freeing pipeline ...
[Thread 0xb3148470 (LWP 10614) exited]
[Thread 0xb44ff470 (LWP 10612) exited]
[Thread 0xb4cff470 (LWP 9969) exited]
[Thread 0xb54ff470 (LWP 9968) exited]
[Thread 0xb5e42470 (LWP 9967) exited]
[Thread 0xb6642470 (LWP 9966) exited]
[Inferior 1 (process 9963) exited with code 0377]
Comment 4 Florent Thiéry 2015-12-10 10:46:09 UTC
Also, strace shows that it's trying to look after /usr/local/lib/libGLESv2.so and not finding it (probably forgot to configure with --prefix=/usr), so it's using the proper ones, right ?

GST_GL_WINDOW=dispmanx GST_GL_API=gles2 GST_GL_PLATFORM=egl strace -f gst-launch-1.0 videotestsrc num-buffers=1 ! glimagesink 2&> /tmp/strace.log

[root@rpitest ~]# grep .so /tmp/strace.log  | grep GL
open("/root/gst-plugins-bad/gst-libs/gst/gl/.libs/libGLESv2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/root/gst-plugins-bad/gst-libs/gst/base/.libs/libGLESv2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/root/gst-plugins-bad/gst-libs/gst/video/.libs/libGLESv2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/libGLESv2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/vc/lib/libGLESv2.so", O_RDONLY|O_CLOEXEC) = 3
open("/root/gst-plugins-bad/gst-libs/gst/gl/.libs/libEGL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/root/gst-plugins-bad/gst-libs/gst/base/.libs/libEGL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/root/gst-plugins-bad/gst-libs/gst/video/.libs/libEGL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/libEGL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/opt/vc/lib/libEGL.so", O_RDONLY|O_CLOEXEC) = 3
Comment 5 Florent Thiéry 2015-12-10 14:07:32 UTC
Hi

Matthew, you were right, --with-gles2-module-name=/opt/vc/lib/libGLESv2.so --with-egl-module-name=/opt/vc/lib/libEGL.so did the trick !

./configure CFLAGS="-I/opt/vc/include -I /opt/vc/include/interface/vcos/pthreads -I /opt/vc/include/interface/vmcs_host/linux/" LDFLAGS="-L/opt/vc/lib" --disable-gtk-doc --disable-opengl --enable-gles2 --enable-egl --disable-glx --disable-x11 --disable-wayland --enable-dispmanx  --with-gles2-module-name=/opt/vc/lib/libGLESv2.so --with-egl-module-name=/opt/vc/lib/libEGL.so

It now works:
GST_GL_WINDOW=dispmanx GST_GL_API=gles2 GST_GL_PLATFORM=egl gst-launch-1.0 videotestsrc pattern=1 ! glimagesink

As a side note, is that expected that the default colorspace is RGBA ?
Comment 6 Florent Thiéry 2015-12-10 18:55:33 UTC
Many thanks for your help, closing this.