GNOME Bugzilla – Bug 758861
wavparse: deadlock under some conditions
Last modified: 2015-12-01 14:35:45 UTC
Playing back wav files through QtMultimedia on Linux leads sometimes to a deadlock in/below wavparse. Not sure if this is a gstreamer-bug or a Qt-bug. But according to a quick look of thiagoss on IRC this might well be a gstreamer-bug. This occurs both on gst 1.6.x and gst 0.10 (which is still the default for QtMultimedia). Test-application and backtrace can be found in the corresponding ticket of QtMultimedia: https://bugreports.qt.io/browse/QTBUG-49689 https://bugreports.qt.io/secure/attachment/52628/trace2.log
I think the problem is in QtMultimedia, in QAppSrc, on the "need-data" signal, it uses QMetaObject::invokeMethod with Qt::AutoConnection, which probably makes the call happen on the main thread. But the main thread is already busy doing the seek.
There is also a bug in wavparse that it doesn't flush upstream, I'm working on this part.
Created attachment 316568 [details] [review] wavparse: flush upstream when seeking in pull mode Makes sure upstream will unblock and return the thread so that seeking can continue
Would it be easy to have this flush-upstream check added to validate? Perhaps it would be useful to verify this for all our other demuxers.
You are both right: - Oliver: on_need_data() changes thread to the GUI thread via the QueuedConnection to pushDataToAppSrc, which seems weird from gstreamer's point of view. Might be because of the thread affinity of the QIODevice involved? - thiagos: I can't reproduce the (dead)lock with your patch. Pls push if possible! Thank you guys!
commit 763a7e5265f95002eb85bdf57b2899499cd2f04a Author: Thiago Santos <thiagoss@osg.samsung.com> Date: Tue Dec 1 00:03:21 2015 -0300 wavparse: flush upstream when seeking in pull mode Makes sure upstream will unblock and return the thread so that seeking can continue https://bugzilla.gnome.org/show_bug.cgi?id=758861 Also merged to 1.6: commit 9bbcec9191d655118e3b0b6d36aebf43b09d2e0d Author: Thiago Santos <thiagoss@osg.samsung.com> Date: Tue Dec 1 00:03:21 2015 -0300 wavparse: flush upstream when seeking in pull mode Makes sure upstream will unblock and return the thread so that seeking can continue https://bugzilla.gnome.org/show_bug.cgi?id=758861