Hi Morimoto-san,
Current soc_get_playback_capture() are checking validation of CPU/Codec like below
static int soc_get_playback_capture(...) { ... ^ if (dai_link->dynamic || dai_link->no_pcm) { (X) ... v } else { ^ ... | for_each_rtd_codec_dais(rtd, i, codec_dai) { | ... | if (snd_soc_dai_stream_valid(codec_dai, ...) && | snd_soc_dai_stream_valid(cpu_dai, ...)) (Y)(a) has_playback = 1; | if (snd_soc_dai_stream_valid(codec_dai, ...) && | snd_soc_dai_stream_valid(cpu_dai, ..)) | (b) has_capture = 1; | } v } ... }
(X) is for DPCM connection, (Y) is for Normal connection. In Normal connection (Y), it is handling CPU/Codec, and it will set has_playback/capture = 1 at (a)(b), but it means today is "at least one of CPU/Codec pair was valid" in multi CPU/Codec case.
This is wrong, it should be handled when "all CPU/Codec are valid". This patch fixup it.
I knew this code looked familiar and sure enough we've been there before in 2020. This code was introduced by
4f8721542f7b ASoC: core: use less strict tests for dailink capabilities
the initial stricter tests caused a number of regressions reported by Jerome Brunet so we lowered the bar from "all dais" to "at least one dai" to be backwards-compatible.
I don't think we can revisit this without hitting the same sort of issues.
Regards, -Pierre