Skip to content

Commit 6707fa0

Browse files
committed
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>
1 parent 0cb10a4 commit 6707fa0

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
@@ -1344,25 +1344,6 @@ static int snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_s
13441344
}
13451345
#endif
13461346

1347-
static int ipc4_set_fmt_mask(struct snd_mask *fmt, unsigned int bit_depth)
1348-
{
1349-
switch (bit_depth) {
1350-
case 16:
1351-
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
1352-
break;
1353-
case 24:
1354-
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
1355-
break;
1356-
case 32:
1357-
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S32_LE);
1358-
break;
1359-
default:
1360-
return -EINVAL;
1361-
}
1362-
1363-
return 0;
1364-
}
1365-
13661347
static int
13671348
sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
13681349
struct snd_pcm_hw_params *fe_params,
@@ -1378,8 +1359,6 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
13781359
struct snd_sof_dai *dai;
13791360
u32 gtw_cfg_config_length;
13801361
u32 dma_config_tlv_size = 0;
1381-
struct snd_mask *fmt;
1382-
int out_sample_valid_bits;
13831362
void **ipc_config_data;
13841363
int *ipc_config_size;
13851364
u32 **data;
@@ -1659,11 +1638,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
16591638
}
16601639

16611640
/* modify the input params for the next widget */
1662-
fmt = hw_param_mask(pipeline_params, SNDRV_PCM_HW_PARAM_FORMAT);
1663-
out_sample_valid_bits =
1664-
SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH(copier_data->out_format.fmt_cfg);
1665-
snd_mask_none(fmt);
1666-
ret = ipc4_set_fmt_mask(fmt, out_sample_valid_bits);
1641+
ret = sof_ipc4_update_hw_params(sdev, pipeline_params, &copier_data->out_format);
16671642
if (ret)
16681643
return ret;
16691644

0 commit comments

Comments
 (0)