ALSA plugin: Reduce mutex lock duration - #57
Conversation
To mitigate deadlock issues on switching the audio input device, this commit reduces the time m_deviceListMutex is locked by switching std::lock_guard and manual locking for std::unique_lock and deferring locking only to places where access to the device list is needed. Closes: psmokotnin#56
|
Regarding the display issues: I was just able to fix that by using a different audio interface. But I guess that's is unrelated to the original issue that this PR fixes. |
|
Any updates on this? |
|
@NexAdn Thanks for the PR. Sorry was very loaded the last time. This issue requires a more detailed investigation and the solution also. |
|
Well, from what the name suggests, I've now been using this fix for quite a while without any problems. If you think that my understanding of your locking mechanism here is wrong, please let me know. Then I can have a fresh look at it, if you lack the time or resources to do so. |
|
This PR doesn't solve the issue, I'll need more time to investigate the real reason for this deadlock and apply changes to this PR or I'll make a new fix for this issue. |
To mitigate deadlock issues on switching the audio input device, this commit reduces the time
m_deviceListMutexis locked by switchingstd::lock_guardand manual locking forstd::unique_lockand deferring locking only to places where access to the device list is needed.Important note: During testing I sometimes had issues where the RTA and sidebar level meter didn't work correctly with some input configurations (especially the time window and input source settings). But since I am unfamiliar with the codebase, I can't tell if this issue is related.
Closes: #56