fixup! ASoC: soc-pcm: dpcm: fix playback/capture checks#2070
fixup! ASoC: soc-pcm: dpcm: fix playback/capture checks#2070plbossart merged 4 commits intothesofproject:topic/sof-devfrom
Conversation
|
Correct PR #2058 merged too quickly |
lyakh
left a comment
There was a problem hiding this comment.
Out of curiosity: was there a bug in the previous version or was it just less pretty?
db35317 to
4fb042b
Compare
|
@lyakh I followed your second example, I don't think we can avoid parsing all cpu_dais separately for capture and playback. |
lyakh
left a comment
There was a problem hiding this comment.
I think a common loop with all ifs embedded would work too, but this version does perhaps look better - it avoids re-testing the same condition and re-writing playback and capture variables on each iteration.
bardliao
left a comment
There was a problem hiding this comment.
Please don't merge it for now. It may not related to this PR, but somehow rtd->dai_link->dpcm_playback and rtd->dai_link->dpcm_capture are both 1 for every dai links. So, we will see "CPU DAI iDisp1 for rtd iDisp1 does not support capture" error. I checked sof_sdw.c and we set dpcm_playback and dpcm_capture properly.
473c24a
4fb042b to
473c24a
Compare
It's not clear why specific FE dailinks use capture_only flags, likely blind copy/paste from Chromebook driver to the other. Replace by dpcm_capture, this will make future alignment and removal of flags easier. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
b38efd6
473c24a to
b38efd6
Compare
|
@dbaluta @bardliao @RanderWang @lyakh minor update with @lyakh 's optimization. |
|
Still an error in APL-nocodec mode: WTH? |
With additional checks on dailinks, we see errors such as [ 3.000418] sof-nocodec sof-nocodec: CPU DAI DMIC01 Pin for rtd NoCodec-6 does not support playback It's not clear why we set the dpcm_playback and dpcm_capture flags unconditionally, add a check on number of channels for each direction to avoid invalid configurations. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
|
Added one more commit with the following diff diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c
index ce053ba8f2e8..d03b5be31255 100644
--- a/sound/soc/sof/nocodec.c
+++ b/sound/soc/sof/nocodec.c
@@ -52,8 +52,10 @@ static int sof_nocodec_bes_setup(struct device *dev,
links[i].platforms->name = dev_name(dev);
links[i].codecs->dai_name = "snd-soc-dummy-dai";
links[i].codecs->name = "snd-soc-dummy";
- links[i].dpcm_playback = 1;
- links[i].dpcm_capture = 1;
+ if (ops->drv[i].playback.channels_min)
+ links[i].dpcm_playback = 1;
+ if (ops->drv[i].capture.channels_min)
+ links[i].dpcm_capture = 1;
}
card->dai_link = links;Not sure how all of this ever worked :-( |
Recent changes in the ASoC core prevent multi-cpu BE dailinks from
being used. DPCM does support multi-cpu DAIs for BE Dailinks, but not
for FE.
Handle the FE checks first, and make sure all DAIs support the same
capabilities within the same dailink.
BugLink: #2031
Fixes: 9b5db05 ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported")
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com