Skip to content

Commit 9adbeb5

Browse files
committed
ASoC: SOF: sof-audio: skip prepared widgets when pipeline is prepared
When walking the list of connected widgets, the pipeline_params for each widget is modified by the source widget in the path in prepare case. The first source widget is a AIF type for playback and DAI type for capture case. For mixer cases, one prepared AIF or DAI widget in anther connected stream may be included in widget list and used for source widget. This will result to incorrect pipeline_params. This patch skip prepared widget in anther stream and use the widget in the same stream for pipeline_param prepare. Signed-off-by: Rander Wang <rander.wang@intel.com>
1 parent 0741361 commit 9adbeb5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sound/soc/sof/sof-audio.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ sof_walk_widgets_in_order(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm,
592592
return 0;
593593

594594
for_each_dapm_widgets(list, i, widget) {
595+
595596
/* starting widget for playback is AIF type */
596597
if (dir == SNDRV_PCM_STREAM_PLAYBACK && widget->id != snd_soc_dapm_aif_in)
597598
continue;
@@ -611,8 +612,15 @@ sof_walk_widgets_in_order(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm,
611612
break;
612613
case SOF_WIDGET_PREPARE:
613614
{
615+
struct snd_sof_widget *swidget = widget->dobj.private;
614616
struct snd_pcm_hw_params pipeline_params;
615617

618+
/* In mixer case a prepared widget in another stream should be skipped
619+
* since pipeline_params is built based on the orignal stream.
620+
*/
621+
if (swidget->prepared)
622+
continue;
623+
616624
str = "prepare";
617625
/*
618626
* When walking the list of connected widgets, the pipeline_params for each

0 commit comments

Comments
 (0)