Skip to content

Conversation

@ranj063
Copy link
Collaborator

@ranj063 ranj063 commented Sep 17, 2025

comp_verify_params does 3 things, update comp params based on buffer flags, then set buffer params based on comp params and then finally set the component period frames based on buffer frames. In the case of IPC4, buffer flags are unused, so there's no need to update comp params based on these flags. So, move the setting of buffer params during the modules binding call where the buffers are allocated. Finally, set the component period frames based on the module's params during module init.

Copilot AI review requested due to automatic review settings September 17, 2025 01:00
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 removes the use of comp_verify_params for IPC4 in the module adapter component and reorganizes parameter handling to avoid unnecessary operations. Since IPC4 doesn't use buffer flags, the component parameter updates based on these flags are eliminated.

  • Removed comp_verify_params calls from module adapter functions for IPC4
  • Moved buffer parameter setting to the component connection phase in ipc_comp_connect
  • Added component period frames setting during module initialization

Reviewed Changes

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

File Description
src/ipc/ipc4/helper.c Added buffer parameter setting during component connection for module adapters
src/audio/module_adapter/module_adapter.c Removed comp_verify_params calls and added period frames setting during initialization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ranj063 ranj063 force-pushed the fix/ipc4_comp_params branch from cfbe8c8 to 14ad55b Compare September 17, 2025 03:10
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

One comment about IPC3, otherwise looks good.

@ranj063 ranj063 force-pushed the fix/ipc4_comp_params branch from 14ad55b to e891b75 Compare September 18, 2025 04:24
Copy link
Collaborator

@softwarecki softwarecki left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to clean this up. It's very confusing when a function whose name suggests it's for verification is actually responsible for setting buffer parameters.

@ranj063
Copy link
Collaborator Author

ranj063 commented Sep 19, 2025

@softwarecki who can help me with the QB failures? looks like NVL failed all the tests?

@abonislawski
Copy link
Member

@ranj063 for general QB/devices questions please contact with @lrudyX

@lrudyX
Copy link

lrudyX commented Sep 24, 2025

Fails with 1 test. MTL
Once 2025-09-19 18:37:48
and second time today.
grabbed_fw_logs_0.txt

@ranj063 ranj063 force-pushed the fix/ipc4_comp_params branch from e891b75 to 5af4b1e Compare September 24, 2025 16:52
@softwarecki softwarecki self-requested a review September 30, 2025 08:04
@ranj063 ranj063 force-pushed the fix/ipc4_comp_params branch from 5af4b1e to 7ab8fd7 Compare September 30, 2025 17:27
@ranj063 ranj063 force-pushed the fix/ipc4_comp_params branch 2 times, most recently from 4f9b3ff to a5de9c0 Compare October 7, 2025 00:22
@ranj063 ranj063 force-pushed the fix/ipc4_comp_params branch from a5de9c0 to b5032d5 Compare October 7, 2025 16:26
struct module_config *dst = &mod->priv.cfg;
struct sof_ipc_stream_params params;
struct comp_buffer *buffer;
int sink_queue_id = bind_data->ipc4_data->extension.r.dst_queue;
Copy link
Collaborator

Choose a reason for hiding this comment

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

From the buffer's perspective, the sink is the source for the module. The adapter module looks at the buffer from the module's perspective, so it's the source for the module. To avoid discussion about the proper name, I suggest sticking with dst as it appears in the ipc4 structure.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, done

mod->stream_copy_single_to_single = !module_adapter_multi_sink_source_prepare(dev);

return 0;
return module_update_source_buffer_params(mod, bind_data);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be better to call module_update_source_buffer_params before calling the module's bind function? It will allow module_bind to use already configured buffer parameters and allow change some parameter if it decides

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I suppose that makes sense. Although going by today's logic that shouldnt happen because the buffer params arent updated until pipeline_prepare. But I think doing it before module_bind would make sense to make it more useful in the future.

rfree(mod->stream_params);

mod->stream_params = rzalloc(SOF_MEM_FLAG_USER,
mod->stream_params = rzalloc(SOF_MEM_FLAG_USER | SOF_MEM_FLAG_COHERENT,
Copy link
Collaborator

Choose a reason for hiding this comment

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

As I understand it, the module's bind function is called from the same core that the module is assigned to. Therefore, there's no need for this structure to be coherent.

Since this is the only place where this structure can be modified, I suggest marking the stream_params field as const and only perform a cache writeback in case someone from another core wants to look here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed.

@ranj063 ranj063 force-pushed the fix/ipc4_comp_params branch from b5032d5 to a29aff0 Compare October 8, 2025 16:43
@ranj063 ranj063 requested a review from abonislawski as a code owner October 8, 2025 16:43
… params

This will be used for converting the input/output audio formats in the
base config extension to the stream params format.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063 ranj063 force-pushed the fix/ipc4_comp_params branch from a29aff0 to 6a50158 Compare October 10, 2025 15:01
@ranj063
Copy link
Collaborator Author

ranj063 commented Oct 10, 2025

SOFCI TEST

comp_verify_params does 3 things, update comp params based on buffer
flags, then set buffer params based on comp params and then finally set
the component period frames based on buffer frames. In the case of
IPC4, buffer flags are unused, so there's no need to update comp params
based on these flags. So, move the setting of buffer params during the
modules binding call where the buffers are allocated. Finally, set the
component period frames based on the module's params and the device
period frames during module init

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063 ranj063 force-pushed the fix/ipc4_comp_params branch from 6a50158 to 23bf8d5 Compare October 10, 2025 23:27
@lgirdwood lgirdwood merged commit 3598a0b into thesofproject:main Oct 13, 2025
38 of 45 checks passed
@ranj063 ranj063 deleted the fix/ipc4_comp_params branch October 13, 2025 15:02
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.

7 participants