From b5cbb1bbd70eec53fc01bd37136d4e3fad6ffc8e Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Wed, 5 Aug 2026 14:35:27 +0300 Subject: [PATCH] audio: phase vocoder: derive input format from module base_cfg This patch fixes the issue with the Phase Vocoder module producing strong rattle with other than s16 format decoded output from compress decoders such as MP3 and AAC. The pipeline bind path only propagates the container frame_fmt into the shared buffer between two modules; it does not populate valid_sample_fmt. As a result source_get_valid_fmt() on the phase vocoder's input returned the zero-initialised value (S16_LE), so the wrong processing variant was selected whenever the topology declared a valid bit depth other than 16. Signed-off-by: Seppo Ingalsuo --- src/audio/phase_vocoder/phase_vocoder.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/audio/phase_vocoder/phase_vocoder.c b/src/audio/phase_vocoder/phase_vocoder.c index b82bf700eb9e..b756dce72072 100644 --- a/src/audio/phase_vocoder/phase_vocoder.c +++ b/src/audio/phase_vocoder/phase_vocoder.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "phase_vocoder.h" @@ -177,6 +178,12 @@ static int phase_vocoder_prepare(struct processing_module *mod, struct sof_sourc return -EINVAL; } +#if CONFIG_IPC_MAJOR_4 + /* Push base_cfg.audio_fmt onto endpoints so valid_sample_fmt is not left at 0 (S16_LE). */ + ipc4_update_source_format(sources[0], &base_cfg->audio_fmt); + ipc4_update_sink_format(sinks[0], &base_cfg->audio_fmt); +#endif + /* get source data format */ cd->frame_bytes = source_get_frame_bytes(sources[0]); cd->stream_channels = source_get_channels(sources[0]);