Skip to content

Commit 1d53704

Browse files
author
Eddy Hsu
committed
Audio: add CTC to PTL rt5682 path.
Include CTC component in PTL with rt5682. Signed-off-by: Eddy Hsu <[email protected]>
1 parent c51be00 commit 1d53704

4 files changed

Lines changed: 379 additions & 0 deletions

File tree

Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
#
2+
# Pipeline definitions
3+
#
4+
# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> DAX ----> CTC ----> SSP0
5+
# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> DAX ----> CTC ----> SSP1
6+
#
7+
# The gain before mixin is for the different routes(e.g., deepbuffer, headset).
8+
9+
Define {
10+
DOLBY_DAX_CORE_ID 0
11+
SSP_HEADSET_DAX "false"
12+
}
13+
14+
<include/pipelines/cavs/mixout-gain-dax-ctc-dai-copier-playback.conf>
15+
16+
# Pipeline ID:1 PCM ID: 0
17+
Object.Pipeline {
18+
# playback pipelines
19+
host-copier-gain-mixin-playback [
20+
{
21+
index $HEADSET_HOST_PIPELINE_ID
22+
23+
Object.Widget.host-copier.1 {
24+
stream_name '$HEADSET_PLAYBACK_PCM_STREAM_NAME'
25+
pcm_id $HEADSET_PCM_ID
26+
}
27+
Object.Widget.gain.1 {
28+
Object.Control.mixer.1 {
29+
name 'Pre Mixer $HEADSET_PCM_NAME Playback Volume'
30+
}
31+
}
32+
}
33+
{
34+
index $SPEAKER_HOST_PIPELINE_ID
35+
core_id $SPEAKER_PCM_CORE_ID
36+
37+
Object.Widget.host-copier.1 {
38+
stream_name '$SPEAKER_PLAYBACK_PCM_STREAM_NAME'
39+
pcm_id $SPEAKER_PCM_ID
40+
}
41+
Object.Widget.gain.1 {
42+
Object.Control.mixer.1 {
43+
name 'Pre Mixer $SPEAKER_PCM_NAME Playback Volume'
44+
}
45+
}
46+
Object.Widget.pipeline.1 {
47+
core $SPEAKER_PCM_CORE_ID
48+
}
49+
}
50+
]
51+
52+
IncludeByKey.SSP_HEADSET_DAX {
53+
"true" {
54+
mixout-gain-dax-dai-copier-playback [
55+
{
56+
index $HEADSET_DAI_PIPELINE_ID
57+
58+
Object.Widget.dai-copier.1 {
59+
dai_index $HEADSET_SSP_DAI_INDEX
60+
dai_type "SSP"
61+
copier_type "SSP"
62+
stream_name "$HEADSET_CODEC_NAME"
63+
node_type $I2S_LINK_OUTPUT_CLASS
64+
IncludeByKey.SSP_HS_FMT_24 {
65+
"true" {
66+
Object.Base.output_audio_format [
67+
{
68+
out_bit_depth 32
69+
out_valid_bit_depth 24
70+
out_sample_type $SAMPLE_TYPE_LSB_INTEGER
71+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
72+
}
73+
]
74+
}
75+
"false" {
76+
Object.Base.output_audio_format [
77+
{
78+
out_bit_depth 32
79+
out_valid_bit_depth 32
80+
}
81+
]
82+
}
83+
}
84+
}
85+
86+
Object.Widget.gain.1 {
87+
Object.Control.mixer.1 {
88+
name 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
89+
}
90+
}
91+
92+
Object.Widget.dolby-dax.1 {
93+
core_id $DOLBY_DAX_CORE_ID
94+
num_input_audio_formats 1
95+
num_output_audio_formats 1
96+
Object.Base.input_audio_format [
97+
{
98+
in_rate 48000
99+
in_bit_depth 32
100+
in_valid_bit_depth 32
101+
ibs "$[(256 * ($[($in_bit_depth / 8)])) * ($in_channels)]"
102+
}
103+
]
104+
Object.Base.output_audio_format [
105+
{
106+
out_rate 48000
107+
out_bit_depth 32
108+
out_valid_bit_depth 32
109+
obs "$[(256 * ($[($out_bit_depth / 8)])) * ($out_channels)]"
110+
}
111+
]
112+
Object.Control {
113+
mixer."1" {
114+
name 'DAX Headphone Switch'
115+
}
116+
mixer."2" {
117+
name 'DAX Headphone Switch CP'
118+
}
119+
mixer."3" {
120+
name 'DAX Headphone Switch CTC'
121+
}
122+
mixer."4" {
123+
name 'DAX Headphone Volume'
124+
}
125+
enum."1" {
126+
name 'DAX Headphone Profile'
127+
}
128+
enum."2" {
129+
name 'DAX Headphone Device'
130+
}
131+
bytes."1" {
132+
name 'DAX Headphone Tuning'
133+
max 8192
134+
}
135+
}
136+
}
137+
}
138+
]
139+
}
140+
"false" {
141+
mixout-gain-dai-copier-playback [
142+
{
143+
index $HEADSET_DAI_PIPELINE_ID
144+
145+
Object.Widget.dai-copier.1 {
146+
dai_index $HEADSET_SSP_DAI_INDEX
147+
dai_type "SSP"
148+
copier_type "SSP"
149+
stream_name "$HEADSET_CODEC_NAME"
150+
node_type $I2S_LINK_OUTPUT_CLASS
151+
IncludeByKey.SSP_HS_FMT_24 {
152+
"true" {
153+
Object.Base.output_audio_format [
154+
{
155+
out_bit_depth 32
156+
out_valid_bit_depth 24
157+
out_sample_type $SAMPLE_TYPE_LSB_INTEGER
158+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
159+
}
160+
]
161+
}
162+
"false" {
163+
Object.Base.output_audio_format [
164+
{
165+
out_bit_depth 32
166+
out_valid_bit_depth 32
167+
}
168+
]
169+
}
170+
}
171+
}
172+
173+
Object.Widget.gain.1 {
174+
Object.Control.mixer.1 {
175+
name 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
176+
}
177+
}
178+
}
179+
]
180+
}
181+
}
182+
183+
# For speaker, we want DAX -> CTC
184+
mixout-gain-dax-ctc-dai-copier-playback [
185+
{
186+
index $SPEAKER_DAI_PIPELINE_ID
187+
core_id $SPEAKER_PCM_CORE_ID
188+
189+
Object.Widget.dai-copier.1 {
190+
dai_index $SPEAKER_SSP_DAI_INDEX
191+
dai_type "SSP"
192+
copier_type "SSP"
193+
stream_name "$SPEAKER_CODEC_NAME"
194+
node_type $I2S_LINK_OUTPUT_CLASS
195+
IncludeByKey.SSP_SPK_FMT_24 {
196+
"true" {
197+
Object.Base.output_audio_format [
198+
{
199+
out_bit_depth 32
200+
out_valid_bit_depth 24
201+
out_sample_type $SAMPLE_TYPE_LSB_INTEGER
202+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
203+
}
204+
]
205+
}
206+
"false" {
207+
Object.Base.output_audio_format [
208+
{
209+
out_bit_depth 32
210+
out_valid_bit_depth 32
211+
}
212+
]
213+
}
214+
}
215+
}
216+
217+
Object.Widget.gain.1 {
218+
Object.Control.mixer.1 {
219+
name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume'
220+
}
221+
}
222+
223+
Object.Widget.dolby-dax.1 {
224+
core_id $DOLBY_DAX_CORE_ID
225+
Object.Control {
226+
mixer."1" {
227+
name 'DAX Speaker Switch'
228+
}
229+
mixer."2" {
230+
name 'DAX Speaker Switch CP'
231+
}
232+
mixer."3" {
233+
name 'DAX Speaker Switch CTC'
234+
}
235+
mixer."4" {
236+
name 'DAX Speaker Volume'
237+
}
238+
enum."1" {
239+
name 'DAX Speaker Profile'
240+
}
241+
enum."2" {
242+
name 'DAX Speaker Device'
243+
}
244+
bytes."1" {
245+
name 'DAX Speaker Tuning'
246+
max 8192
247+
}
248+
}
249+
}
250+
251+
Object.Widget.ctc.1 {
252+
Object.Control {
253+
mixer."1" {
254+
name 'CTC Switch'
255+
}
256+
bytes."1" {
257+
name 'CTC.0'
258+
max 4160
259+
}
260+
}
261+
}
262+
263+
Object.Widget.pipeline.1 {
264+
core $SPEAKER_PCM_CORE_ID
265+
}
266+
}
267+
]
268+
}
269+
270+
IncludeByKey.SSP_HEADSET_DAX {
271+
"true" {
272+
Object.Base.route [
273+
{
274+
source "dolby-dax.$HEADSET_DAI_PIPELINE_ID.1"
275+
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
276+
}
277+
]
278+
}
279+
"false" {
280+
Object.Base.route [
281+
{
282+
source "gain.$HEADSET_DAI_PIPELINE_ID.1"
283+
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
284+
}
285+
]
286+
}
287+
}
288+
289+
Object.Base.route [
290+
{
291+
source "mixin.$HEADSET_HOST_PIPELINE_ID.1"
292+
sink "mixout.$HEADSET_DAI_PIPELINE_ID.1"
293+
}
294+
{
295+
source "ctc.$SPEAKER_DAI_PIPELINE_ID.1"
296+
sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback"
297+
}
298+
{
299+
source "mixin.$SPEAKER_HOST_PIPELINE_ID.1"
300+
sink "mixout.$SPEAKER_DAI_PIPELINE_ID.1"
301+
}
302+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<cavs-rt5682.conf>
2+
3+
Define {
4+
PLAYBACK_PIPELINE_SRC "none"
5+
}
6+
7+
<cavs-mixin-mixout-dax-ctc-ssp.conf>
8+
9+
Object.Base {
10+
!route [
11+
{
12+
source "dai-copier.SSP.$HEADSET_CODEC_NAME.capture"
13+
sink "host-copier.$HEADSET_PCM_ID.capture"
14+
}
15+
{
16+
source "host-copier.$HEADSET_PCM_ID.playback"
17+
sink "gain.1.1"
18+
}
19+
]
20+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# BE playback pipeline: mixout-gain-dax-ctc-dai-copier-playback.
3+
# This pipeline is an extension of the mixout-gain-dax-dai-copier-playback pipeline class.
4+
#
5+
6+
<include/components/ctc.conf>
7+
<include/pipelines/cavs/mixout-gain-dax-dai-copier-playback.conf>
8+
9+
Class.Pipeline."mixout-gain-dax-ctc-dai-copier-playback" {
10+
SubTreeCopy.baseclass {
11+
# this class extends the mixout-gain-dax-dai-copier-playback class definition
12+
source "Class.Pipeline.mixout-gain-dax-dai-copier-playback"
13+
14+
tree {
15+
Object.Widget {
16+
ctc."1" {
17+
num_input_audio_formats 1
18+
num_output_audio_formats 1
19+
20+
Object.Base.input_audio_format [
21+
{
22+
in_rate 48000
23+
in_bit_depth 32
24+
in_valid_bit_depth 32
25+
ibs "$[(256 * ($[($in_bit_depth / 8)])) * ($in_channels)]"
26+
}
27+
]
28+
Object.Base.output_audio_format [
29+
{
30+
out_rate 48000
31+
out_bit_depth 32
32+
out_valid_bit_depth 32
33+
obs "$[(256 * ($[($out_bit_depth / 8)])) * ($out_channels)]"
34+
}
35+
]
36+
}
37+
}
38+
39+
Object.Base {
40+
! route [
41+
{
42+
source dolby-dax.$index.1
43+
sink ctc.$index.1
44+
}
45+
]
46+
}
47+
}
48+
}
49+
}

tools/topology/topology2/production/tplg-targets-ace3.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,18 @@ HDMI_IN_1_ID=0,HDMI_IN_2_ID=1"
188188
NHLT_BIN=nhlt-sof-ptl-tas2563-rt5682.bin,SPK_ID=6,DEEPBUFFER_FW_DMA_MS=10,INCLUDE_ECHO_REF=true,\
189189
BT_NAME=SSP2-BT,BT_ID=7,BT_PCM_NAME=Bluetooth,DEEP_BUF_SPK=true"
190190

191+
"cavs-rt5682\;sof-ptl-tas2563-rt5682-ctc\;PLATFORM=ptl,NUM_DMICS=2,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\
192+
NHLT_BIN=nhlt-sof-ptl-tas2563-rt5682-ctc.bin,SPK_ID=6,DEEPBUFFER_FW_DMA_MS=10,INCLUDE_ECHO_REF=true,\
193+
BT_NAME=SSP2-BT,BT_ID=7,BT_PCM_NAME=Bluetooth,DEEP_BUF_SPK=true,PLAYBACK_PIPELINE_SRC=ctc"
194+
191195
"cavs-rt5682\;sof-ptl-tas2563-rt5682-dax\;PLATFORM=ptl,NUM_DMICS=2,DMIC0_PCM_ID=99,\
192196
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-tas2563-rt5682-dax.bin,SPK_ID=6,DEEPBUFFER_FW_DMA_MS=10,\
193197
INCLUDE_ECHO_REF=true,BT_NAME=SSP2-BT,BT_ID=7,BT_PCM_NAME=Bluetooth,DEEP_BUF_SPK=true,\
194198
PLAYBACK_PIPELINE_SRC=dax,DOLBY_DAX_CORE_ID=0"
199+
"cavs-rt5682-dax-ctc\;sof-ptl-tas2563-rt5682-dax-ctc\;PLATFORM=ptl,NUM_DMICS=2,DMIC0_PCM_ID=99,\
200+
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-tas2563-rt5682-dax-ctc.bin,SPK_ID=6,DEEPBUFFER_FW_DMA_MS=10,\
201+
INCLUDE_ECHO_REF=true,BT_NAME=SSP2-BT,BT_ID=7,BT_PCM_NAME=Bluetooth,DEEP_BUF_SPK=true,\
202+
DOLBY_DAX_CORE_ID=0"
195203

196204
# Split topologies
197205
"cavs-sdw\;sof-ptl-dmic-2ch-id2\;PLATFORM=ptl,SDW_JACK=false,NUM_HDMIS=0,NUM_DMICS=2,\

0 commit comments

Comments
 (0)