From 2a3984db575e2f5297b669f0f58893368dc208d8 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Wed, 20 Mar 2024 17:20:03 +0200 Subject: [PATCH] Audio: Volume: Jump volume directly to target when no ramp This ensures that volume for a channel changes immediately after receiving the control if ramp duration is zero or if type is no fade. Signed-off-by: Seppo Ingalsuo --- src/audio/volume/volume.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/audio/volume/volume.c b/src/audio/volume/volume.c index 7c888212c0f3..499fd67ff767 100644 --- a/src/audio/volume/volume.c +++ b/src/audio/volume/volume.c @@ -513,6 +513,9 @@ int volume_set_chan(struct processing_module *mod, int chan, if (cd->ramp_type == SOF_VOLUME_LINEAR || cd->ramp_type == SOF_VOLUME_LINEAR_ZC) set_linear_ramp_coef(cd, chan, constant_rate_ramp); + if (!cd->initial_ramp || cd->ramp_type == SOF_VOLUME_WINDOWS_NO_FADE) + cd->volume[chan] = v; + return 0; }