13
0

Reset DSP load on backend re-start and after freewheeling

This commit is contained in:
Robin Gareus 2020-03-30 16:58:55 +02:00
parent 27b2794133
commit a8ff35accb
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 13 additions and 0 deletions

View File

@ -2107,6 +2107,7 @@ AlsaAudioBackend::main_process_thread ()
Glib::usleep (1000000 * (_samples_per_period / _samplerate ));
}
_dsp_load_calc.reset ();
_pcmi->pcm_start ();
while (_run) {
@ -2124,6 +2125,7 @@ AlsaAudioBackend::main_process_thread ()
_pcmi->pcm_stop ();
_pcmi->pcm_start ();
drain_slaves = true;
_dsp_load_calc.reset ();
}
}

View File

@ -708,6 +708,7 @@ CoreAudioBackend::_start (bool for_latency_measurement)
_port_change_flag = true;
pre_process ();
_dsp_load_calc.reset ();
// all systems go.
_pcmio->set_xrun_callback (xrun_callback_ptr, this);
_preinit = false;
@ -1797,6 +1798,7 @@ CoreAudioBackend::process_callback (const uint32_t n_samples, const uint64_t hos
if (!_run || _freewheel || _preinit) {
// NB if we return 1, the output is
// zeroed by the coreaudio callback
_dsp_load_calc.reset ();
return 1;
}

View File

@ -684,6 +684,8 @@ PortAudioBackend::_start (bool for_latency_measurement)
engine.reconnect_ports ();
_port_change_flag = false;
_dsp_calc.reset ();
if (_use_blocking_api) {
if (!start_blocking_process_thread()) {
return ProcessThreadStartError;
@ -925,6 +927,7 @@ PortAudioBackend::freewheel_process_thread()
_freewheel_ack = false; // prepare next handshake
_midiio->set_enabled(true);
engine.freewheel_callback (_freewheeling);
_dsp_calc.reset ();
} else {
first_run = true;
_freewheel = true;
@ -1883,11 +1886,15 @@ PortAudioBackend::blocking_process_thread ()
DWORD tid = GetCurrentThreadId ();
DEBUG_THREADS (string_compose ("Process Thread Master ID: %1\n", tid));
_dsp_calc.reset ();
while (_run) {
if (_freewheeling != _freewheel) {
_freewheel = _freewheeling;
engine.freewheel_callback (_freewheel);
if (!_freewheel) {
_dsp_calc.reset ();
}
}
if (!_freewheel) {

View File

@ -1412,6 +1412,7 @@ PulseAudioBackend::main_process_thread ()
}
}
_dsp_load_calc.reset ();
stream_latency_update_cb (p_stream, this);
while (_run) {
@ -1436,6 +1437,7 @@ PulseAudioBackend::main_process_thread ()
if (!sync_pulse (pa_stream_flush (p_stream, stream_operation_cb, this)) || !_operation_succeeded) {
break;
}
_dsp_load_calc.reset ();
}
}