Re: [PATCH] ASoC: soc-pcm: dpcm: Only allow playback/capture if supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 454735f8fa92..77a680da366f 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2911,8 +2911,17 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
  	int i;
if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) {
-		playback = rtd->dai_link->dpcm_playback;
-		capture = rtd->dai_link->dpcm_capture;
+		cpu_dai = asoc_rtd_to_cpu(rtd, 0);
+		if (rtd->num_cpus > 1) {
+			dev_err(rtd->dev,
+				"DPCM doesn't support Multi CPU yet\n");
+			return -EINVAL;
+		}
+
+		playback = rtd->dai_link->dpcm_playback &&
+			   snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_PLAYBACK);
+		capture = rtd->dai_link->dpcm_capture &&
+			  snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_CAPTURE);

This commit introduces major regressions with SOF on CherryTrail and Broadwell:

    [   25.705750]  SSP2-Codec: ASoC: no backend playback stream
    [   27.923378]  SSP2-Codec: ASoC: no users playback at close - state

it's likely due to the check for min_channels > 0 in snd_soc_dai_stream_valid(), which wasn't a requirement before.

We are testing a fix [1] but other users of DPCM might be impacted.

Mark, this commit is on your for-5.7 branch but not on for-next? Not sure which SHA1 to use for the Fixes: tag

[1] https://github.com/thesofproject/linux/pull/2018/commits/4fa10638dca8aad7a320e85cc3e00b179b8de410



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux