Skip to content

Commit 6061b96

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. In AEC case a feedback buffer is shared between two streams, one prepared DAI widget in the stream for producing feedback buffer is included in widget list for AEC stream 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 current stream for pipeline_param prepare. Signed-off-by: Rander Wang <rander.wang@intel.com>
1 parent 0741361 commit 6061b96

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

sound/soc/sof/sof-audio.c

Lines changed: 9 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,16 @@ 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 case that feedback buffer is shared between two stream, a prepared widget in another
619+
* stream for producing feedback buffer should be skipped since pipeline_params is built
620+
* based on the current stream, not feedback stream.
621+
*/
622+
if (swidget->prepared)
623+
continue;
624+
616625
str = "prepare";
617626
/*
618627
* When walking the list of connected widgets, the pipeline_params for each

0 commit comments

Comments
 (0)