From 84ac213ef247f38720d407aea89dbdfa23b82083 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Fri, 2 Oct 2026 14:45:19 +0300 Subject: [PATCH] audio: module_adapter: ipc4: Allow probes module through channels check The channel check introduced in commit: cdb7f911bb15e ("audio: module_adapter: bound host channels_count at ipc4 init") does not let probes module through. Add extra condition to allows probes that relies on ipc4 probes implementation on Linux ASoC side, that initializes the whole base config as zero for probes module. Signed-off-by: Jyri Sarha --- .../module_adapter/module_adapter_ipc4.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/audio/module_adapter/module_adapter_ipc4.c b/src/audio/module_adapter/module_adapter_ipc4.c index 00ec3d057ab5..433196d4e6bd 100644 --- a/src/audio/module_adapter/module_adapter_ipc4.c +++ b/src/audio/module_adapter/module_adapter_ipc4.c @@ -126,6 +126,20 @@ int module_ext_init_decode(const struct comp_driver *drv, struct module_ext_init return 0; } +/* Check if entire base config is all zero, as it is with probe module */ +static bool is_probe_module(struct ipc4_base_module_cfg *base_cfg) +{ + const unsigned char *p = (const unsigned char *)base_cfg; + size_t s = sizeof(*base_cfg); + + for (size_t i = 0; i < s; i++) { + if (p[i] != 0) { + return false; + } + } + return true; +} + /* * \module adapter data initialize. * \param[in] dev - device. @@ -158,8 +172,9 @@ int module_adapter_init_data(struct comp_dev *dev, dst->size = cfgsz; /* Host-supplied channel count indexes PLATFORM_MAX_CHANNELS arrays. */ - if (dst->base_cfg.audio_fmt.channels_count == 0 || - dst->base_cfg.audio_fmt.channels_count > PLATFORM_MAX_CHANNELS) { + if ((dst->base_cfg.audio_fmt.channels_count == 0 || + dst->base_cfg.audio_fmt.channels_count > PLATFORM_MAX_CHANNELS) && + !is_probe_module(&dst->base_cfg)) { comp_err(dev, "invalid channels count %u", dst->base_cfg.audio_fmt.channels_count); return -EINVAL;