Skip to content

Commit

Permalink
Audio: Volume: Jump volume directly to target when no ramp
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
singalsu committed Mar 20, 2024
1 parent 9d79ab6 commit 2a3984d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/audio/volume/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2a3984d

Please sign in to comment.