Skip to content

Commit

Permalink
volume: fix wrong volume ramp being chosen
Browse files Browse the repository at this point in the history
Fade out was not working due to wrong order of operations. Ramp type was
set up before the correct type was set, so the default was always used.

Signed-off-by: Tobiasz Dryjanski <[email protected]>
  • Loading branch information
tobonex authored and lgirdwood committed Apr 22, 2024
1 parent 30b3011 commit 8a84d02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/audio/volume/volume_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ static int volume_set_volume(struct processing_module *mod, const uint8_t *data,
return -EINVAL;
}

init_ramp(cd, cdata.curve_duration, cdata.target_volume);
channels_count = mod->priv.cfg.base_cfg.audio_fmt.channels_count;
if (channels_count > SOF_IPC_MAX_CHANNELS) {
comp_err(dev, "Invalid channels count %u", channels_count);
Expand All @@ -229,7 +228,7 @@ static int volume_set_volume(struct processing_module *mod, const uint8_t *data,
set_volume_ipc4(cd, i, cdata.target_volume,
cdata.curve_type,
cdata.curve_duration);

init_ramp(cd, cdata.curve_duration, cdata.target_volume);
volume_set_chan(mod, i, cd->tvolume[i], true);
}
}
Expand All @@ -241,7 +240,7 @@ static int volume_set_volume(struct processing_module *mod, const uint8_t *data,
cdata.target_volume,
cdata.curve_type,
cdata.curve_duration);

init_ramp(cd, cdata.curve_duration, cdata.target_volume);
volume_set_chan(mod, cdata.channel_id,
cd->tvolume[cdata.channel_id], true);
}
Expand Down

0 comments on commit 8a84d02

Please sign in to comment.