Skip to content

Conversation

@singalsu
Copy link
Collaborator

The first playback PCM is for AEC mic input via SSP0 LBM. The second playback PCM is for AEC reference via SSP2 LBM. The first capture PCM is the AEC output.

The AEC (mockup) can be run and tested with the topology like this:

$ aplay -Dhw:0,0 mic_clip.wav &
$ aplay -Dhw:0,2 ref_clip.wav &
$ arecord -Dhw:0,0 -f dat -d 10 output.wav

With AEC mockup version output.wav is mix of microphone and reference.

@singalsu
Copy link
Collaborator Author

The topology plot with tplgtool2.py:

sof-tgl-nocodec-rtcaec

@singalsu
Copy link
Collaborator Author

Note: I wasn't able to get a conventional AEC topology shape (*) to work so I changed the approach to be able to test module conversion for Google RTC audio processing. This topology is a minimalistic version for nocodec where AEC reference is captured from DAI as done with smart amplifiers (sof-mtl-max98357a-rt5682.tplg). Without smart amplifier the reference would be extracted in SOF with copier module.

(*)

playback host copier ----> copier module ----> dai copier
                                 |
                                 |
                                 v
capture host copier  <--------  AEC <--------- dai copier

@singalsu singalsu marked this pull request as ready for review September 26, 2023 15:37
@ranj063
Copy link
Collaborator

ranj063 commented Sep 26, 2023

@singalsu can we integrate the mock AEC into our regular nocodec tplg instead of this? That way we will be testing the 2 simultaneous capture DAIs configuration with our kernel

@singalsu
Copy link
Collaborator Author

singalsu commented Sep 26, 2023

@singalsu can we integrate the mock AEC into our regular nocodec tplg instead of this? That way we will be testing the 2 simultaneous capture DAIs configuration with our kernel

I'd prefer to have this as well, this also goes to development directory only so it won't be relased. This is so simple that it can run in testbench by developers.

Also this approach is simple to extend for other formats like s32 that is being added to be able to check them all somehow.

@singalsu singalsu requested a review from RanderWang September 27, 2023 07:54
@lgirdwood
Copy link
Member

@singalsu can we integrate the mock AEC into our regular nocodec tplg instead of this? That way we will be testing the 2 simultaneous capture DAIs configuration with our kernel

I'd prefer to have this as well, this also goes to development directory only so it won't be relased. This is so simple that it can run in testbench by developers.

Also this approach is simple to extend for other formats like s32 that is being added to be able to check them all somehow.

If this is intended for testbench, we can name it or add commentary to state this. The topology looks OK to me but needs @ranj063 to approve.

@singalsu
Copy link
Collaborator Author

singalsu commented Oct 3, 2023

"46 successful and 1 failing checks", rebase and retry

The first playback PCM is for AEC mic input via SSP0 LBM. The second
playback PCM is for AEC reference via SSP2 LBM. The first capture
PCM is the AEC output.

The AEC (mockup) can be run and tested with the topology like
this:

$ aplay -Dhw:0,0 mic_clip.wav &
$ aplay -Dhw:0,2 ref_clip.wav &
$ arecord -Dhw:0,0 -f dat -d 10 output.wav

With AEC mockup version output.wav is mix of microphone
and reference.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu singalsu force-pushed the tplg2_nocodec_add_rtcaec branch from 31b8158 to 40f69c5 Compare October 3, 2023 15:14
@lgirdwood
Copy link
Member

@ranj063 good for you ?

Copy link
Collaborator

@RanderWang RanderWang left a comment

Choose a reason for hiding this comment

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

4ch AEC is supported now, do you plan to support it ?

@singalsu
Copy link
Collaborator Author

singalsu commented Oct 9, 2023

4ch AEC is supported now, do you plan to support it ?

I did this to test the module conversion but it should be possible to create variants. Is the 4ch such that reference is 2ch, AEC is 4ch mic and 4ch out?

@RanderWang
Copy link
Collaborator

4ch AEC is supported now, do you plan to support it ?

I did this to test the module conversion but it should be possible to create variants. Is the 4ch such that reference is 2ch, AEC is 4ch mic and 4ch out?

we need 4ch ref.

@plbossart
Copy link
Member

@RanderWang @singalsu can we clarify the comments above? The echo reference cannot have more channels than what is actually rendered? The number of channels in the echo reference is not correlated with the number of channels in the microphone input, and it's not clear how reference channels might be created out of thin air?

@singalsu
Copy link
Collaborator Author

Yep, 4ch reference would make sense only with four separate speakers channels, not even 2-way stereo with woofer & tweeter should normally require such.

@RanderWang
Copy link
Collaborator

@RanderWang @singalsu can we clarify the comments above? The echo reference cannot have more channels than what is actually rendered? The number of channels in the echo reference is not correlated with the number of channels in the microphone input, and it's not clear how reference channels might be created out of thin air?

Sure we only need 2ch ref. We support 4ch dmic 351fe7e so I mentioned it.

@kv2019i
Copy link
Collaborator

kv2019i commented Oct 13, 2023

@ranj063 ping?

Others, @RanderWang @singalsu is this ready to go or not? It's hard to tell when you press approve but have comments asking for changes. :)

@singalsu
Copy link
Collaborator Author

@ranj063 ping?

Others, @RanderWang @singalsu is this ready to go or not? It's hard to tell when you press approve but have comments asking for changes. :)

On my behalf ready yes, I could test my work with this with sufficient confidence that things work. The 4ch can be added later as incremental change or now if preferred.

@RanderWang
Copy link
Collaborator

@ranj063 ping?

Others, @RanderWang @singalsu is this ready to go or not? It's hard to tell when you press approve but have comments asking for changes. :)

sure, it is ready for me

@lgirdwood lgirdwood merged commit 64fcebb into thesofproject:main Oct 16, 2023
@lgirdwood
Copy link
Member

4 channels can be added incrementally.

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.

6 participants