ASoC: SOF: ipc4-pcm: support multiple configs for BE DAIs
authorKai Vehmanen <kai.vehmanen@linux.intel.com>
Thu, 16 Mar 2023 14:14:57 +0000 (16:14 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 17 Mar 2023 13:05:51 +0000 (13:05 +0000)
commit279e52d6b9f366f9930a0f90ee84e7d0a6a27b26
tree8af51294bc7b013d8847a8af51ceb78d5f1a0a07
parent1d8777d21fbb36c4a0e103eb128ca86f9761e61c
ASoC: SOF: ipc4-pcm: support multiple configs for BE DAIs

Backend DAIs may support multiple audio formats. Modify pipeline
setup to select a suitable configuration based on topology and
frontend DAI runtime configuration.

For sampling rate, if one of the BE DAI configurations has
a sampling rate matching that of FE DAI, configure BE DAI to
this rate.

For sample format, the current code hardcodes DAI copier sample format
to 32bit for both playback and capture pipelines. This is not always
desired, so lift the limitation and set the sample format based on
topology definitions for the copiers. For capture pipelines, we want to
set the BE DAI pipeline format based on topology instead of using the FE
DAI format. This covers the common use-case where BE DAI outputs data at
a higher sample precision and sample width is reduced later in the
pipeline. Instead of hardcoding to 32bit, use the BE DAI copier output
format defined in topology.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230316141458.13940-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-pcm.c
sound/soc/sof/ipc4-topology.c