Skip to content

Commit

Permalink
audio: asrc: Update stream params from base config
Browse files Browse the repository at this point in the history
The input stream params may not be updated by the source module. So
update the stream params from the config. Also, update the source/sink
ibuffer formats based on the base config audio format.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
  • Loading branch information
ranj063 authored and lgirdwood committed Jul 13, 2023
1 parent a177686 commit 7427d7f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ 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, "asrc_params(): pcm params verification failed.");
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

/* 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

0 comments on commit 7427d7f

Please sign in to comment.