From d9dda733ac4dabe0a7ab740501f97d3511feb67f Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 15 Mar 2024 16:38:11 +0200 Subject: [PATCH] Audio: Volume: Fix condition for identical ramp 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 --- src/audio/volume/volume.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/volume/volume.c b/src/audio/volume/volume.c index bf4833173002..7c888212c0f3 100644 --- a/src/audio/volume/volume.c +++ b/src/audio/volume/volume.c @@ -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; }