Skip to content
Open
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
19 changes: 17 additions & 2 deletions src/audio/module_adapter/module_adapter_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +129 to +130
{
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.
Expand Down Expand Up @@ -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;
Expand Down
Loading