Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,13 @@ static int asrc_params(struct comp_dev *dev,

comp_info(dev, "asrc_params()");

#if CONFIG_IPC_MAJOR_4
ipc4_base_module_cfg_to_stream_params(&cd->ipc_config.base, pcm_params);
#endif

err = asrc_verify_params(dev, pcm_params);
if (err < 0) {
comp_err(dev, "src_params(): pcm params verification failed.");
comp_err(dev, "asrc_params(): pcm params verification failed.");
return -EINVAL;
}

Expand All @@ -553,6 +557,12 @@ static int asrc_params(struct comp_dev *dev,
source_c = buffer_acquire(sourceb);
sink_c = buffer_acquire(sinkb);

#if CONFIG_IPC_MAJOR_4
/* update the source/sink buffer formats. Sink rate will be modified below */
ipc4_update_buffer_format(source_c, &cd->ipc_config.base.audio_fmt);
ipc4_update_buffer_format(sink_c, &cd->ipc_config.base.audio_fmt);
#endif

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here - what's the effect of these changes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

same explanation, copier doesnt set the source/sink buffer until prepare. So asrc_params( will fail without it


/* Don't change sink rate if value from IPC is 0 (auto detect) */
if (asrc_get_sink_rate(&cd->ipc_config))
audio_stream_set_rate(&sink_c->stream, asrc_get_sink_rate(&cd->ipc_config));
Expand Down
Loading