<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[On a Linux terminal, there is a recursive lock issue when using both video playback and recording functions simultaneously]]></title><description><![CDATA[<p dir="auto">I encountered a recursive lock issue in the QT program on a Linux terminal while using both recording and video playback functions. After investigation, it was found to be a lock re-entry issue with the Pulsaiudio plugin on QT.<br />
I use QAudioInput to obtain data for sound input (i.e. recording) and QAudioOutput to obtain data for sound output (i.e. video playback)</p>
<p dir="auto">GDB infos:<br />
(gdb) bt<br />
#0  0x0000007fa5227978 in __pthread_mutex_lock_full () from /lib/aarch64-linux-gnu/libpthread.so.0<br />
#1  0x0000007fa0d0e61c in pa_mutex_lock () from /usr/lib/aarch64-linux-gnu/pulseaudio/libpulsecommon-12.2.so<br />
#2  0x0000007f9c43924c in ?? () from /usr/local/bin/audio/libqtmedia_pulse.so<br />
#3  0x0000007f9c43985c in ?? () from /usr/local/bin/audio/libqtmedia_pulse.so<br />
#4  0x0000007fa48b5eec in ?? () from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5<br />
#5  0x0000007fa48ba718 in QTimer::timeout(QTimer::QPrivateSignal) () from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5<br />
#6  0x0000007fa48ade04 in QObject::event(QEvent*) () from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5<br />
#7  0x0000007fa56d4d8c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5<br />
#8  0x0000007fa56db72c in QApplication::notify(QObject*, QEvent*) () from /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5<br />
#9  0x0000007fa48807c8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5<br />
#10 0x0000007fa48d8350 in QTimerInfoList::activateTimers() () from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5<br />
#11 0x0000007fa48d8b98 in ?? () from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5<br />
#12 0x0000007fa7ebe674 in g_main_context_dispatch () from /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0<br />
#13 0x0000007fa7ebe8e8 in ?? () from /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0<br />
#14 0x0000007fa7ebe984 in g_main_context_iteration () from /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0<br />
#15 0x0000007fa48d8eac in QEventDispatcherGlib::processEvents(QFlags<a target="_blank" rel="noopener noreferrer nofollow ugc">QEventLoop::ProcessEventsFlag</a>) () from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5<br />
#16 0x0000007fa487f0f8 in QEventLoop::exec(QFlags<a target="_blank" rel="noopener noreferrer nofollow ugc">QEventLoop::ProcessEventsFlag</a>) () from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5<br />
#17 0x0000007fa4887968 in QCoreApplication::exec() () from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5<br />
#18 0x0000000000484f9c in main ()</p>
<p dir="auto">(gdb) p <em>(pthread_mutex_t</em>)$x0<br />
$2 = pthread_mutex_t = {Type = Recursive, Status = Acquired, possibly with waiters, Owner ID = 24138, Robust = No, Shared = No, Protocol = Priority inherit, Times acquired by the owner = 13662}</p>
<p dir="auto">The following is the QT source code that may be related to the issue:</p>
<pre><code>class QPulseAudioEngine : public QObject
{
    Q_OBJECT

public:
    QPulseAudioEngine(QObject *parent = 0);
    ~QPulseAudioEngine();

    static QPulseAudioEngine *instance();
    pa_threaded_mainloop *mainloop() { return m_mainLoop; }
    pa_context *context() { return m_context; }

    inline void lock()
    {
        if (m_mainLoop)
            pa_threaded_mainloop_lock(m_mainLoop);
    }

    inline void unlock()
    {
        if (m_mainLoop)
            pa_threaded_mainloop_unlock(m_mainLoop);
    }

    inline void wait(pa_operation *op)
    {
        while (m_mainLoop &amp;&amp; pa_operation_get_state(op) == PA_OPERATION_RUNNING)
            pa_threaded_mainloop_wait(m_mainLoop);
    }

</code></pre>
<p dir="auto">Has anyone encountered a similar situation before?</p>
]]></description><link>https://forum.qt.io/topic/164719/on-a-linux-terminal-there-is-a-recursive-lock-issue-when-using-both-video-playback-and-recording-functions-simultaneously</link><generator>RSS for Node</generator><lastBuildDate>Sun, 28 Jun 2026 13:29:43 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164719.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 May 2026 02:37:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to On a Linux terminal, there is a recursive lock issue when using both video playback and recording functions simultaneously on Tue, 02 Jun 2026 02:05:05 GMT]]></title><description><![CDATA[<p dir="auto">Alright, thank you for your suggestion. I'll give it a try</p>
]]></description><link>https://forum.qt.io/post/838514</link><guid isPermaLink="true">https://forum.qt.io/post/838514</guid><dc:creator><![CDATA[a_Wu]]></dc:creator><pubDate>Tue, 02 Jun 2026 02:05:05 GMT</pubDate></item><item><title><![CDATA[Reply to On a Linux terminal, there is a recursive lock issue when using both video playback and recording functions simultaneously on Mon, 01 Jun 2026 19:30:31 GMT]]></title><description><![CDATA[<p dir="auto">One thing you can test is the latest version of the Qt 5.15 series to see if it behaves in the same manner.</p>
]]></description><link>https://forum.qt.io/post/838509</link><guid isPermaLink="true">https://forum.qt.io/post/838509</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 01 Jun 2026 19:30:31 GMT</pubDate></item><item><title><![CDATA[Reply to On a Linux terminal, there is a recursive lock issue when using both video playback and recording functions simultaneously on Mon, 01 Jun 2026 02:28:00 GMT]]></title><description><![CDATA[<p dir="auto">Hello! Version is 5.15.2<br />
I found that there is another dependency library that may be using the same plugin Pulselink as QT's QAudioInput/QAudioOutput<br />
I have considered using QT 6, but I would rather determine what caused it<br />
Thank you.</p>
]]></description><link>https://forum.qt.io/post/838481</link><guid isPermaLink="true">https://forum.qt.io/post/838481</guid><dc:creator><![CDATA[a_Wu]]></dc:creator><pubDate>Mon, 01 Jun 2026 02:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to On a Linux terminal, there is a recursive lock issue when using both video playback and recording functions simultaneously on Sat, 30 May 2026 18:07:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/a_wu">@<bdi>a_Wu</bdi></a> use raw gstreamer pipeline code and drop Qt multimedia module.</p>
]]></description><link>https://forum.qt.io/post/838463</link><guid isPermaLink="true">https://forum.qt.io/post/838463</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Sat, 30 May 2026 18:07:49 GMT</pubDate></item><item><title><![CDATA[Reply to On a Linux terminal, there is a recursive lock issue when using both video playback and recording functions simultaneously on Fri, 29 May 2026 19:17:39 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Which version of Qt 5 is it ?<br />
Please note that Qt 5 has reached end of life a long time ago. You should consider moving to Qt 6.</p>
]]></description><link>https://forum.qt.io/post/838451</link><guid isPermaLink="true">https://forum.qt.io/post/838451</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 29 May 2026 19:17:39 GMT</pubDate></item></channel></rss>