Skip to content

Commit 133c744

Browse files
committed
volume: fix scaling function reset after max volume
Fix a generic issue where the scale_vol function pointer is not reset after volume reaches its maximum value. When volume hits max, is_passthrough is set to true and scale_vol points to the passthrough function. On subsequent volume decreases, is_passthrough remains set and the correct gain function is never re-selected, so the volume change has no audible effect. Fix by resetting is_passthrough to false and re-selecting scale_vol via set_volume_process() on every SOF_CTRL_CMD_VOLUME command, ensuring correct volume scaling in both directions. Signed-off-by: Sneha Voona <sneha.voona@amd.com>
1 parent 7dc0d17 commit 133c744

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/audio/volume/volume_ipc3.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ int volume_set_config(struct processing_module *mod, uint32_t config_id,
219219
volume_set_ramp_channel_counter(cd, cd->channels);
220220

221221
volume_ramp_check(mod);
222+
/* Update function pointer after all volume changes */
223+
if (comp_dev_get_first_data_consumer(dev) != NULL) {
224+
cd->is_passthrough = false;
225+
set_volume_process(cd, dev, false);
226+
}
222227
break;
223228

224229
case SOF_CTRL_CMD_SWITCH:

0 commit comments

Comments
 (0)