Skip to content

[DNM] Tools: Topology2: Add DMIC Enhanced Audio Capture development tplg#9146

Closed
singalsu wants to merge 9 commits intothesofproject:mainfrom
singalsu:tplg2_add_dmic_tdfb_drc_capture
Closed

[DNM] Tools: Topology2: Add DMIC Enhanced Audio Capture development tplg#9146
singalsu wants to merge 9 commits intothesofproject:mainfrom
singalsu:tplg2_add_dmic_tdfb_drc_capture

Conversation

@singalsu
Copy link
Collaborator

@singalsu singalsu commented May 21, 2024

Do not merge!

This PR is preserved to support reporting a kernel issue with branched topologies.

A set of patched to set up capture pipeline with TDFB and DRC for DMIC capture.

Topologies sof-hda-efx-generic.png (processing in analog capture) and sof-hda-efx-generic-2ch.png (processing in DMIC capture) with this PR applied:
sof-hda-efx-generic
sof-hda-efx-generic-2ch


# TDFB pipeline
DMIC0_ENHANCED_CAPTURE "false"
DMIC0_TDFB_PCM_ID 200
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could I change this to e.g. 50, or something else after 49?

Copy link
Member

Choose a reason for hiding this comment

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

why after 49 if I may ask @singalsu ?

We could reshuffle my list, push the BT stuff that no one uses and give you a number after BPK, e.g.

PCM10 capture DMIC
PCM11 capture DMIC16kHz
PCM12 capture BufferedMic (aka KPB)
PCM13 capture TDFB Mic

it's the first prime number available.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That sounds good. But how to handle other beamformer enhanced endpoints, HDA analog and SDW? I would assume there's only single such capture endpoint in a device, but having dedicated PCMn might be more safe?

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure we want to deal with HDA analog capture, this could be super confusing.

For SoundWire it's a bit complicated. We only support 2ch capture, and we don't have any indication that there are 4 mics. It's been a problem for a while. And then we have lots of other issues to sort out, I am not super hot on adding new capabilities just now while we're having to deal with all kinds of ACPI/machine/codec variations.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not targeting to add features to SDW platfoms for v2.10, the code freeze is soon and I don't have time to test nor any devices to see myself that it works.

@singalsu
Copy link
Collaborator Author

Update: This PR version adds the beamformer and DRC to analog capture in enabled topologies. See the pictures above. The listed PRs are needed. In this version I rebase edited some files to apply to git main branch. Another small rebase is likely needed when this PR is applied on top of the other PRs. I did not want to duplicate all of those changes into this PR.

@singalsu singalsu changed the title [wip] Tools: Topology2: Add DMIC Enhanced Audio Capture development tplg [DNM] Tools: Topology2: Add DMIC Enhanced Audio Capture development tplg May 30, 2024
singalsu added 9 commits May 30, 2024 16:05
This change prepares for adding it instead to DMIC DAI copier
pipeline. There it will control mute/unmute for all possible
module copier connected other capture PCMs.

The pipeline object gain-capture is replaced with simpler
host-gateway-capture. The definition of DMIC0_HOST_PIPELINE_SINK
need to be changed from gain to host-copier.

With this patch, the typical DMIC capture path looks like:

dai-copier --> eqiir --> module-copier --> host-copier

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This change adds volume and switch  "Dmic0" into dai-copier pipeline.
It ensures that all capture from DMIC follows the mute key control
even if some other processing and PCMs are added to module copier.

The patch adds a new pipeline class
dai-copier-eqiir-gain-module-copier-capture. It is similar as
replaced dai-copier-eqiir-module-copier-capture but adds the
gain component.

The confusing DMIC0_DAI_GAIN (set to eqiir) is removed from all
top level topologies (nocodec, rt5682, sdw, hda).

After this a typical DMIC0 pipeline looks like:

dai-copier --> eqiir --> gain --> module-copier --> host-copier

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This change is for preparing to add more processing (beamformer)
and another PCM to a pipeline that connects to module-copier.4.2.
The pipeline class dai-copier-eqiir-module-copier-capture that is
used for DMIC is suitable for the purpose.

Before this change the analog capture pipelines are:

dai-copier.HDA.Analog.capture --> eqiir.4.1 --> host-copier.0.capture

With this change:

dai-copier.HDA.Analog.capture --> eqiir.4.1
                              --> module-copier.4.2
                              --> host-copier.0.capture

Addition of module-copier increases MCPS by 2.2 in TGL platform.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch updates similarly as for hda-generic the analog capture.
Before the patch the capture path pipelines are:

dai-copier.HDA.Analog.capture --> host-copier.0.capture

After this change:

dai-copier.HDA.Analog.capture --> eqiir.4.1
                              --> module-copier.4.2
                              --> host-copier.0.capture

To use the same dai-copier-eqiir-module-copier-capture tplg code
chunk as in hda-generic, the macros HDA_ANALOG_CAPTURE and
HDA_ANALOG_PLAYBACK_RATE were added.

The addition of IIR to capture mitigates the capture start transients
similarly as in hda-generic.

This change adds 7.7 MCPS from IIR, and 2.2 MCPS from module-copier
in TGL platform.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This change allows to disable and hide the control by omitting name
define if it is not useful in the topology. Also other ALSA controls
no more require mandatory name.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds a number of configuration blobs for the
time-domain fixed beamformer component. The blobs include
pass-through and generic narrow angle stereo beamforming for
two and four microphones line array systems.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds a DRC blob for DMIC capture and renames the
speaker blob.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds a capture pipeline with TDFB beamformer, DRC for
dynamic control, and new capture PCM to 2ch and 4ch DMIC topologies.
The names of updated topologies are sof-hda-efx-generic-2ch.tplg and
sof-hda-efx-generic-4ch.

The pipeline is enabled if DMIC0_ENHANCED_CAPTURE is set to true
in topologies build. They keys EFX_DMIC0_TDFB_PARAMS and
EFX_DMIC0_DRC_PARAMS control the configurations blobs use.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds a capture pipeline with TDFB beamformer, DRC for
dynamic control, and new capture PCM for analog capture. The name
of updated topology is sof-hda-efx-generic.tplg.

The pipeline is enabled if HDA_MIC_ENHANCED_CAPTURE is set to true
in topologies build. They keys EFX_HDA_MIC_TDFB_PARAMS and
EFX_HDA_MIC_DRC_PARAMS control the configurations blobs use.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
Copy link
Collaborator Author

This topology is obsolete, replaced by #9176.

@singalsu singalsu closed this Aug 27, 2024
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.

3 participants