Skip to content

Commit 72b9006

Browse files
committed
Audio: Volume: Workaround to prevent linear ramp when not requested
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. TODO: It looks like the other changes addressed this issue. Should be possible to leave this out. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 1eff23d commit 72b9006

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/audio/volume/volume.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,19 +322,25 @@ static inline void volume_ramp(struct processing_module *mod)
322322

323323
if (volume < tvolume) {
324324
/* ramp up, check if ramp completed */
325-
if (new_vol < tvolume)
325+
if (new_vol < tvolume) {
326326
cd->ramp_finished = false;
327-
else
327+
} else {
328328
new_vol = tvolume;
329+
cd->ramp_coef[i] = 0;
330+
}
331+
329332
} else {
330333
/* ramp down */
331-
if (new_vol > tvolume)
334+
if (new_vol > tvolume) {
332335
cd->ramp_finished = false;
333-
else
336+
} else {
334337
new_vol = tvolume;
338+
cd->ramp_coef[i] = 0;
339+
}
335340
}
336341
cd->volume[i] = new_vol;
337342
}
343+
338344
/* assign other channel volume as the first calculated volume with same volume case */
339345
for (i = cd->ramp_channel_counter; i < cd->channels; i++)
340346
cd->volume[i] = cd->volume[0];

0 commit comments

Comments
 (0)