Skip to content

Commit 8e7a015

Browse files
committed
Tools: Topology2: Add Multiband-DRC
This patch adds the topology2 files for multiband-DRC. The EFX processing chain is gain - IIR - FIR - DRC or Multiband-DRC. The DRC selection is done with macro EFX_DRC_COMPONENT and values "singleband" and "multiband". The multiband-drc has two ALSA controls, bytes and switch. The switch control switches the processing on and off. The generated topology files with multiband-drc are: sof-hda-efx-mbdrc-generic.tplg sof-hda-efx-mbdrc-generic-2ch.tplg sof-hda-efx-mbdrc-generic-4cg.tplg The topology files with DRC are as before: sof-hda-efx-mbdrc-generic.tplg sof-hda-efx-mbdrc-generic-2ch.tplg sof-hda-efx-mbdrc-generic-4cg.tplg The configuration blob default is updated to what is generated by the current example_multiband_drc.m configuration script. The pass-through blob is set as default for tplg2. The topology 1 blobs are updated similarly. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 38faea7 commit 8e7a015

File tree

9 files changed

+550
-50
lines changed

9 files changed

+550
-50
lines changed

tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf

Lines changed: 116 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,81 @@ Object.Dai.HDA [
2828
]
2929

3030
Object.Pipeline {
31-
mixout-gain-efx-dai-copier-playback [
32-
{
33-
index 2
31+
IncludeByKey.EFX_DRC_COMPONENT {
32+
"singleband" {
33+
mixout-gain-efx-dai-copier-playback [
34+
{
35+
index 2
3436

35-
Object.Widget.dai-copier.1 {
36-
node_type $HDA_LINK_OUTPUT_CLASS
37-
stream_name $HDA_ANALOG_DAI_NAME
38-
dai_type "HDA"
39-
copier_type "HDA"
40-
}
41-
Object.Widget.gain.1 {
42-
Object.Control.mixer.1 {
43-
name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume'
44-
}
45-
}
46-
Object.Widget.eqiir.1 {
47-
Object.Control.bytes."1" {
48-
name 'Post Mixer $ANALOG_PLAYBACK_PCM IIR Eq'
49-
}
50-
}
51-
Object.Widget.eqfir.1 {
52-
Object.Control.bytes."1" {
53-
name 'Post Mixer $ANALOG_PLAYBACK_PCM FIR Eq'
54-
}
55-
}
56-
Object.Widget.drc.1 {
57-
Object.Control.bytes."1" {
58-
name '2 Main playback DRC'
59-
}
60-
}
61-
}
62-
]
37+
Object.Widget.dai-copier.1 {
38+
node_type $HDA_LINK_OUTPUT_CLASS
39+
stream_name $HDA_ANALOG_DAI_NAME
40+
dai_type "HDA"
41+
copier_type "HDA"
42+
}
43+
Object.Widget.gain.1 {
44+
Object.Control.mixer.1 {
45+
name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume'
46+
}
47+
}
48+
Object.Widget.eqiir.1 {
49+
Object.Control.bytes."1" {
50+
name 'Post Mixer $ANALOG_PLAYBACK_PCM IIR Eq'
51+
}
52+
}
53+
Object.Widget.eqfir.1 {
54+
Object.Control.bytes."1" {
55+
name 'Post Mixer $ANALOG_PLAYBACK_PCM FIR Eq'
56+
}
57+
}
58+
Object.Widget.drc.1 {
59+
Object.Control.bytes."1" {
60+
name 'Post Mixer $ANALOG_PLAYBACK_PCM DRC'
61+
}
62+
}
63+
}
64+
]
65+
}
66+
"multiband" {
67+
mixout-gain-efx-mbdrc-dai-copier-playback [
68+
{
69+
index 2
70+
71+
Object.Widget.dai-copier.1 {
72+
node_type $HDA_LINK_OUTPUT_CLASS
73+
stream_name $HDA_ANALOG_DAI_NAME
74+
dai_type "HDA"
75+
copier_type "HDA"
76+
}
77+
Object.Widget.gain.1 {
78+
Object.Control.mixer.1 {
79+
name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume'
80+
}
81+
}
82+
Object.Widget.eqiir.1 {
83+
Object.Control.bytes."1" {
84+
name 'Post Mixer $ANALOG_PLAYBACK_PCM IIR Eq'
85+
}
86+
}
87+
Object.Widget.eqfir.1 {
88+
Object.Control.bytes."1" {
89+
name 'Post Mixer $ANALOG_PLAYBACK_PCM FIR Eq'
90+
}
91+
}
92+
Object.Widget.multiband_drc.1 {
93+
Object.Control {
94+
bytes."1" {
95+
name 'Post Mixer $ANALOG_PLAYBACK_PCM MBDRC bytes'
96+
}
97+
mixer."1" {
98+
name 'Post Mixer $ANALOG_PLAYBACK_PCM MBDRC switch'
99+
}
100+
}
101+
}
102+
}
103+
]
104+
}
105+
}
63106

64107
host-copier-gain-mixin-playback [
65108
{
@@ -140,21 +183,45 @@ Object.PCM.pcm [
140183
]
141184

142185
# top-level pipeline connections
143-
Object.Base.route [
144-
{
145-
sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback'
146-
source 'drc.2.1'
147-
}
148-
{
149-
source 'mixin.1.1'
150-
sink 'mixout.2.1'
151-
}
152-
{
153-
source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
154-
sink 'host-copier.0.capture'
155-
}
156-
{
157-
source 'host-copier.0.playback'
158-
sink 'gain.1.1'
159-
}
160-
]
186+
IncludeByKey.EFX_DRC_COMPONENT {
187+
"singleband" {
188+
Object.Base.route [
189+
{
190+
sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback'
191+
source 'drc.2.1'
192+
}
193+
{
194+
source 'mixin.1.1'
195+
sink 'mixout.2.1'
196+
}
197+
{
198+
source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
199+
sink 'host-copier.0.capture'
200+
}
201+
{
202+
source 'host-copier.0.playback'
203+
sink 'gain.1.1'
204+
}
205+
]
206+
}
207+
"multiband" {
208+
Object.Base.route [
209+
{
210+
sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback'
211+
source 'multiband_drc.2.1'
212+
}
213+
{
214+
source 'mixin.1.1'
215+
sink 'mixout.2.1'
216+
}
217+
{
218+
source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture'
219+
sink 'host-copier.0.capture'
220+
}
221+
{
222+
source 'host-copier.0.playback'
223+
sink 'gain.1.1'
224+
}
225+
]
226+
}
227+
}

tools/topology/topology2/development/tplg-targets.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-efx-generic-4ch.bin,USE_CHAIN_DMA=
8181
DEEPBUFFER_FW_DMA_MS=100,EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough,\
8282
EFX_DRC_PARAMS=passthrough"
8383

84+
"sof-hda-generic\;sof-hda-efx-mbdrc-generic\;\
85+
HDA_CONFIG=efx,USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100,\
86+
EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough,\
87+
EFX_DRC_COMPONENT=multiband,EFX_MBDRC_PARAMS=passthrough"
88+
89+
"sof-hda-generic\;sof-hda-efx-mbdrc-generic-2ch\;\
90+
HDA_CONFIG=efx,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-fir-generic-2ch.bin,\
91+
USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100,EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough,\
92+
EFX_DRC_COMPONENT=multiband,EFX_MBDRC_PARAMS=passthrough"
93+
94+
"sof-hda-generic\;sof-hda-efx-mbdrc-generic-4ch\;\
95+
HDA_CONFIG=efx,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\
96+
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-efx-generic-4ch.bin,USE_CHAIN_DMA=true,\
97+
DEEPBUFFER_FW_DMA_MS=100,EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough,\
98+
EFX_DRC_COMPONENT=multiband,EFX_MBDRC_PARAMS=passthrough"
99+
84100
# CAVS HDA topology with gain and SRC before mixin for HDA and passthrough pipelines for HDMI
85101
"sof-hda-generic\;sof-hda-src-generic\;HDA_CONFIG=src,USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100"
86102

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#
2+
#
3+
# A generic MULTIBAND_DRC component. All attributes defined herein are namespaced
4+
# by alsatplg to "Object.Widget.multiband_drc.attribute_name"
5+
#
6+
# Usage: this component can be used by declaring in the parent object. i.e.
7+
#
8+
# Object.Widget.multiband_drc."N" {
9+
# index 1
10+
# }
11+
# }
12+
13+
#
14+
# Where M is pipeline ID and N is a unique integer in the parent object.
15+
16+
Class.Widget."multiband_drc" {
17+
#
18+
# Pipeline ID
19+
#
20+
DefineAttribute."index" {
21+
type "integer"
22+
}
23+
24+
#
25+
# Unique instance for MULTIBAND_DRC widget
26+
#
27+
DefineAttribute."instance" {
28+
type "integer"
29+
}
30+
31+
# Include common widget attributes definition
32+
<include/components/widget-common.conf>
33+
34+
attributes {
35+
!constructor [
36+
"index"
37+
"instance"
38+
]
39+
!mandatory [
40+
"num_input_pins"
41+
"num_output_pins"
42+
"num_input_audio_formats"
43+
"num_output_audio_formats"
44+
]
45+
46+
!immutable [
47+
"uuid"
48+
"type"
49+
]
50+
!deprecated [
51+
"preload_count"
52+
]
53+
unique "instance"
54+
}
55+
56+
#
57+
# multiband_drc widget switch control
58+
#
59+
Object.Control {
60+
mixer."1" {
61+
Object.Base.channel.1 {
62+
name "fc"
63+
shift 0
64+
}
65+
Object.Base.ops.1 {
66+
name "ctl"
67+
info "volsw"
68+
#259 binds the mixer control to switch get/put handlers
69+
get 259
70+
put 259
71+
}
72+
max 1
73+
}
74+
}
75+
76+
#
77+
# Default attributes for multiband_drc
78+
#
79+
80+
uuid "56:22:9f:0d:4f:8e:b3:47:84:48:23:9a:33:4f:11:91"
81+
type "effect"
82+
no_pm "true"
83+
num_input_pins 1
84+
num_output_pins 1
85+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Exported with script example_multiband_drc.m 01-Sep-2023
2+
Object.Base.data."multiband_drc_config" {
3+
bytes "
4+
0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00,
5+
0x4c,0x02,0x00,0x00,0x00,0xa0,0x01,0x03,
6+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
7+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8+
0x4c,0x02,0x00,0x00,0x03,0x00,0x00,0x00,
9+
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
10+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
11+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
12+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
13+
0x00,0x00,0x00,0x00,0x7b,0x8e,0x88,0xfe,
14+
0x36,0x79,0x57,0x17,0x5f,0x19,0x6f,0x06,
15+
0xe8,0x79,0x67,0xd4,0x00,0x00,0x00,0x40,
16+
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
17+
0x5f,0x6d,0x19,0xe7,0x39,0xc4,0xd4,0x50,
18+
0x0c,0x9b,0x09,0x24,0xad,0x76,0x82,0x9f,
19+
0x00,0x00,0x00,0x40,0xff,0xff,0xff,0xff,
20+
0x43,0x72,0x00,0x00,0xa1,0xe6,0x90,0xf9,
21+
0x18,0x86,0x98,0x2b,0xe3,0x32,0xef,0x00,
22+
0x4b,0xf7,0x20,0xf1,0x18,0x69,0xc6,0x28,
23+
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
24+
0xf4,0x64,0xf6,0xdb,0x53,0x89,0x7d,0x60,
25+
0x5c,0x14,0xf2,0x0a,0x84,0x0d,0x78,0xdc,
26+
0xda,0xef,0x21,0x1c,0x00,0x00,0x00,0x00,
27+
0x00,0x40,0x00,0x00,0x6f,0x82,0x53,0xc2,
28+
0x3e,0x77,0xa1,0x7d,0x95,0xc1,0x02,0x00,
29+
0x2a,0x83,0x05,0x00,0x95,0xc1,0x02,0x00,
30+
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
31+
0x6f,0x82,0x53,0xc2,0x3e,0x77,0xa1,0x7d,
32+
0x34,0x7d,0xd3,0x3e,0x99,0x05,0x59,0x82,
33+
0x34,0x7d,0xd3,0x3e,0x00,0x00,0x00,0x00,
34+
0x00,0x40,0x00,0x00,0x2d,0x3a,0xcd,0xd3,
35+
0xc0,0xf5,0x82,0x68,0x05,0xf4,0xeb,0x00,
36+
0x0a,0xe8,0xd7,0x01,0x05,0xf4,0xeb,0x00,
37+
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
38+
0x2d,0x3a,0xcd,0xd3,0xc0,0xf5,0x82,0x68,
39+
0xe5,0x6e,0x2d,0x35,0x36,0x22,0xa5,0x95,
40+
0xe5,0x6e,0x2d,0x35,0x00,0x00,0x00,0x00,
41+
0x00,0x40,0x00,0x00,0x2d,0x3a,0xcd,0xd3,
42+
0xc0,0xf5,0x82,0x68,0x05,0xf4,0xeb,0x00,
43+
0x0a,0xe8,0xd7,0x01,0x05,0xf4,0xeb,0x00,
44+
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
45+
0x2d,0x3a,0xcd,0xd3,0xc0,0xf5,0x82,0x68,
46+
0xe5,0x6e,0x2d,0x35,0x36,0x22,0xa5,0x95,
47+
0xe5,0x6e,0x2d,0x35,0x00,0x00,0x00,0x00,
48+
0x00,0x40,0x00,0x00,0x01,0x00,0x00,0x00,
49+
0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x1e,
50+
0x00,0x00,0x00,0x0c,0xd3,0x4d,0x62,0x00,
51+
0xb1,0xc2,0x09,0x04,0x55,0x55,0x55,0x05,
52+
0x50,0xfa,0x1e,0x00,0x55,0x60,0x94,0x00,
53+
0x7e,0x98,0x6a,0xff,0x83,0xc9,0xfe,0x01,
54+
0x64,0x47,0x47,0x22,0x17,0x56,0x74,0x01,
55+
0x1c,0xc7,0x71,0x00,0x77,0x77,0x77,0xff,
56+
0xd8,0x77,0x1f,0x00,0x05,0x00,0x00,0x00,
57+
0x00,0x00,0x36,0x00,0xdf,0x97,0x03,0x00,
58+
0xe7,0x3e,0x1e,0x00,0xdf,0x97,0x07,0x00,
59+
0x5b,0x91,0x00,0x00,0x02,0x00,0x00,0x00,
60+
0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x1e,
61+
0x00,0x00,0x00,0x0c,0xd3,0x4d,0x62,0x00,
62+
0xb1,0xc2,0x09,0x04,0x55,0x55,0x55,0x05,
63+
0x50,0xfa,0x1e,0x00,0x55,0x60,0x94,0x00,
64+
0x7e,0x98,0x6a,0xff,0x83,0xc9,0xfe,0x01,
65+
0x64,0x47,0x47,0x22,0x17,0x56,0x74,0x01,
66+
0x1c,0xc7,0x71,0x00,0x77,0x77,0x77,0xff,
67+
0xd8,0x77,0x1f,0x00,0x05,0x00,0x00,0x00,
68+
0x00,0x00,0x36,0x00,0xdf,0x97,0x03,0x00,
69+
0xe7,0x3e,0x1e,0x00,0xdf,0x97,0x07,0x00,
70+
0x5b,0x91,0x00,0x00,0x03,0x00,0x00,0x00,
71+
0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x1e,
72+
0x00,0x00,0x00,0x0c,0xd3,0x4d,0x62,0x00,
73+
0xb1,0xc2,0x09,0x04,0x55,0x55,0x55,0x05,
74+
0x50,0xfa,0x1e,0x00,0x55,0x60,0x94,0x00,
75+
0x7e,0x98,0x6a,0xff,0x83,0xc9,0xfe,0x01,
76+
0x64,0x47,0x47,0x22,0x17,0x56,0x74,0x01,
77+
0x1c,0xc7,0x71,0x00,0x77,0x77,0x77,0xff,
78+
0xd8,0x77,0x1f,0x00,0x05,0x00,0x00,0x00,
79+
0x00,0x00,0x36,0x00,0xdf,0x97,0x03,0x00,
80+
0xe7,0x3e,0x1e,0x00,0xdf,0x97,0x07,0x00,
81+
0x5b,0x91,0x00,0x00"
82+
}

0 commit comments

Comments
 (0)