13
0

Fix bounce + latency update concurrency

When bouncing Region or Range, Session::write_one_track()
blocks processing, but takes no process-lock.

It is possible that a latency-callback arrives at the same
time while Route::bounce_process is active and calls ::run.

This can trigger a delayline.cc  Assertion `lm.locked ()' failed
in either thread.

Now latency-callbacks are postponed until the session can
process normally again
This commit is contained in:
Robin Gareus 2022-02-01 21:37:00 +01:00
parent a100d46249
commit 2eaa0183ef
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -298,7 +298,7 @@ AudioEngine::process_callback (pframes_t nframes)
*
* Note: this must be done without holding the _process_lock
*/
if (_session) {
if (_session && !_session->processing_blocked ()) {
bool lp = false;
bool lc = false;
if (g_atomic_int_compare_and_exchange (&_pending_playback_latency_callback, 1, 0)) {
@ -1469,7 +1469,7 @@ AudioEngine::latency_callback (bool for_playback)
return;
}
if (in_process_thread ()) {
if (in_process_thread () && ! _session->processing_blocked ()) {
/* internal backends emit the latency callback in the rt-callback,
* async to connect/disconnect or port creation/deletion.
* All is fine.