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_value true was returned if target volumes are the
same. The check omitted the fact that start volumes for ramp
can be different.

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 15, 2024
1 parent a7abd06 commit b10cd5b
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 b10cd5b

Please sign in to comment.