Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio: Volume: Clear peak meter channel max values in prepare() #9411

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/audio/volume/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ void volume_reset_state(struct vol_data *cd)
cd->sample_rate_inv = 0;
cd->copy_gain = true;
cd->is_passthrough = false;

#if CONFIG_COMP_PEAK_VOL
memset(cd->peak_regs.peak_meter, 0, sizeof(cd->peak_regs.peak_meter));
#endif
}

void volume_prepare_ramp(struct comp_dev *dev, struct vol_data *cd)
Expand Down
2 changes: 1 addition & 1 deletion src/audio/volume/volume_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ int volume_init(struct processing_module *mod)
/* malloc memory to store temp peak volume 4 times to ensure the address
* is 8-byte aligned for multi-way xtensa intrinsic operations.
*/
cd->peak_vol = rmalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, vol_size);
cd->peak_vol = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, vol_size);
if (!cd->peak_vol) {
rfree(cd->vol);
rfree(cd);
Expand Down