Skip to content

Commit c06ed44

Browse files
committed
topology2: cavs-sdw: add Speaker and Microphone pcm
Add Speaker PCM to cavs-sdw topology. We need to set NUM_SDW_AMPS=1 in CMakeLists.txt if there is only one amplifier in the device and set NUM_SDW_AMPS=2 if there are two amplifiers. Set SDW_DMIC=1 if there is a SDW DMIC, like rt714 in the device. The 2nd ALH copier stream name should be the same as the 1st ALH copier, and no need to connect to the route. The 2nd ALH copier data will be set to the 1st ALH copier's gateway config in the aggregated mode. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent d116f40 commit c06ed44

File tree

5 files changed

+187
-0
lines changed

5 files changed

+187
-0
lines changed

tools/topology/topology2/cavs/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ HDA_CONFIG=mix,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,PREPROCESS_PL
2828
# CAVS SDW topology with passthrough pipelines
2929
"cavs-sdw\;cavs-sdw"
3030

31+
"cavs-sdw\;sof-tgl-rt711-rt1316-rt714\;NUM_SDW_AMPS=2,SDW_DMIC=1"
32+
33+
"cavs-sdw\;sof-tgl-rt711-rt1308-4ch\;NUM_SDW_AMPS=1,NUM_DMICS=4,DMIC0_ID=3,\
34+
DMIC1_ID=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1"
35+
3136
# CAVS SDW with SRC gain and mixer support
3237
"cavs-sdw-src-gain-mixin\;cavs-sdw-src-gain-mixin"
3338

tools/topology/topology2/cavs/cavs-sdw.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Define {
5555
SDW_JACK_IN_STREAM 'SDW0-Capture'
5656
SDW_JACK_OUT_BE_ID 0
5757
SDW_JACK_IN_BE_ID 1
58+
NUM_SDW_AMPS 0
59+
SDW_DMIC 0
5860
}
5961

6062
# include DMIC config if needed.
@@ -71,6 +73,14 @@ IncludeByKey.NUM_HDMIS {
7173
"[3-4]" "platform/intel/hdmi-generic.conf"
7274
}
7375

76+
IncludeByKey.NUM_SDW_AMPS {
77+
"[1-2]" "platform/intel/sdw-amp-generic.conf"
78+
}
79+
80+
IncludeByKey.SDW_DMIC {
81+
"1" "platform/intel/sdw-dmic-generic.conf"
82+
}
83+
7484
#
7585
# List of all DAIs
7686
#
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
Object.Pipeline {
3+
passthrough-be.$ALH_2ND_SPK_ID {
4+
direction "playback"
5+
index $ALH_2ND_SPK_ID
6+
copier_type "ALH"
7+
Object.Widget.copier.1 {
8+
stream_name $SDW_SPK_STREAM
9+
dai_type "ALH"
10+
copier_type "ALH"
11+
type "dai_in"
12+
node_type $ALH_LINK_OUTPUT_CLASS
13+
}
14+
}
15+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# route and pipeline index start from pcm id * 10
2+
3+
Define {
4+
SDW_SPK_STREAM 'SDW1-Playback'
5+
ALH_2ND_SPK_ID 22
6+
SDW_AMP_BE_ID 2
7+
}
8+
9+
Object.Dai {
10+
ALH."514" {
11+
id $SDW_AMP_BE_ID
12+
direction "playback"
13+
name $SDW_SPK_STREAM
14+
default_hw_conf_id 0
15+
rate 48000
16+
channels 2
17+
18+
Object.Base.hw_config."ALH514" {
19+
id 0
20+
}
21+
}
22+
}
23+
24+
Object.Pipeline {
25+
host-copier-gain-mixin-playback.20 {
26+
index 20
27+
28+
Object.Widget.copier.1 {
29+
stream_name "sdw amplifiers"
30+
}
31+
Object.Widget.gain.1 {
32+
Object.Control.mixer.1 {
33+
name 'Amplifier Volume'
34+
}
35+
}
36+
}
37+
38+
mixout-gain-dai-copier-playback.21 {
39+
index 21
40+
41+
Object.Widget.pipeline.1.stream_name "copier.ALH.6.1"
42+
43+
Object.Widget.copier.1 {
44+
stream_name $SDW_SPK_STREAM
45+
dai_type "ALH"
46+
copier_type "ALH"
47+
node_type $ALH_LINK_OUTPUT_CLASS
48+
}
49+
Object.Widget.gain.1 {
50+
Object.Control.mixer.1 {
51+
name 'Amplifier Volume'
52+
}
53+
}
54+
}
55+
56+
}
57+
58+
IncludeByKey.NUM_SDW_AMPS {
59+
"2" "platform/intel/alh-2nd-spk.conf"
60+
}
61+
62+
Object.PCM {
63+
pcm.2 {
64+
name "Speaker"
65+
id 2
66+
direction "playback"
67+
Object.Base.fe_dai."Speaker" {}
68+
69+
Object.PCM.pcm_caps."playback" {
70+
name "sdw amplifiers"
71+
formats 'S16_LE,S24_LE,S32_LE'
72+
}
73+
}
74+
}
75+
76+
Object.Base {
77+
route.20 {
78+
source "gain.21.1"
79+
sink "copier.ALH.21.1"
80+
}
81+
82+
route.21 {
83+
source 'mixin.20.1'
84+
sink 'mixout.21.1'
85+
}
86+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# route and pipeline index start from pcm id * 10
2+
3+
Define {
4+
SDW_DMIC_STREAM 'SDW3-Capture'
5+
SDW_DMIC_BE_ID 4
6+
}
7+
8+
Object.Dai {
9+
ALH."771" {
10+
id $SDW_DMIC_BE_ID
11+
direction "capture"
12+
name $SDW_DMIC_STREAM
13+
default_hw_conf_id 0
14+
rate 48000
15+
channels 2
16+
17+
Object.Base.hw_config."ALH771" {
18+
id 0
19+
}
20+
}
21+
}
22+
23+
Object.Pipeline {
24+
passthrough-capture.40 {
25+
index 40
26+
Object.Widget.pipeline.1.stream_name "sdw dmic pipeline"
27+
28+
Object.Widget.copier.1.stream_name "sdw dmic"
29+
Object.Widget.copier.1.Object.Base.audio_format.1 {
30+
# 32 -> 16 bits conversion is done here,
31+
# so in_bit_depth is 32 (and out_bit_depth is 16).
32+
in_bit_depth 32
33+
}
34+
}
35+
passthrough-be.41 {
36+
direction "capture"
37+
index 41
38+
copier_type "ALH"
39+
Object.Widget.pipeline.1 {
40+
stream_name 'sdw dmic pipeline'
41+
}
42+
Object.Widget.copier.1 {
43+
stream_name $SDW_DMIC_STREAM
44+
dai_type "ALH"
45+
copier_type "ALH"
46+
type "dai_out"
47+
node_type $ALH_LINK_INPUT_CLASS
48+
}
49+
}
50+
}
51+
52+
Object.PCM {
53+
pcm.4 {
54+
name "Microphone"
55+
id 4
56+
direction "capture"
57+
Object.Base.fe_dai."SDW DMIC" {}
58+
59+
Object.PCM.pcm_caps."capture" {
60+
name "sdw dmic"
61+
formats 'S16_LE,S24_LE,S32_LE'
62+
}
63+
}
64+
}
65+
66+
Object.Base {
67+
route.40 {
68+
source "copier.ALH.41.1"
69+
sink "copier.host.40.1"
70+
}
71+
}

0 commit comments

Comments
 (0)