Skip to content

Commit

Permalink
Tools: Topology2: Add beamformer and DRC to HDA analog capture
Browse files Browse the repository at this point in the history
This patch adds to analog microphone capture pipeline TDFB
beamformer and DRC for dynamic range control.

The enhanced host copier pipeline is enabled if
HDA_MIC_ENHANCED_CAPTURE is set to true in topologies build.
The keys EFX_HDA_MIC_TDFB_PARAMS and EFX_HDA_MIC_DRC_PARAMS
control the applied configurations blobs.

There is no processing applied to capture audio since the
topology is built with pass-through blobs. E.g. UCM2 should
set up processing with blobs those have effect.

The change impacts sof-hda-generic.tplg. The other topologies
with DMIC are kept as before without added processing. The
analog capture pipelines are before this change:

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

After:

dai-copier -> eqiir -> module-copier -> TDFB -> DRC -> host-copier

Signed-off-by: Seppo Ingalsuo <[email protected]>
  • Loading branch information
singalsu authored and kv2019i committed Sep 11, 2024
1 parent cf7f45e commit 707c0c5
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 5 deletions.
119 changes: 115 additions & 4 deletions tools/topology/topology2/cavs-mixin-mixout-hda.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<include/components/tdfb.conf>

Define {
ANALOG_PLAYBACK_PCM 'Analog Playback'
ANALOG_CAPTURE_PCM 'Analog Capture'
Expand All @@ -12,6 +14,7 @@ Define {
EFX_FIR_PARAMS 'passthrough'
EFX_IIR_PARAMS 'passthrough'
EFX_DRC_PARAMS 'passthrough'
HDA_MIC_ENHANCED_CAPTURE 'false'
}

# include deep buffer config if buffer size is in 1 - 1000 ms.
Expand Down Expand Up @@ -270,6 +273,91 @@ Object.Pipeline {
}
]
}

IncludeByKey.HDA_MIC_ENHANCED_CAPTURE {
"true" {
Object.Widget.tdfb.1 {
index 3
Object.Control {
bytes."1" {
name 'Analog Capture TDFB bytes'
max 16384
IncludeByKey.EFX_HDA_MIC_TDFB_PARAMS {
"line2_pass" "include/components/tdfb/line2_pass.conf"
"line2_generic_pm10deg" "include/components/tdfb/line2_generic_pm10deg_48khz.conf"
"line2_50mm" "include/components/tdfb/line2_50mm_pm0_30_90deg_48khz.conf"
"line2_68mm" "include/components/tdfb/line2_68mm_pm0_30_90deg_48khz.conf"
"line2_74mm" "include/components/tdfb/line2_74mm_pm0_30_90deg_48khz.conf"
}
}
mixer."1" {
name 'Analog Capture TDFB beam switch'
}
enum."1" {
name 'Analog Capture TDFB angle set enum'
}
# Tracking is disabled from this topology, causes high MCPS
#mixer."2" {
# name 'Analog Capture TDFB track switch'
#}
#enum."2" {
# name 'Analog Capture TDFB angle estimate enum'
#}
}
num_input_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_channels 2
in_bit_depth 32
in_valid_bit_depth 32
}
]
num_output_audio_formats 1
Object.Base.output_audio_format [
{
out_channels 2
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}

Object.Widget.drc.1 {
index 3
Object.Control {
bytes."1" {
name 'Analog Capture DRC bytes'
IncludeByKey.EFX_HDA_MIC_DRC_PARAMS {
"passthrough" "include/components/drc/passthrough.conf"
"amic_default" "include/components/drc/amic_default.conf"
}
}
mixer."1" {
name 'Analog Capture DRC switch'
}
}
num_input_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
num_output_audio_formats 1
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
}

Object.PCM.pcm [
{
id 0
Expand Down Expand Up @@ -309,12 +397,35 @@ Object.Base.route [
source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
sink 'eqiir.4.1'
}
{
source 'module-copier.4.2'
sink 'host-copier.0.capture'
}
{
source 'host-copier.0.playback'
sink 'gain.1.1'
}
]

IncludeByKey.HDA_MIC_ENHANCED_CAPTURE {
"true" {
Object.Base.route [
{
source 'module-copier.4.2'
sink 'tdfb.3.1'
}
{
source 'tdfb.3.1'
sink 'drc.3.1'
}
{
source 'drc.3.1'
sink 'host-copier.0.capture'
}
]
}
"false" {
Object.Base.route [
{
source 'module-copier.4.2'
sink 'host-copier.0.capture'
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ list(APPEND TPLGS
"sof-hda-generic\;sof-hda-generic-idisp\;"
# HDA topology with mixer-based pipelines for HDA and
# passthrough pipelines for HDMI
"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix"
"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,HDA_MIC_ENHANCED_CAPTURE=true,\
EFX_HDA_MIC_TDFB_PARAMS=line2_pass,EFX_HDA_MIC_DRC_PARAMS=passthrough"

# HDA topology with mixer-based pipelines for HDA and
# passthrough pipelines for HDMI and
# 2 or 4 DMIC, no NHLT blob included in topology
Expand Down

0 comments on commit 707c0c5

Please sign in to comment.