Skip to content

Commit 6f221b5

Browse files
committed
Tools: Topology: Build topology with 2-way speaker crossover
This patch adds modifications to cavs-sdw.conf and sdw-amp-generic.conf to optionally build the topology with crossover filter for 2-way woofer/tweeter speakers. The build topology with crossover feature is function topology sof-sdca-2amp-id2-xover.tplg. The speaker pipeline with added micsel/selector and eqiir components implements the crossover filter with the supplied configuration blobs. The currently built topology duplicates a stereo L,R stream into L,R,L,R stream and applies 4th order Linkwitz-Riley low-pass for the first pair and high-pass for the second pair. The crossover frequency is set to 2 kHz as example. The crossover parameters should be changed to match the acoustical design of speaker acoustics of the device. Also there could be different channels mappings and high/low-pass apply need. Other variants can be created with the Octave scripts in the next patch. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent cf01b6c commit 6f221b5

8 files changed

Lines changed: 541 additions & 100 deletions

tools/topology/topology2/cavs-sdw.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<host-copier-gain-mixin-playback.conf>
1515
<mixout-gain-alh-dai-copier-playback.conf>
1616
<mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback.conf>
17+
<mixout-gain-eqiir-eqfir-drc-micsel-eqiir-alh-dai-copier-playback.conf>
1718
<dai-copier-gain-eqiir-module-copier-capture.conf>
1819
<gain-capture.conf>
1920
<gain-copier-capture.conf>
@@ -92,6 +93,10 @@ Define {
9293
EFX_MIC_TDFB_PARAMS "line2_generic_pm10deg"
9394
EFX_MIC_DRC_PARAMS "dmic_default"
9495
DMIC0_DAI_EQIIR "highpass_40hz_20db"
96+
SDW_AMP_NUM_CHANNELS 2
97+
SDW_AMP_XOVER false
98+
SDW_AMP_XOVER_SELECTOR_PARAMS default
99+
SDW_AMP_XOVER_EQIIR_PARAMS default
95100
}
96101

97102
# override defaults with platform-specific config
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# LR4 filter bank coefficients 27-Aug-2025
2+
# cd src/audio/eq_iir/tune; octave sof_example_lr4.m
3+
Object.Base.data."IIR" {
4+
bytes "
5+
0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00,
6+
0xcc,0x00,0x00,0x00,0x01,0xd0,0x01,0x03,
7+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
9+
0xcc,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
10+
0x02,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+
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
14+
0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
15+
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
16+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
17+
0x00,0x00,0x00,0x00,0x2d,0x3a,0xcd,0xd3,
18+
0xc0,0xf5,0x82,0x68,0xb9,0x41,0x76,0x00,
19+
0x72,0x83,0xec,0x00,0xb9,0x41,0x76,0x00,
20+
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
21+
0x2d,0x3a,0xcd,0xd3,0xc0,0xf5,0x82,0x68,
22+
0xb9,0x41,0x76,0x00,0x72,0x83,0xec,0x00,
23+
0xb9,0x41,0x76,0x00,0xff,0xff,0xff,0xff,
24+
0x65,0x7f,0x00,0x00,0x02,0x00,0x00,0x00,
25+
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
26+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
27+
0x00,0x00,0x00,0x00,0x7e,0x70,0xdd,0xd6,
28+
0xc0,0xf5,0x82,0x68,0xb6,0x9e,0x44,0x1a,
29+
0x94,0xc2,0x76,0xcb,0xb6,0x9e,0x44,0x1a,
30+
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
31+
0x7e,0x70,0xdd,0xd6,0xc0,0xf5,0x82,0x68,
32+
0xb6,0x9e,0x44,0x1a,0x94,0xc2,0x76,0xcb,
33+
0xb6,0x9e,0x44,0x1a,0xfe,0xff,0xff,0xff,
34+
0x92,0x41,0x00,0x00"
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# LR4 filter bank coefficients 27-Aug-2025
2+
# cd src/audio/eq_iir/tune; octave sof_example_lr4.m
3+
Object.Base.data."IIR" {
4+
bytes "
5+
0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00,
6+
0xcc,0x00,0x00,0x00,0x01,0xd0,0x01,0x03,
7+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
9+
0xcc,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
10+
0x02,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,0x01,0x00,0x00,0x00,
14+
0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
15+
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
16+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
17+
0x00,0x00,0x00,0x00,0x2d,0x3a,0xcd,0xd3,
18+
0xc0,0xf5,0x82,0x68,0xb9,0x41,0x76,0x00,
19+
0x72,0x83,0xec,0x00,0xb9,0x41,0x76,0x00,
20+
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
21+
0x2d,0x3a,0xcd,0xd3,0xc0,0xf5,0x82,0x68,
22+
0xb9,0x41,0x76,0x00,0x72,0x83,0xec,0x00,
23+
0xb9,0x41,0x76,0x00,0xff,0xff,0xff,0xff,
24+
0x65,0x7f,0x00,0x00,0x02,0x00,0x00,0x00,
25+
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
26+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
27+
0x00,0x00,0x00,0x00,0x7e,0x70,0xdd,0xd6,
28+
0xc0,0xf5,0x82,0x68,0xb6,0x9e,0x44,0x1a,
29+
0x94,0xc2,0x76,0xcb,0xb6,0x9e,0x44,0x1a,
30+
0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
31+
0x7e,0x70,0xdd,0xd6,0xc0,0xf5,0x82,0x68,
32+
0xb6,0x9e,0x44,0x1a,0x94,0xc2,0x76,0xcb,
33+
0xb6,0x9e,0x44,0x1a,0xfe,0xff,0xff,0xff,
34+
0x92,0x41,0x00,0x00"
35+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Exported with script sof_selector_blobs.m 27-Aug-2025
2+
# cd tools/tune/selector; octave sof_selector_blobs.m
3+
Object.Base.data."selector_config" {
4+
bytes "
5+
0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00,
6+
0x84,0x00,0x00,0x00,0x01,0xd0,0x01,0x03,
7+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
9+
0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,
10+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
11+
0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,
12+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
13+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
14+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
15+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
16+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
17+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
18+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
19+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
20+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
21+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
22+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
23+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
24+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
25+
0x00,0x00,0x00,0x00"
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Exported with script sof_selector_blobs.m 27-Aug-2025
2+
# cd tools/tune/selector; octave sof_selector_blobs.m
3+
Object.Base.data."selector_config" {
4+
bytes "
5+
0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00,
6+
0x84,0x00,0x00,0x00,0x01,0xd0,0x01,0x03,
7+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
8+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
9+
0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,
10+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
11+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
12+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
13+
0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,
14+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
15+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
16+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
17+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
18+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
19+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
20+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
21+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
22+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
23+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
24+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
25+
0x00,0x00,0x00,0x00"
26+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#
2+
# BE playback pipeline: mixout-gain-eqiir-eqfir-drc-micsel-eqiir-alh-dai-copier.
3+
#
4+
# All attributes defined herein are namespaced
5+
# by alsatplg to "Object.Pipeline.mixout-gain-eqiir-eqfir-drc-micsel-eqiir-alh-dai-copier-playback.N.attribute_name"
6+
#
7+
# Usage: mixout-gain-eqiir-eqfir-drc-micsel-eqiir-alh-dai-copier-playback pipeline object can be instantiated as:
8+
#
9+
# Object.Pipeline.mixout-gain-eqiir-eqfir-drc-micsel-eqiir-alh-dai-copier-playback."N" {
10+
# time_domain "timer"
11+
# }
12+
#
13+
# Where N is the unique pipeline ID within the same alsaconf node.
14+
#
15+
16+
<include/pipelines/cavs/mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback.conf>
17+
<include/components/micsel.conf>
18+
19+
Class.Pipeline."mixout-gain-eqiir-eqfir-drc-micsel-eqiir-alh-dai-copier-playback" {
20+
21+
SubTreeCopy.baseclass {
22+
# this class extends the pipeline class.
23+
source "Class.Pipeline.mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback"
24+
25+
# target node is not defined which means that the new subtree will be copied to
26+
# the parent node containing the SubTreeCopy node i.e in this case the
27+
# Class.Pipeline.mixout-gain-eqiir-eqfir-drc-micsel-eqiir-alh-dai-copier-playback {} node.
28+
29+
# default copy type is to extend the base class ie the widgets and routes
30+
# will be added to the existing list of widgets/routes in the base class
31+
32+
tree {
33+
Object.Widget {
34+
micsel."1" {
35+
num_input_audio_formats 1
36+
Object.Base.input_audio_format [
37+
{
38+
in_bit_depth 32
39+
in_valid_bit_depth 32
40+
}
41+
]
42+
num_output_audio_formats 1
43+
Object.Base.output_audio_format [
44+
{
45+
out_channels $SDW_AMP_NUM_CHANNELS
46+
out_bit_depth 32
47+
out_valid_bit_depth 32
48+
}
49+
]
50+
Object.Control {
51+
bytes."1" {
52+
IncludeByKey.SDW_AMP_XOVER_SELECTOR_PARAMS {
53+
"default" "include/components/micsel/passthrough.conf"
54+
"xover_selector_lr_to_llrr" "include/components/micsel/xover_selector_lr_to_llrr.conf"
55+
"xover_selector_lr_to_lrlr" "include/components/micsel/xover_selector_lr_to_lrlr.conf"
56+
}
57+
}
58+
}
59+
}
60+
61+
eqiir."2" {
62+
num_input_audio_formats 1
63+
Object.Base.input_audio_format [
64+
{
65+
in_channels $SDW_AMP_NUM_CHANNELS
66+
in_bit_depth 32
67+
in_valid_bit_depth 32
68+
}
69+
]
70+
num_output_audio_formats 1
71+
Object.Base.output_audio_format [
72+
{
73+
out_channels $SDW_AMP_NUM_CHANNELS
74+
out_bit_depth 32
75+
out_valid_bit_depth 32
76+
}
77+
]
78+
Object.Control.bytes."1" {
79+
IncludeByKey.SDW_AMP_XOVER_EQIIR_PARAMS {
80+
"default" "include/components/eqiir/passthrough.conf"
81+
"xover_lr4_2000hz_lhlh_48khz" "include/components/eqiir/xover_lr4_2000hz_lhlh_48khz.conf"
82+
"xover_lr4_2000hz_llhh_48khz" "include/components/eqiir/xover_lr4_2000hz_llhh_48khz.conf"
83+
}
84+
}
85+
}
86+
}
87+
88+
Object.Base {
89+
!route [
90+
{
91+
source drc.$index.1
92+
sink micsel.$index.1
93+
}
94+
{
95+
source micsel.$index.1
96+
sink eqiir.$index.2
97+
}
98+
]
99+
}
100+
}
101+
}
102+
}

0 commit comments

Comments
 (0)