Skip to content
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

Tools: Topology2: Add enhanced audio capture development topologies #9176

Merged
217 changes: 202 additions & 15 deletions tools/topology/topology2/cavs-mixin-mixout-efx-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 @@ -7,6 +9,9 @@ Define {
DEEP_BUFFER_PIPELINE_SRC 'mixin.15.1'
DEEP_BUFFER_PIPELINE_SINK 'mixout.2.1'
DEEP_BUFFER_PCM_NAME 'Deepbuffer HDA Analog'
HDA_ANALOG_CAPTURE_RATE 48000
HDA_ANALOG_PLAYBACK_RATE 48000
HDA_MIC_ENHANCED_CAPTURE 'false'
}

# include deep buffer config if buffer size is in 1 - 1000 ms.
Expand Down Expand Up @@ -132,17 +137,42 @@ Object.Pipeline {
Object.Widget.host-copier.1 {
stream_name $ANALOG_CAPTURE_PCM
pcm_id 0
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 3
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 16
out_valid_bit_depth 16
}
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 24
}
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
]

io-gateway [
dai-copier-eqiir-module-copier-capture [
{
index 4
direction capture

Object.Widget.dai-copier."1" {
dai_type "HDA"
dai_type "HDA"
type "dai_out"
copier_type "HDA"
stream_name $HDA_ANALOG_DAI_NAME
Expand All @@ -152,20 +182,148 @@ Object.Pipeline {
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
Object.Widget.eqiir.1 {
Object.Control.bytes."1" {
name '$ANALOG_CAPTURE_PCM IIR Eq'
<include/components/eqiir/highpass_40hz_0db_48khz.conf>
}
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
Object.Widget.module-copier."2" {
stream_name $HDA_ANALOG_DAI_NAME
num_input_audio_formats 1
num_output_audio_formats 1
Object.Base.input_audio_format [
{
in_rate $HDA_ANALOG_CAPTURE_RATE
in_bit_depth 32
in_valid_bit_depth 32
}
]
Object.Base.output_audio_format [
{
out_rate $HDA_ANALOG_CAPTURE_RATE
out_bit_depth 32
out_valid_bit_depth 32
}
]
}
}
]
}

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 All @@ -188,45 +346,74 @@ Object.PCM.pcm [
]

# top-level pipeline connections

IncludeByKey.EFX_DRC_COMPONENT {
"singleband" {
Object.Base.route [
{
sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback'
source 'drc.2.1'
source 'host-copier.0.playback'
sink 'gain.1.1'
}
{
source 'mixin.1.1'
sink 'mixout.2.1'
}
{
source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
sink 'host-copier.0.capture'
}
{
source 'host-copier.0.playback'
sink 'gain.1.1'
source 'drc.2.1'
sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback'
}
]
}
"multiband" {
Object.Base.route [
{
sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback'
source 'multiband_drc.2.1'
source 'host-copier.0.playback'
sink 'gain.1.1'
}
{
source 'mixin.1.1'
sink 'mixout.2.1'
}
{
source 'multiband_drc.2.1'
sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback'
}
]
}
}

IncludeByKey.HDA_MIC_ENHANCED_CAPTURE {
"true" {
Object.Base.route [
{
source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
sink 'eqiir.4.1'
}
{
source 'module-copier.4.2'
sink 'tdfb.3.1'
}
{
source 'tdfb.3.1'
sink 'drc.3.1'
}
{
source 'drc.3.1'
Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, this is now very explicit and easy to understand: a0->b0, b1->c0, c1->d0, where a, b, and c are objects / components, and 0 and 1 are their sinks and sources, but in other cases it isn't that explicit, so I'm confused.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, that earlier finding looks like my mistake.

sink 'host-copier.0.capture'
}
]
}
"false" {
Object.Base.route [
{
source 'host-copier.0.playback'
sink 'gain.1.1'
source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
sink 'eqiir.4.1'
}
{
source 'module-copier.4.2'
Copy link
Collaborator

Choose a reason for hiding this comment

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

e.g. here there's no explicit route from eqiir.4.1 to module-copier.4.2 because it's implicit inside the pipeline number 4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep

sink 'host-copier.0.capture'
}
]
}

}
5 changes: 2 additions & 3 deletions tools/topology/topology2/cavs-nocodec.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<mixout-gain-dai-copier-playback.conf>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Slight concern how the first two interact. If you bisect git and hit the the tree between patches 1&2 in this series, you are left with e.g. SDW topologies without gain on the dmic capture, right?

OTOH, this is pretty minor impact, we rarely bisect topology changes like these and I can understand the separate commits are easier to review.

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's a good point. Please think and let me know, combining patches 1 and 2 would be easy.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@singalsu I'm good with this if not other reasons to revisit the series.

<mixout-gain-smart-amp-dai-copier-playback.conf>
<dai-copier-gain-module-copier-capture.conf>
<dai-copier-eqiir-module-copier-capture.conf>
<dai-copier-eqiir-gain-module-copier-capture.conf>
<gain-module-copier.conf>
<gain-capture.conf>
<gain-copier-capture.conf>
Expand Down Expand Up @@ -57,10 +57,9 @@ Define {
# override DMIC default definitions
DMIC0_HOST_PIPELINE_ID 13
DMIC0_DAI_PIPELINE_ID 14
DMIC0_HOST_PIPELINE_SINK 'gain.13.1'
DMIC0_HOST_PIPELINE_SINK 'host-copier.10.capture'
DMIC0_DAI_PIPELINE_SRC 'module-copier.14.2'
DMIC0_DAI_COPIER 'dai-copier.DMIC.NoCodec-6.capture'
DMIC0_DAI_GAIN 'eqiir.14.1'
DMIC0_NAME 'NoCodec-6'
DMIC1_NAME 'NoCodec-7'
DMIC0_PCM_CAPS 'Gain Capture 13'
Expand Down
5 changes: 2 additions & 3 deletions tools/topology/topology2/cavs-rt5682.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<mixout-gain-eqiir-dts-dai-copier-playback.conf>
<deepbuffer-playback.conf>
<dai-copier-be.conf>
<dai-copier-eqiir-module-copier-capture.conf>
<dai-copier-eqiir-gain-module-copier-capture.conf>
<gain-capture.conf>
<gain-module-copier.conf>
<google-rtc-aec-capture.conf>
Expand Down Expand Up @@ -57,10 +57,9 @@ Define {
DMIC1_ID 2
DMIC0_HOST_PIPELINE_ID 13
DMIC0_DAI_PIPELINE_ID 14
DMIC0_HOST_PIPELINE_SINK 'gain.13.1'
DMIC0_HOST_PIPELINE_SINK 'host-copier.99.capture'
DMIC0_DAI_PIPELINE_SRC 'module-copier.14.2'
DMIC0_DAI_COPIER 'dai-copier.DMIC.dmic01.capture'
DMIC0_DAI_GAIN 'eqiir.14.1'
DMIC0_NAME 'dmic01'
DMIC0_PCM_CAPS 'Gain Capture 13'
# override BE link ids
Expand Down
5 changes: 2 additions & 3 deletions tools/topology/topology2/cavs-sdw.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<virtual.conf>
<host-copier-gain-mixin-playback.conf>
<mixout-gain-alh-dai-copier-playback.conf>
<dai-copier-eqiir-module-copier-capture.conf>
<dai-copier-eqiir-gain-module-copier-capture.conf>
<gain-capture.conf>
<gain-copier-capture.conf>
<deepbuffer-playback.conf>
Expand Down Expand Up @@ -56,10 +56,9 @@ Define {
PDM1_MIC_B_ENABLE 1
DMIC0_HOST_PIPELINE_ID 100
DMIC0_DAI_PIPELINE_ID 101
DMIC0_HOST_PIPELINE_SINK 'gain.100.1'
DMIC0_HOST_PIPELINE_SINK 'host-copier.10.capture'
DMIC0_DAI_PIPELINE_SRC 'module-copier.101.2'
DMIC0_DAI_COPIER 'dai-copier.DMIC.dmic01.capture'
DMIC0_DAI_GAIN 'eqiir.101.1'
DMIC0_NAME 'dmic01'
DMIC0_ID 4
DMIC1_ID 5
Expand Down
Loading
Loading