From c56313cea058b197aa47b53a47434be0bb1727a5 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 2 Jun 2023 00:28:43 +0200 Subject: [PATCH] Fix setting pretty-names when engine is restarted port-meta-data depends on the audioengine backend/device settings. Those are only available after the engine is started, not from within the backend's _start() method. This is is only relevant for callback based backends. Backends with a blocking process thread explicitly emit port-manager callbacks there before entering the main loop. --- libs/backends/coreaudio/coreaudio_backend.cc | 3 +-- libs/backends/portaudio/portaudio_backend.cc | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/backends/coreaudio/coreaudio_backend.cc b/libs/backends/coreaudio/coreaudio_backend.cc index 0f1b637026..15e8c9f8b9 100644 --- a/libs/backends/coreaudio/coreaudio_backend.cc +++ b/libs/backends/coreaudio/coreaudio_backend.cc @@ -703,9 +703,8 @@ CoreAudioBackend::_start (bool for_latency_measurement) engine.reconnect_ports (); - // force an initial registration_callback() & latency re-compute + // force an initial registration_callback() & latency re-compute _port_change_flag.store (1); - pre_process (); _dsp_load_calc.reset (); // all systems go. diff --git a/libs/backends/portaudio/portaudio_backend.cc b/libs/backends/portaudio/portaudio_backend.cc index c0bb2131fd..ab1044639a 100644 --- a/libs/backends/portaudio/portaudio_backend.cc +++ b/libs/backends/portaudio/portaudio_backend.cc @@ -702,6 +702,7 @@ PortAudioBackend::_start (bool for_latency_measurement) stop (); return ProcessThreadStartError; } + _port_change_flag.store (1); } return NoError;