Skip to content

Commit

Permalink
Audio: Volume: Fix condition for identical ramp
Browse files Browse the repository at this point in the history
The "is_same_volume=true" was returned if target volumes for
all channels are the same. The check omitted the fact that
start volumes for ramp can be different, e.g. one channel is
attenuated while others are 0 dB.

This change fixes the random ignore of volume ramp and smooth
transition when a volume control is changed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu committed Mar 19, 2024
1 parent 5b39f73 commit 4cf60f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/audio/volume/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void volume_set_ramp_channel_counter(struct vol_data *cd, uint32_t channels_coun
bool is_same_volume = true;

for (i = 1; i < channels_count; i++) {
if (cd->tvolume[0] != cd->tvolume[i]) {
if (cd->tvolume[0] != cd->tvolume[i] || cd->volume[0] != cd->volume[i]) {
is_same_volume = false;
break;
}
Expand Down

0 comments on commit 4cf60f1

Please sign in to comment.