forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 139
ASoC: SOF: sof-audio: skip prepared widgets when pipeline is prepared #4240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
RanderWang
wants to merge
1
commit into
thesofproject:topic/sof-dev
from
RanderWang:ipc4_prepare_refine
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RanderWang I'm not following the issue here. Even if you didn't have this check here, if the widget were already prepared and so were all it's sink widgets, the function prepare _widgets_in_path() would skip this anyway, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ranj063 yes, it is a little tricky. Let me explain it. For DMIC stream only support S32_LE and aec module use S16_LE format, we will use copier module to convert S32_LE to S16_LE. Please check the picture. If the stream is prepared from copier.SSP.10.1, this widget is prepared so it will be skipped and start to prepare google-rtc-aec.18.1. At this time pipeline params use S32_LE but google-rtc-aec.18.1 only support S16_LE, so we will get error "sof_ipc4_init_audio_fmt: Unsupported audio format: 48000Hz, 32bit, 2 channels". But if the stream is prepared from copier.DMIC.14.1, the copier.module.19.1 will change pipeline params to use S16_LE since we define the conversion in copier config, so the next prepared google-rtc-aec.18.1 will match this format. The problem is that we can't start from another pipeline since we may change pipeline params in current stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RanderWang I don't understand your explanations. what does the copier.SSP.10.1 provide to the google-rtc-aec.18.1 module? The echo reference? If yes, why can't we demote the output of the copier.SSP.10.1 to match what the AEC needs?
I also don't understand the notion of 'prepared' from different sources that may or may not all be available. what happens if we start/stop the playback, there's no way this sort of topology can adjust.
I also don't think this integration is quite right, as I mentioned in another PR you want the output of the AEC to go to the host AND to the noise suppression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RanderWang yes, it looks like you've got the wrong audio formats set for output pin 1 for copier.SSP.10.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SSP.10.1 is used for reference. The Copier.SSP.10.1 is prepared in another stream so it will be skipped by driver, so we use fe_params which uses S32_LE
Currently we build module params from source (DAI or HOST) and change the params in some modules like SRC or Copier and propagate params to sink module. We can't use incorrect source for prepare. Playback also get such issue if the host copier linked to another stream directly.
please check thesofproject/sof#7237 (comment). And It is also defined in chrome document that AEC is linked to noise suppression. We discussed in my WSR001 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, I am not going to move until we agree on the topology. You added 2 instances of AEC in thesofproject/sof#7237 and I don't see how this can fly.