Skip to content

Commit c74ac5a

Browse files
author
Eddy Hsu
committed
Audio: add CTC to PTL rt5682 path.
Include CTC component in PTL with rt5682. Introduce `USE_CTC_SPK` in `cavs-mixin-mixout-ctc-ssp.conf` and `cavs-mixin-mixout-dax-ssp.conf` to conditionally include CTC component in the pipeline. Signed-off-by: Eddy Hsu <eddyhsu@google.com>
1 parent c51be00 commit c74ac5a

6 files changed

Lines changed: 428 additions & 163 deletions

File tree

tools/topology/topology2/cavs-mixin-mixout-ctc-ssp.conf

Lines changed: 109 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
#
77
# The gain before mixin is for the different routes(e.g., deepbuffer, headset).
88

9-
# Pipeline ID:1 PCM ID: 0
9+
Define {
10+
USE_CTC_SPK "false"
11+
}
12+
13+
# playback pipelines
1014
Object.Pipeline {
11-
# playback pipelines
1215
host-copier-gain-mixin-playback [
1316
{
1417
index $HEADSET_HOST_PIPELINE_ID
@@ -38,69 +41,124 @@ Object.Pipeline {
3841
}
3942
]
4043

41-
mixout-gain-ctc-dai-copier-playback [
44+
mixout-gain-dai-copier-playback [
4245
{
43-
index $HEADSET_DAI_PIPELINE_ID
46+
index $HEADSET_DAI_PIPELINE_ID
47+
48+
Object.Widget.dai-copier.1 {
49+
dai_index $HEADSET_SSP_DAI_INDEX
50+
dai_type "SSP"
51+
copier_type "SSP"
52+
stream_name "$HEADSET_CODEC_NAME"
53+
node_type $I2S_LINK_OUTPUT_CLASS
54+
}
55+
56+
Object.Widget.gain.1 {
57+
Object.Control.mixer.1 {
58+
name 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
59+
}
60+
}
61+
}
62+
]
4463

45-
Object.Widget.dai-copier.1 {
46-
dai_index $HEADSET_SSP_DAI_INDEX
47-
dai_type "SSP"
48-
copier_type "SSP"
49-
stream_name "$HEADSET_CODEC_NAME"
50-
node_type $I2S_LINK_OUTPUT_CLASS
51-
}
64+
IncludeByKey.USE_CTC_SPK {
65+
"true" {
66+
mixout-gain-ctc-dai-copier-playback [
67+
{
68+
index $SPEAKER_DAI_PIPELINE_ID
69+
stream_name "$SPEAKER_CODEC_NAME"
5270

53-
Object.Widget.gain.1 {
54-
Object.Control.mixer.1 {
55-
name 'Post Mixer $HEADSET_PCM_NAME Playback Volume'
56-
}
57-
}
58-
}
59-
{
60-
index $SPEAKER_DAI_PIPELINE_ID
71+
Object.Widget.dai-copier.1 {
72+
dai_index $SPEAKER_SSP_DAI_INDEX
73+
dai_type "SSP"
74+
copier_type "SSP"
75+
stream_name "$SPEAKER_CODEC_NAME"
76+
node_type $I2S_LINK_OUTPUT_CLASS
77+
}
78+
Object.Widget.gain.1 {
79+
Object.Control.mixer.1 {
80+
name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume'
81+
}
82+
}
83+
Object.Widget.ctc.1 {
84+
Object.Control {
85+
mixer."1" {
86+
name 'CTC Switch'
87+
}
88+
bytes."1" {
89+
name 'CTC.0'
90+
max 4160
91+
}
92+
}
93+
}
94+
}
95+
]
96+
}
97+
"false" {
98+
mixout-gain-dai-copier-playback [
99+
{
100+
index $SPEAKER_DAI_PIPELINE_ID
61101

62-
Object.Widget.dai-copier.1 {
63-
dai_index $SPEAKER_SSP_DAI_INDEX
64-
dai_type "SSP"
65-
copier_type "SSP"
66-
stream_name "$SPEAKER_CODEC_NAME"
67-
node_type $I2S_LINK_OUTPUT_CLASS
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 {
76-
mixer."1" {
77-
name 'CTC Switch'
102+
Object.Widget.dai-copier.1 {
103+
dai_index $SPEAKER_SSP_DAI_INDEX
104+
dai_type "SSP"
105+
copier_type "SSP"
106+
stream_name "$SPEAKER_CODEC_NAME"
107+
node_type $I2S_LINK_OUTPUT_CLASS
78108
}
79-
bytes."1" {
80-
name 'CTC.0'
81-
max 4160
109+
Object.Widget.gain.1 {
110+
Object.Control.mixer.1 {
111+
name 'Post Mixer $SPEAKER_PCM_NAME Playback Volume'
112+
}
82113
}
83114
}
84-
}
85-
}
86-
]
115+
]
116+
}
117+
}
87118
}
88119

89120
Object.Base.route [
90121
{
91-
source "gain.$HEADSET_DAI_PIPELINE_ID.1"
92-
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
93-
}
94-
{
122+
source "dai-copier.SSP.$HEADSET_CODEC_NAME.capture"
123+
sink "host-copier.$HEADSET_PCM_ID.capture"
124+
}
125+
{
126+
source "host-copier.$HEADSET_PCM_ID.playback"
127+
sink "gain.1.1"
128+
}
129+
{
95130
source "mixin.$HEADSET_HOST_PIPELINE_ID.1"
96131
sink "mixout.$HEADSET_DAI_PIPELINE_ID.1"
97-
}
132+
}
133+
{
134+
source "gain.$HEADSET_DAI_PIPELINE_ID.1"
135+
sink "dai-copier.SSP.$HEADSET_CODEC_NAME.playback"
136+
}
98137
{
99-
source "ctc.$SPEAKER_DAI_PIPELINE_ID.1"
100-
sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback"
138+
source "host-copier.$SPEAKER_PCM_ID.playback"
139+
sink "gain.3.1"
101140
}
102141
{
103-
source "mixin.$SPEAKER_HOST_PIPELINE_ID.1"
104-
sink "mixout.$SPEAKER_DAI_PIPELINE_ID.1"
105-
}
142+
source "mixin.$SPEAKER_HOST_PIPELINE_ID.1"
143+
sink "mixout.$SPEAKER_DAI_PIPELINE_ID.1"
144+
}
106145
]
146+
147+
IncludeByKey.USE_CTC_SPK {
148+
"true" {
149+
Object.Base.route [
150+
{
151+
source "ctc.$SPEAKER_DAI_PIPELINE_ID.1"
152+
sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback"
153+
}
154+
]
155+
}
156+
"false" {
157+
Object.Base.route [
158+
{
159+
source "gain.$SPEAKER_DAI_PIPELINE_ID.1"
160+
sink "dai-copier.SSP.$SPEAKER_CODEC_NAME.playback"
161+
}
162+
]
163+
}
164+
}

0 commit comments

Comments
 (0)