Tweak engine startup, shorten initial silence timeout

see also 23baeee829
This commit is contained in:
Robin Gareus 2020-04-16 16:21:12 +02:00
parent 8ea608b3d9
commit daf9fe2550
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -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<BackendPortPtr>::const_iterator it = _system_inputs.begin (); it != _system_inputs.end (); ++it) {
memset ((*it)->get_buffer (_samples_per_period), 0, _samples_per_period * sizeof (Sample));