Skip to content

Commit 1a2736f

Browse files
author
Eddy Hsu
committed
Add topology for CTC.
Add topology in development to test CTC. Signed-off-by: Eddy Hsu <eddyhsu@google.com>
1 parent 7507b32 commit 1a2736f

File tree

5 files changed

+324
-0
lines changed

5 files changed

+324
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#
2+
# Pipeline definitions
3+
#
4+
# PCM0 ---> gain ----> Mixin ----> Mixout ----> gain ----> CTC ----> SSP0
5+
# PCM1 ---> gain ----> Mixin ----> Mixout ----> gain ----> CTC ----> SSP1
6+
#
7+
8+
# Pipeline ID:1 PCM ID: 0
9+
Object.Pipeline {
10+
# playback pipelines
11+
host-copier-gain-mixin-playback [
12+
{
13+
index $HEADSET_HOST_PIPELINE_ID
14+
15+
Object.Widget.host-copier.1 {
16+
stream_name '$HEADSET_PLAYBACK_PCM_STREAM_NAME'
17+
pcm_id $HEADSET_PCM_ID
18+
}
19+
Object.Widget.gain.1 {
20+
Object.Control.mixer.1 {
21+
name 'Pre Mixer $HEADSET_PCM_NAME Playback Volume'
22+
}
23+
}
24+
}
25+
{
26+
index $SPEAKER_HOST_PIPELINE_ID
27+
28+
Object.Widget.host-copier.1 {
29+
stream_name '$SPEAKER_PLAYBACK_PCM_STREAM_NAME'
30+
pcm_id $SPEAKER_PCM_ID
31+
}
32+
Object.Widget.gain.1 {
33+
Object.Control.mixer.1 {
34+
name 'Pre Mixer $SPEAKER_PCM_NAME Playback Volume'
35+
}
36+
}
37+
}
38+
]
39+
40+
mixout-gain-ctc-dai-copier-playback [
41+
{
42+
index $HEADSET_DAI_PIPELINE_ID
43+
44+
Object.Widget.dai-copier.1 {
45+
dai_index $HEADSET_SSP_DAI_INDEX
46+
dai_type "SSP"
47+
copier_type "SSP"
48+
stream_name "$HEADSET_CODEC_NAME"
49+
node_type $I2S_LINK_OUTPUT_CLASS
50+
}
51+
52+
Object.Widget.gain.1 {
53+
Object.Control.mixer.1 {
54+
name 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
55+
}
56+
}
57+
}
58+
{
59+
index $SPEAKER_DAI_PIPELINE_ID
60+
61+
Object.Widget.dai-copier.1 {
62+
dai_index $SPEAKER_SSP_DAI_INDEX
63+
dai_type "SSP"
64+
copier_type "SSP"
65+
stream_name "$SPEAKER_CODEC_NAME"
66+
node_type $I2S_LINK_OUTPUT_CLASS
67+
}
68+
69+
Object.Widget.gain.1 {
70+
Object.Control.mixer.1 {
71+
name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume'
72+
}
73+
}
74+
Object.Widget.ctc.1 {
75+
Object.Control.bytes."1" {
76+
name 'CTC.0'
77+
}
78+
}
79+
}
80+
]
81+
}
82+
83+
Object.Base.route [
84+
{
85+
source "gain.$HEADSET_DAI_PIPELINE_ID.1"
86+
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
87+
}
88+
{
89+
source "mixin.$HEADSET_HOST_PIPELINE_ID.1"
90+
sink "mixout.$HEADSET_DAI_PIPELINE_ID.1"
91+
}
92+
{
93+
source "ctc.$SPEAKER_DAI_PIPELINE_ID.1"
94+
sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback"
95+
}
96+
{
97+
source "mixin.$SPEAKER_HOST_PIPELINE_ID.1"
98+
sink "mixout.$SPEAKER_DAI_PIPELINE_ID.1"
99+
}
100+
]

tools/topology/topology2/cavs-rt5682.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<host-copier-gain-mixin-playback.conf>
2020
<mixout-gain-dai-copier-playback.conf>
2121
<mixout-gain-eqiir-dts-dai-copier-playback.conf>
22+
<mixout-gain-ctc-dai-copier-playback.conf>
2223
<deepbuffer-playback.conf>
2324
<dai-copier-be.conf>
2425
<dai-copier-eqiir-module-copier-capture.conf>
@@ -48,6 +49,7 @@
4849
<output_pin_binding.conf>
4950
<input_audio_format.conf>
5051
<output_audio_format.conf>
52+
<ctc.conf>
5153

5254
Define {
5355
MCLK 24576000
@@ -157,6 +159,7 @@ IncludeByKey.INCLUDE_BT_OFFLOAD {
157159
IncludeByKey.PLAYBACK_PIPELINE_SRC {
158160
"volume" "cavs-mixin-mixout-ssp.conf"
159161
"dts" "cavs-mixin-mixout-eqiir-dts-ssp.conf"
162+
"ctc" "cavs-mixin-mixout-ctc-ssp.conf"
160163
}
161164

162165

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,19 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-tgl-nocodec-rtcaec.bin"
112112

113113
# Topology for SOF plugin
114114
"development/sof-plugin\;sof-plugin\;NOISE_SUPPRESSION=false"
115+
116+
# mtl-rt1019 with CTC
117+
"cavs-rt5682\;sof-mtl-rt1019-rt5682-ctc\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\
118+
PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,SPK_ID=6,PREPROCESS_PLUGINS=nhlt,\
119+
NHLT_BIN=nhlt-sof-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_INDEX=2,\
120+
SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\
121+
INCLUDE_ECHO_REF=true,INCLUDE_BT_OFFLOAD=false,PLAYBACK_PIPELINE_SRC=ctc"
122+
123+
# mtl-rt5650 with CTC
124+
"cavs-rt5682\;sof-mtl-rt5650-ctc\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\
125+
PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\
126+
NHLT_BIN=nhlt-sof-mtl-rt5650-dts.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_INDEX=2,\
127+
SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\
128+
BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,\
129+
DEEP_BUF_SPK=true,PLAYBACK_PIPELINE_SRC=ctc,SSP_SPK_FMT_24=true,SSP_HS_FMT_24=true"
115130
)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#
2+
# Common widget ctc
3+
#
4+
# A generic ctc widget. All attributes defined herein are namespaced
5+
# by alsatplg to "Object.Widget.ctc.N.attribute_name"
6+
#
7+
# Usage: this component can be used by instantiating it in the parent object. i.e.
8+
#
9+
# Object.Widget.ctc."N" {
10+
# index 1
11+
# type "effect"
12+
# }
13+
#
14+
# Where N is the unique instance number for the parent object.
15+
16+
Class.Widget."ctc" {
17+
#
18+
# Pipeline ID for the CTC widget object
19+
#
20+
DefineAttribute."index" {
21+
type "integer"
22+
}
23+
24+
#
25+
# Unique instance for CTC widget
26+
#
27+
DefineAttribute."instance" {
28+
type "integer"
29+
}
30+
31+
#include common component definition
32+
<include/components/widget-common.conf>
33+
34+
# Attribute categories
35+
attributes {
36+
#
37+
# The CTC widget name would be constructed using the index and instance attributes.
38+
#
39+
!constructor [
40+
"index"
41+
"instance"
42+
]
43+
44+
#
45+
# mandatory attributes that must be provided when the class is instantiated
46+
#
47+
!mandatory [
48+
"uuid"
49+
"num_input_audio_formats"
50+
"num_output_audio_formats"
51+
]
52+
53+
#
54+
# immutable attributes cannot be modified in the object instance
55+
#
56+
!immutable [
57+
"uuid"
58+
"type"
59+
]
60+
61+
#
62+
# deprecated attributes should not be added in the object instance
63+
#
64+
!deprecated [
65+
"preload_count"
66+
]
67+
68+
#
69+
# DTS widget objects instantiated within the same alsaconf node must have unique
70+
# instance attribute
71+
#
72+
unique "instance"
73+
}
74+
75+
# Default attribute values for CTC widget
76+
uuid "bc:1b:0e:bf:6a:dc:fe:45:bc:90:25:54:cb:13:7a:b4"
77+
type "effect"
78+
no_pm "true"
79+
num_input_pins 1
80+
num_output_pins 1
81+
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
#
2+
# BE playback pipeline: mixout-gain-ctc-dai-copier.
3+
#
4+
# All attributes defined herein are namespaced
5+
# by alsatplg to "Object.Pipeline.mixout-gain-ctc-dai-copier-playback.N.attribute_name"
6+
#
7+
# Usage: mixout-gain-ctc-dai-copier-playback pipeline object can be instantiated as:
8+
#
9+
# Object.Pipeline.mixout-gain-ctc-dai-copier-playback."N" {
10+
# period 1000
11+
# time_domain "timer"
12+
# }
13+
#
14+
# Where N is the unique pipeline ID within the same alsaconf node.
15+
#
16+
17+
<include/common/input_audio_format.conf>
18+
<include/common/output_audio_format.conf>
19+
<include/components/dai-copier.conf>
20+
<include/components/gain.conf>
21+
<include/components/mixout.conf>
22+
<include/components/pipeline.conf>
23+
<include/components/ctc.conf>
24+
25+
Class.Pipeline."mixout-gain-ctc-dai-copier-playback" {
26+
27+
DefineAttribute."index" {}
28+
29+
<include/pipelines/pipeline-common.conf>
30+
31+
attributes {
32+
!constructor [
33+
"index"
34+
]
35+
36+
!immutable [
37+
"direction"
38+
]
39+
40+
#
41+
# mixout-gain-ctc-dai-copier-playback objects instantiated within the same alsaconf node must have
42+
# unique instance attribute
43+
#
44+
unique "instance"
45+
}
46+
47+
Object.Widget {
48+
mixout."1" {}
49+
dai-copier."1" {
50+
type dai_in
51+
num_input_audio_formats 1
52+
num_output_audio_formats 1
53+
num_input_pins 1
54+
55+
# copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch
56+
Object.Base.input_audio_format [
57+
{
58+
in_bit_depth 32
59+
in_valid_bit_depth 32
60+
}
61+
]
62+
Object.Base.output_audio_format [
63+
{
64+
out_bit_depth 32
65+
out_valid_bit_depth 32
66+
}
67+
]
68+
}
69+
gain."1" {
70+
num_input_audio_formats 1
71+
num_output_audio_formats 1
72+
73+
# 32-bit 48KHz 2ch
74+
Object.Base.input_audio_format [
75+
{
76+
in_bit_depth 32
77+
in_valid_bit_depth 32
78+
}
79+
]
80+
Object.Base.output_audio_format [
81+
{
82+
out_bit_depth 32
83+
out_valid_bit_depth 32
84+
}
85+
]
86+
}
87+
ctc."1" {
88+
num_input_audio_formats 1
89+
num_output_audio_formats 1
90+
91+
Object.Base.input_audio_format [
92+
{
93+
in_bit_depth 32
94+
in_valid_bit_depth 32
95+
}
96+
]
97+
Object.Base.output_audio_format [
98+
{
99+
out_bit_depth 32
100+
out_valid_bit_depth 32
101+
}
102+
]
103+
}
104+
105+
pipeline."1" {
106+
priority 0
107+
lp_mode 0
108+
}
109+
}
110+
111+
Object.Base {
112+
route.1 {
113+
source mixout.$index.1
114+
sink gain.$index.1
115+
}
116+
route.2 {
117+
source gain.$index.1
118+
sink ctc.$index.1
119+
}
120+
}
121+
122+
direction "playback"
123+
dynamic_pipeline 1
124+
time_domain "timer"
125+
}

0 commit comments

Comments
 (0)