From 49ffcd0d9d2098e479bf93d5d48ad3c1e981b00e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 30 Apr 2015 02:00:50 +0200 Subject: [PATCH] clamp DSP load displsy 100% & relax LPF. --- libs/backends/alsa/alsa_audiobackend.cc | 4 ++-- libs/backends/coreaudio/coreaudio_backend.cc | 4 ++-- libs/backends/dummy/dummy_audiobackend.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index 4cb4710333..be0bbaf2f5 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -675,7 +675,7 @@ AlsaAudioBackend::freewheel (bool onoff) float AlsaAudioBackend::dsp_load () const { - return 100.f * _dsp_load; + return std::min(100.f, 100.f * _dsp_load); } size_t @@ -1544,7 +1544,7 @@ AlsaAudioBackend::main_process_thread () if (load > _dsp_load) { _dsp_load = load; } else { - const float a = .1 * _samples_per_period / _samplerate; + const float a = .2 * _samples_per_period / _samplerate; _dsp_load = _dsp_load + a * (load - _dsp_load) + 1e-12; } } diff --git a/libs/backends/coreaudio/coreaudio_backend.cc b/libs/backends/coreaudio/coreaudio_backend.cc index 94c179ab28..0593a35e40 100644 --- a/libs/backends/coreaudio/coreaudio_backend.cc +++ b/libs/backends/coreaudio/coreaudio_backend.cc @@ -554,7 +554,7 @@ CoreAudioBackend::freewheel (bool onoff) float CoreAudioBackend::dsp_load () const { - return 100.f * _dsp_load; + return std::min(100.f, 100.f * _dsp_load); } size_t @@ -1589,7 +1589,7 @@ CoreAudioBackend::process_callback (const uint32_t n_samples, const uint64_t hos if (load > _dsp_load) { _dsp_load = load; } else { - const float a = .1 * _samples_per_period / _samplerate; + const float a = .2 * _samples_per_period / _samplerate; _dsp_load = _dsp_load + a * (load - _dsp_load) + 1e-12; } diff --git a/libs/backends/dummy/dummy_audiobackend.cc b/libs/backends/dummy/dummy_audiobackend.cc index 1ba91f39dd..4d19dca9dd 100644 --- a/libs/backends/dummy/dummy_audiobackend.cc +++ b/libs/backends/dummy/dummy_audiobackend.cc @@ -1248,7 +1248,7 @@ DummyAudioBackend::main_process_thread () if (load > _dsp_load) { _dsp_load = load; } else { - const float a = .1 * _samples_per_period / _samplerate; + const float a = .2 * _samples_per_period / _samplerate; _dsp_load = _dsp_load + a * (load - _dsp_load) + 1e-12; } }