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 <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
Seppo Ingalsuo 2024-03-20 17:20:03 +02:00 committed by Kai Vehmanen
parent e23a663d13
commit bc506f12c8
1 changed files with 3 additions and 0 deletions

View File

@ -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) if (cd->ramp_type == SOF_VOLUME_LINEAR || cd->ramp_type == SOF_VOLUME_LINEAR_ZC)
set_linear_ramp_coef(cd, chan, constant_rate_ramp); 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; return 0;
} }