Skip to content

Commit

Permalink
ipc4: mixin/mixout: Remove redundant channel setup
Browse files Browse the repository at this point in the history
In channel remapping mode mixin sinks could have different number of
channels. Since channel remapping mode has been removed, no need to
support individual channel number setup for each sink.

Signed-off-by: Serhiy Katsyuba <[email protected]>
  • Loading branch information
serhiy-katsyuba-intel committed Dec 18, 2023
1 parent 70b36c9 commit d59ec03
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/audio/mixin_mixout/mixin_mixout.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ static int mixout_reset(struct processing_module *mod)
static int mixin_params(struct processing_module *mod)
{
struct sof_ipc_stream_params *params = mod->stream_params;
struct mixin_data *md = module_get_private_data(mod);
struct comp_dev *dev = mod->dev;
struct list_item *blist;
int ret;
Expand All @@ -617,26 +616,12 @@ static int mixin_params(struct processing_module *mod)
list_for_item(blist, &dev->bsink_list) {
struct comp_buffer *sink;
enum sof_ipc_frame frame_fmt, valid_fmt;
uint16_t sink_id;

sink = buffer_from_list(blist, PPL_DIR_DOWNSTREAM);

audio_stream_set_channels(&sink->stream,
mod->priv.cfg.base_cfg.audio_fmt.channels_count);

/* Applying channel remapping may produce sink stream with channel count
* different from source channel count.
*/
sink_id = IPC4_SRC_QUEUE_ID(buf_get_id(sink));
if (sink_id >= MIXIN_MAX_SINKS) {
comp_err(dev, "Sink index out of range: %u, max sink count: %u",
(uint32_t)sink_id, MIXIN_MAX_SINKS);
return -EINVAL;
}
if (md->sink_config[sink_id].mixer_mode == IPC4_MIXER_CHANNEL_REMAPPING_MODE)
audio_stream_set_channels(&sink->stream,
md->sink_config[sink_id].output_channel_count);

/* comp_verify_params() does not modify valid_sample_fmt (a BUG?),
* let's do this here
*/
Expand All @@ -649,8 +634,7 @@ static int mixin_params(struct processing_module *mod)
audio_stream_set_valid_fmt(&sink->stream, valid_fmt);
}

/* use BUFF_PARAMS_CHANNELS to skip updating channel count */
ret = comp_verify_params(dev, BUFF_PARAMS_CHANNELS, params);
ret = comp_verify_params(dev, 0, params);
if (ret < 0) {
comp_err(dev, "mixin_params(): comp_verify_params() failed!");
return -EINVAL;
Expand Down

0 comments on commit d59ec03

Please sign in to comment.