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 745178 - Crash when using multiple GL elements
Crash when using multiple GL elements
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-25 19:37 UTC by Isaac Smith
Modified: 2015-02-26 03:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Isaac Smith 2015-02-25 19:37:33 UTC
When using multiple GL elements in a pipeline, Gstreamer crashes with an XCB error:

$ gst-launch-1.0 gltestsrc ! glvideomixer name=m ! glimagesink gltestsrc ! m.
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'm': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
gst-launch-1.0: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Aborted

Calling Xlib's XInitThreads() from a C-based application fixes the issue. However, my program uses Python and Python's Xlib implementation doesn't implement XInitThreads.
Comment 1 Olivier Crête 2015-02-25 20:21:36 UTC
Run it as:

GST_GL_XINITTHREADS=1 gst-launch-1.0 gltestsrc ! glvideomixer name=m ! glimagesink gltestsrc ! m.

From python, you can probably use GTK+, Qt or another modern toolkit and those should call XInitThreads for you.
Comment 2 Nicolas Dufresne (ndufresne) 2015-02-25 20:30:03 UTC
I'm not convince, even though it does not crash, it flickrs like crazy. This is a sign something in the threading or texture lifetime is wrong.
Comment 3 Matthew Waters (ystreet00) 2015-02-26 00:20:12 UTC
Hmm, that *should* have only resulted in one GL context being created.  And it doesn't flicker here.  For python, you can use something along the lines of

https://lists.gnu.org/archive/html/commit-gnuradio/2014-01/msg00031.html
Comment 4 Isaac Smith 2015-02-26 00:29:05 UTC
Hmm, that makes my app segfault for some reason.
Comment 5 Nicolas Dufresne (ndufresne) 2015-02-26 02:13:41 UTC
I updated and retested and it does flicker here on Nouveau.
Comment 6 Matthew Waters (ystreet00) 2015-02-26 02:20:16 UTC
I can't test multi-context nouveau due to crashes/hangs in libdrm.  Intel works fine though.
Comment 7 Nicolas Dufresne (ndufresne) 2015-02-26 03:32:50 UTC
Ok, I just notice that the kernel log is full of errors. Looks like OS regression, so never mind. Same flickering happen sometimes in Weston itself.