GNOME Bugzilla – Bug 745178
Crash when using multiple GL elements
Last modified: 2015-02-26 03:32:50 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.
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.
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.
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
Hmm, that makes my app segfault for some reason.
I updated and retested and it does flicker here on Nouveau.
I can't test multi-context nouveau due to crashes/hangs in libdrm. Intel works fine though.
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.