From daf9fe25509de4360296f711ad0359b01750f70f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 16 Apr 2020 16:21:12 +0200 Subject: [PATCH] Tweak engine startup, shorten initial silence timeout see also 23baeee8293 --- libs/ardour/audioengine.cc | 2 +- libs/backends/alsa/alsa_audiobackend.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index db6956c08a..db13861bbc 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -726,7 +726,7 @@ AudioEngine::set_session (Session *s) SessionHandlePtr::set_session (s); if (_session) { - _init_countdown = std::max (8, (int)(_backend->sample_rate () / _backend->buffer_size ()) / 4); + _init_countdown = std::max (4, (int)(_backend->sample_rate () / _backend->buffer_size ()) / 8); } } diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index 5d07bc1419..86d3d0e8ba 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -1733,8 +1733,8 @@ AlsaAudioBackend::main_process_thread () const double sr_norm = 1e-6 * (double) _samplerate / (double)_samples_per_period; - /* warm up */ - int cnt = std::max (8, (int)(_samplerate / _samples_per_period) / 2); + /* warm up freewheel dry-run - see also AudioEngine _init_countdown */ + int cnt = std::max (4, (int)(_samplerate / _samples_per_period) / 8); for (int w = 0; w < cnt; ++w) { for (std::vector::const_iterator it = _system_inputs.begin (); it != _system_inputs.end (); ++it) { memset ((*it)->get_buffer (_samples_per_period), 0, _samples_per_period * sizeof (Sample));