Skip to content

Conversation

@abonislawski
Copy link
Member

This PR will fix IPC4 build for mux and allow basic IPC4 mux tests to pass.

Use IPC4_SINK_QUEUE_ID() macro to properly extract the queue ID from
buffer ID in IPC4 mux implementation.

This ensures correct indexing into the streams[] array when mapping
source buffers to their corresponding stream configurations.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Copilot AI review requested due to automatic review settings November 3, 2025 11:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes IPC4 configuration for the audio mux component by implementing proper blob handler usage and correcting data structure access patterns. The changes enable basic IPC4 mux tests to pass by ensuring configuration data is accessed through the blob handler rather than directly from component data.

Key changes:

  • Introduced blob handler usage for configuration data access in IPC4 implementation
  • Moved blob data handling from common prepare function to IPC-specific parameter functions
  • Added proper buffer ID handling for IPC4 with queue ID macros

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/audio/mux/mux_ipc4.c Updated to use blob handler for configuration access and fixed buffer ID handling
src/audio/mux/mux_ipc3.c Added blob data handling moved from common prepare function
src/audio/mux/mux.h Added conditional blob size definition for IPC4 vs IPC3
src/audio/mux/mux.c Removed blob handling from common prepare function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one open to check a pointer before use.

int mask = 1;
int i;

cfg = comp_get_data_blob(cd->model_handler, NULL, NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where do we check this ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initially blob is validated in init and prepare stages but this PR moves IPC3 checks so I also added now checks to ipc4 prepare


comp_dev_for_each_producer(dev, source) {
j = buf_get_id(source);
j = IPC4_SINK_QUEUE_ID(buf_get_id(source));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to check - it does have to be IPC4_SINK_QUEUE_ID(), not IPC4_SRC_QUEUE_ID()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Its easy to make mistake around sink/src macros but based on the latest fixes this is the correct approach
#10298

This patch will fix IPC4 configuration.

Move configuration blob handling from common mux_prepare() to IPC-specific
mux_params() implementations to better separate IPC3 and IPC4 code paths.

Changes:
- Remove config blob retrieval and validation from mux_prepare() in mux.c
- Move blob handling to mux_params() in mux_ipc3.c for IPC3 path
- Update mux_ipc4.c to use blob handler for config blob instead of
  storing in comp_data->md
- Define MUX_BLOB_MAX_SIZE conditionally based on IPC version:
  * IPC4: sizeof(struct mux_data)
  * IPC3: sizeof(struct sof_mux_config) + MUX_BLOB_STREAMS_SIZE

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
@lgirdwood
Copy link
Member

@abonislawski can you check Ci thanks !

@lgirdwood
Copy link
Member

looks like CI has got stuck - nodata reported for all target. rerun.

@lgirdwood
Copy link
Member

SOFCI TEST

@kv2019i kv2019i merged commit 8830729 into thesofproject:main Nov 6, 2025
38 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants