Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.5.3
-
None
-
MacBook Pro 2019, 2,6 GHz 6 Core Intel Core i7
Sonoma 14.5
-
-
04399a733 (dev), 3a8ba8e5f (dev), dad3635dd (dev), 4f7dab478 (dev), 05d9a7b0f (dev), 2e9e92483 (dev), 9bdf85719 (dev), 3e1433e5b (dev), b2f4c1f38 (dev), 84ab62bee (6.8), c81457b8e (6.8), 6869c8bb1 (6.8), c1c095e39 (6.8), 7db13f862 (6.8), 61823de02 (6.8)
-
Multimedia wk 41-42, Multimedia wk 43-44
Description
When using QAudioDevice from Qt Multimedia you can end up having a deadlock while destructing or simply stopping already disconnected audio device. Qt tries to stop audio thread and waits for it but it never signals.
It doesn't happen on every mac device, however I find out it doesn't happen on M1 Max.
What I'm doing in more detail:
- Open QAudioDevice and begin reading audio input data
- Disconnect audio device physically
- QMediaDevices::audioInputsChanged signal is triggered
- In this signal I identify my device is no longer existing and I'm stopping or destroying QAudioDevice object
- It hangs in deadlock
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP * frame #0: 0x00007ff807bd9f7a libsystem_kernel.dylib`__psynch_cvwait + 10 frame #1: 0x00007ff807c176f3 libsystem_pthread.dylib`_pthread_cond_wait + 1211 frame #2: 0x0000000102ebfcab QtCore`QWaitConditionPrivate::wait(this=0x00007fb41e626e40, deadline=<unavailable>) at qwaitcondition_unix.cpp:87:24 [opt] frame #3: 0x0000000102ebfc1e QtCore`QWaitCondition::wait(this=0x00007fb41e626d08, mutex=0x00007fb41e626d00, deadline=(t1 = 9223372036854775807, t2 = 0, type = 1)) at qwaitcondition_unix.cpp:160:27 [opt] frame #4: 0x0000000102133b64 QtMultimedia`QDarwinAudioSource::stop() [inlined] QDarwinAudioSourceBuffer::wait(this=<unavailable>) at qdarwinaudiosource_p.h:111:36 [opt] frame #5: 0x0000000102133b43 QtMultimedia`QDarwinAudioSource::stop() [inlined] QDarwinAudioSource::audioThreadStop(this=0x00007fb417039d60) at qdarwinaudiosource.mm:856:24 [opt] frame #6: 0x0000000102133b1b QtMultimedia`QDarwinAudioSource::stop(this=0x00007fb417039d60) at qdarwinaudiosource.mm:726:9 [opt]
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-126816 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
596630,3 | QDarwinAudioSource::start - delay 'stop' while still in 'start' | dev | qt/qtmultimedia | Status: ABANDONED | 0 | 0 |
597630,8 | Rework QDarwinAudioSource with QAudioStateMachine | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
597634,9 | Cleanup in darwin audio source variables initialization | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
597639,10 | Make darwin audio source logic more robust | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
597818,8 | Fix conversion in darwin audio source | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
597832,13 | Add tests to audio sink and source with stop upon the first state change | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
597836,14 | Replace a boolean parameter in QAudioStateMachine with an enum | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
597841,15 | Fix minor styling issues in QDarwinAudioSource | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
597916,8 | Fix assert when audio sink reads from not open device | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
597917,8 | Fix namings in tst_qaudiosink and tst_qaudiosource | dev | qt/qtmultimedia | Status: MERGED | +2 | 0 |
598211,2 | Rework QDarwinAudioSource with QAudioStateMachine | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
598212,2 | Cleanup in darwin audio source variables initialization | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
598213,2 | Make darwin audio source logic more robust | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
598216,2 | Fix conversion in darwin audio source | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
598217,2 | Add tests to audio sink and source with stop upon the first state change | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
598218,2 | Replace a boolean parameter in QAudioStateMachine with an enum | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
598219,2 | Fix minor styling issues in QDarwinAudioSource | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
598220,2 | Fix assert when audio sink reads from not open device | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |
598221,2 | Fix namings in tst_qaudiosink and tst_qaudiosource | 6.8 | qt/qtmultimedia | Status: MERGED | +2 | 0 |