Skip to content

Commit

Permalink
Audio: module adapter: Fix module_set_configuration
Browse files Browse the repository at this point in the history
After commit 7d0a0c6 ("Audio: Module adapter: Pass entire cdata to
clients for all controls") md->ops->set_configuration gets the entire
cdata but module_set_configuration expects only cdata>data[0].data.

So, restore the pointer fragment to cdata->data[0].data.

With IPC4 in comp_data_blob_set() the use of
struct sof_ipc_ctrl_data pointer step is not done but the
fragment is treated as raw data payload without the header.

Signed-off-by: Daniel Baluta <[email protected]>
  • Loading branch information
dbaluta committed Apr 20, 2023
1 parent ffe0ce6 commit 9483c19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/audio/module_adapter/module/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,15 @@ int module_free(struct processing_module *mod)
int module_set_configuration(struct processing_module *mod,
uint32_t config_id,
enum module_cfg_fragment_position pos, size_t data_offset_size,
const uint8_t *fragment, size_t fragment_size, uint8_t *response,
const uint8_t *fragment_in, size_t fragment_size, uint8_t *response,
size_t response_size)
{
#if CONFIG_IPC_MAJOR_3
struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment_in;
const uint8_t *fragment = (const uint8_t *)cdata->data[0].data;
#elif CONFIG_IPC_MAJOR_4
const uint8_t *fragment = fragment_in;
#endif
struct module_data *md = &mod->priv;
struct comp_dev *dev = mod->dev;
size_t offset = 0;
Expand Down

0 comments on commit 9483c19

Please sign in to comment.