Skip to content

Commit

Permalink
Audio: Volume: Workaround to prevent linear ramp when not requested
Browse files Browse the repository at this point in the history
This does not help other ramp types so need to find a common
way to prevent a ramp to happen when another channel is adjusted.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu committed Mar 15, 2024
1 parent b10cd5b commit 5687768
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/audio/volume/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,19 +322,25 @@ static inline void volume_ramp(struct processing_module *mod)

if (volume < tvolume) {
/* ramp up, check if ramp completed */
if (new_vol < tvolume)
if (new_vol < tvolume) {
cd->ramp_finished = false;
else
} else {
new_vol = tvolume;
cd->ramp_coef[i] = 0;
}

} else {
/* ramp down */
if (new_vol > tvolume)
if (new_vol > tvolume) {
cd->ramp_finished = false;
else
} else {
new_vol = tvolume;
cd->ramp_coef[i] = 0;
}
}
cd->volume[i] = new_vol;
}

/* assign other channel volume as the first calculated volume with same volume case */
for (i = cd->ramp_channel_counter; i < cd->channels; i++)
cd->volume[i] = cd->volume[0];
Expand Down

0 comments on commit 5687768

Please sign in to comment.