Skip to content

Conversation

@RanderWang
Copy link
Collaborator

No description provided.

@kv2019i kv2019i changed the title topology2: add aec support in nocdec topology2: add aec support in nocodec Mar 9, 2023
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general logic looks good, but we need to work on the naming and definitions. Is this specific to "google-rtc-audio-processing" or are parts of the PR something that apply to allt types of AEC modules? We need to identify which parts are specific to Google RTC, and which are generic definitions that can be used by all AEC implementes (current there are no others in SOF upstream but this is a very common type of DSP audio module).

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AEC is not a generic solution, there's just too many variants.

The other concern is that this is starting to be too much for a nocodec topology, which has become a dumping ground. We are not going to add all possible variants of aec, smart-amp, wov in nocodec.conf. We need to revisit the goals and how tests will be handled.

NAK NAK NAK.

@RanderWang RanderWang force-pushed the ipc4-aec-tplg branch 2 times, most recently from 0c57011 to 297604e Compare March 10, 2023 08:34
@RanderWang RanderWang changed the title topology2: add aec support in nocodec topology2: add google rtc aec support Mar 10, 2023
Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not ok with the assumption that the AEC is directly connected to a copier. This may or may not be true if noise suppression comes into play. That's why we introduced the 3 input paths (raw, AEC, AEC+NS).

In other words, we need to defer the connections to the very top level and not create artificial restrictions we'll have to undo later.

Adding @cujomalainey and @singalsu for additional comments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should never assume how an element is connected.

Specifically in this case, it's possible that there is a noise-suppression inserted before the host copier, or that there are two input paths, one with a direct host copier and one with the noise suppression.

I think we need to leave the choice of how an algorithm is inserted to the top-level topology. Don't introduce restrictions when we already know they don't always hold.

Copy link
Collaborator Author

@RanderWang RanderWang Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart In current plan, we have three pipelines for output: (1) raw (2) AEC (3) AEC+NS. This PR focus on pipeline (2) and if we have NS module, we will change one of AEC pipeline to AEC+NS.

Do you prefer to merge (2) and (3) with some flag ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RanderWang not following what you meant by "we will change one of AEC pipeline to AEC+NS".

It's the same AEC in both cases, no? This is a hierarchical set of paths.

Copy link
Member

@plbossart plbossart Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my understanding of the ask:

DMIC ---> copier ---> host
             |
             +------> AEC -----> copier -----> host
                                    |
                                    +----------> NS -------> copier -----------> host

Copy link
Collaborator Author

@RanderWang RanderWang Mar 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. My understanding is. The advantage is that it will skip 2 copiers to improve performance.

Copier DMIC -->   EQ -----> copier module ---------> host
                                    |----------------> AEC ------> host
                                    |------> AEC ------> NS---> host

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart we are planning to roll AEC out on spk+dmic, it would be good to leave a HS+HS-mic option for experimentation in the config for us to test with

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't get your point @cujomalainey. It might be easier to provide Rander with a picture of the desired topology...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image

Ideally we would have a copy of each of the above images for SPK+DMIC, and a copy of the second for HS + HS Mic on top of the standard volume only passthrough options

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant an image of how the noise reduction will be added @cujomalainey. I suggested a hierarchy in #7237 (comment) and @RanderWang suggested two separate instances of AEC in #7237 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart ah thanks I missed that, hierarchy is better, less instances.

@singalsu
Copy link
Collaborator

@RanderWang Can you share a tplgtool.py created picture of this topology?

@cujomalainey
Copy link
Contributor

Adding @cujomalainey and @singalsu for additional comments.

@plbossart thanks. @thesofproject/google should be CCed on all things related to our AEC and related components. Thanks

Copy link
Contributor

@cujomalainey cujomalainey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll reinforce this again as in my other PR. I will not approve commits that relate to google code if I don't have the documentation to approve what I am reviewing. please prioritize these documents

@RanderWang
Copy link
Collaborator Author

RanderWang commented Mar 14, 2023

I'll reinforce this again as in my other PR. I will not approve commits that relate to google code if I don't have the documentation to approve what I am reviewing. please prioritize these documents

According to the question, a documents of topology2 and ipc4 is needed. @lgirdwood this is a big task

@RanderWang
Copy link
Collaborator Author

@RanderWang Can you share a tplgtool.py created picture of this topology?

@singalsu Do we need gain for each pipeline ? if not we can remove them and one copier module so that we have better performance
sof-mtl-max98357a-rt5682-rtc-aec

@singalsu
Copy link
Collaborator

@RanderWang Can you share a tplgtool.py created picture of this topology?

@singalsu Do we need gain for each pipeline ? if not we can remove them and one copier module so that we have better performance

Thanks for the picture. I would place AEC up one layer and have and leave gains there after AEC as placeholder for other processing. Gain may be needed for mic mute feature anyway with some device button & led. But it depends on what the google rtc aec topology requirement is. Can you please comment @cujomalainey @johnylin76 .

@cujomalainey
Copy link
Contributor

I don't think we need gain on capture, I believe it includes an AGC @perahgren to correct me if I am wrong

@RanderWang
Copy link
Collaborator Author

@cujomalainey could you please help to answer #7237 (comment). What is your picture of pipeline ?

@RanderWang RanderWang force-pushed the ipc4-aec-tplg branch 3 times, most recently from f6a1ba8 to d8dacd0 Compare March 21, 2023 13:44
@RanderWang
Copy link
Collaborator Author

@plbossart @cujomalainey this diagram is for the pipeline. There is no NS support now, so I temporarily gain for NS. And Copier.SSP.8.1 provides loop back data of speaker playback stream.

DMIC ------->     copier ---> host
                    |
                    +------> AEC -----> copier -----> host
                                           |
                                           +----------> NS -------> copier host

aec1

@lgirdwood
Copy link
Member

I'll reinforce this again as in my other PR. I will not approve commits that relate to google code if I don't have the documentation to approve what I am reviewing. please prioritize these documents

According to the question, a documents of topology2 and ipc4 is needed. @lgirdwood this is a big task

Ack - @mmaka1 and @mwasko have some sof-docs text and diagrams now in progress to help explain the new features being upstreamed into sof-docs.
@jsarha can you have a look at topology2 and make sure we have the correct docs for the topology features being added here.
@cujomalainey are you able to add a FEATURE issue on sof-docs listing the areas that need more docs with some priority. This will help us prioritize new documentation.

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @RanderWang , all my concerns now addressed.

@sys-pt1s
Copy link

sys-pt1s commented Apr 6, 2023

Can one of the admins verify this patch?

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 28, 2023

@RanderWang Status of this?

@RanderWang
Copy link
Collaborator Author

RanderWang commented May 8, 2023

@RanderWang Status of this?

@kv2019i rebase to latest code. @cujomalainey do you have any comments ? If not, let's merge it.

@marc-hb
Copy link
Collaborator

marc-hb commented May 8, 2023

https://sof-ci.01.org/sofpr/PR7237/build7147/devicetest/index.html failed with some aplay errors.

PS: maybe a direct link to the new sof-docs would be useful?

@RanderWang
Copy link
Collaborator Author

https://sof-ci.01.org/sofpr/PR7237/build7147/devicetest/index.html failed with some aplay errors.

PS: maybe a direct link to the new sof-docs would be useful?

This PR only affects sof-mtl-max98357a-rt5682.conf, not the nocodec topology. sof-docs for google-rtc-aec ? Actually this PR follows the topology1 for google-rtc-aec and it is better for google to provide how their aec work.

@marc-hb
Copy link
Collaborator

marc-hb commented May 9, 2023

SOFCI TEST

Copy link
Contributor

@cujomalainey cujomalainey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getting close, thanks

Goolge rtc aec only supports 16bits input & output and 2 channels

Signed-off-by: Rander Wang <[email protected]>
This aec is connected to host copier

Signed-off-by: Rander Wang <[email protected]>
Top topology can include this conf file to enable google rtc aec

Signed-off-by: Rander Wang <[email protected]>
Add google rtc aec in topolog for chrome project

Signed-off-by: Rander Wang <[email protected]>
@RanderWang
Copy link
Collaborator Author

@cujomalainey updated, thanks

@cujomalainey cujomalainey merged commit 406e660 into thesofproject:main May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants