On Wed, Jul 5, 2023 at 9:45 AM Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com wrote:
[Adding Mark Brown - ASoC maintainer]
On 7/4/23 14:17, Peter Suti wrote
Hi,
I'm trying to create a sound card which has two codecs associated with one DAI. One codec is responsible for playback and the other one for capture. I can see in soc-pcm.c that __soc_pcm_hw_params() is checking if the stream is valid for the current codec with snd_soc_dai_stream_valid() and if it isn't it is not calling the hw_params() callback. But this check is not there in __soc_pcm_open() which calls snd_soc_dai_startup() for every codec. Can someone shed some light on this? Why is startup() called for codecs that don't support the current stream?
We have a similar issue but with the .trigger callback.
We will send a patch when the merge window closes, see https://github.com/thesofproject/linux/pull/4434
You may need a similar test for the startup?
Would it make sense to add this check for every callback then? I still don't really understand why only hw_params() and trigger() needs such a check.