Skip to content

Commit 769e8f6

Browse files
ranj063broonie
authored andcommitted
ASoC: SOF: ipc4-topology: Fix pipeline params at the output of copier
When we walk the list of connected widgets from the source to the sink to prepare all widgets, the pipeline_params must be modified to reflect the output audio format at each widget. But, the copier only modifies the sample format in the pipeline_params. So, fix it to also modify the rate and channels. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230821113629.5017-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 56ecc16 commit 769e8f6

1 file changed

Lines changed: 1 addition & 26 deletions

File tree

sound/soc/sof/ipc4-topology.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,25 +1349,6 @@ static int snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_s
13491349
}
13501350
#endif
13511351

1352-
static int ipc4_set_fmt_mask(struct snd_mask *fmt, unsigned int bit_depth)
1353-
{
1354-
switch (bit_depth) {
1355-
case 16:
1356-
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
1357-
break;
1358-
case 24:
1359-
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
1360-
break;
1361-
case 32:
1362-
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S32_LE);
1363-
break;
1364-
default:
1365-
return -EINVAL;
1366-
}
1367-
1368-
return 0;
1369-
}
1370-
13711352
static int
13721353
sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
13731354
struct snd_pcm_hw_params *fe_params,
@@ -1381,8 +1362,6 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
13811362
struct snd_pcm_hw_params *ref_params;
13821363
struct sof_ipc4_copier *ipc4_copier;
13831364
struct snd_sof_dai *dai;
1384-
struct snd_mask *fmt;
1385-
int out_sample_valid_bits;
13861365
u32 gtw_cfg_config_length;
13871366
u32 dma_config_tlv_size = 0;
13881367
void **ipc_config_data;
@@ -1664,11 +1643,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
16641643
}
16651644

16661645
/* modify the input params for the next widget */
1667-
fmt = hw_param_mask(pipeline_params, SNDRV_PCM_HW_PARAM_FORMAT);
1668-
out_sample_valid_bits =
1669-
SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH(copier_data->out_format.fmt_cfg);
1670-
snd_mask_none(fmt);
1671-
ret = ipc4_set_fmt_mask(fmt, out_sample_valid_bits);
1646+
ret = sof_ipc4_update_hw_params(sdev, pipeline_params, &copier_data->out_format);
16721647
if (ret)
16731648
return ret;
16741649

0 commit comments

Comments
 (0)