Skip to content

Commit d7e4c97

Browse files
committed
topology2: sof-mtl-rt5650: add SSP FMT 24 bits support
use 24 bits format on playback and capture pipelines if codec needs, e.g. RT5650 HS/SPK codec. Signed-off-by: Mac Chiang <mac.chiang@intel.com>
1 parent 37b36f7 commit d7e4c97

5 files changed

Lines changed: 136 additions & 17 deletions

File tree

tools/topology/topology2/cavs-mixin-mixout-eqiir-dts-ssp.conf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ Object.Pipeline {
4646
copier_type "SSP"
4747
stream_name "$HEADSET_CODEC_NAME"
4848
node_type $I2S_LINK_OUTPUT_CLASS
49+
IncludeByKey.SSP_HS_FMT_24 {
50+
"true" {
51+
Object.Base.output_audio_format [
52+
{
53+
out_bit_depth 32
54+
out_valid_bit_depth 24
55+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
56+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
57+
}
58+
]
59+
}
60+
}
4961
}
5062

5163
Object.Widget.gain.1 {
@@ -76,6 +88,18 @@ Object.Pipeline {
7688
copier_type "SSP"
7789
stream_name "$SPEAKER_CODEC_NAME"
7890
node_type $I2S_LINK_OUTPUT_CLASS
91+
IncludeByKey.SSP_SPK_FMT_24 {
92+
"true" {
93+
Object.Base.output_audio_format [
94+
{
95+
out_bit_depth 32
96+
out_valid_bit_depth 24
97+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
98+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
99+
}
100+
]
101+
}
102+
}
79103
}
80104

81105
Object.Widget.gain.1 {

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ Object.Pipeline {
4747
copier_type "SSP"
4848
stream_name "$HEADSET_CODEC_NAME"
4949
node_type $I2S_LINK_OUTPUT_CLASS
50+
IncludeByKey.SSP_HS_FMT_24 {
51+
"true" {
52+
Object.Base.output_audio_format [
53+
{
54+
out_bit_depth 32
55+
out_valid_bit_depth 24
56+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
57+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
58+
}
59+
]
60+
}
61+
}
5062
}
5163

5264
Object.Widget.gain.1 {
@@ -64,6 +76,18 @@ Object.Pipeline {
6476
copier_type "SSP"
6577
stream_name "$SPEAKER_CODEC_NAME"
6678
node_type $I2S_LINK_OUTPUT_CLASS
79+
IncludeByKey.SSP_SPK_FMT_24 {
80+
"true" {
81+
Object.Base.output_audio_format [
82+
{
83+
out_bit_depth 32
84+
out_valid_bit_depth 24
85+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
86+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
87+
}
88+
]
89+
}
90+
}
6791
}
6892

6993
Object.Widget.gain.1 {

tools/topology/topology2/cavs-rt5682.conf

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ Define {
118118
DMIC_PIPELINE_PRIORITY 1
119119
ECHO_REF_PIPELINE_PRIORITY 0
120120
PLAYBACK_PIPELINE_SRC "volume"
121+
SSP_SPK_FMT_24 false
122+
SSP_HS_FMT_24 false
121123
}
122124

123125
# override defaults with platform-specific config
@@ -229,6 +231,30 @@ Object.Pipeline {
229231
Object.Widget.host-copier.1 {
230232
stream_name '$HEADSET_CAPTURE_PCM_STREAM_NAME'
231233
pcm_id $HEADSET_PCM_ID
234+
IncludeByKey.SSP_HS_FMT_24 {
235+
"true" {
236+
Object.Base.input_audio_format [
237+
{
238+
in_bit_depth 32
239+
in_valid_bit_depth 32
240+
}
241+
]
242+
Object.Base.output_audio_format [
243+
{
244+
out_bit_depth 32
245+
out_valid_bit_depth 24
246+
}
247+
{
248+
out_bit_depth 32
249+
out_valid_bit_depth 32
250+
}
251+
{
252+
out_bit_depth 16
253+
out_valid_bit_depth 16
254+
}
255+
]
256+
}
257+
}
232258
}
233259
}
234260
]
@@ -245,18 +271,42 @@ Object.Pipeline {
245271
copier_type "SSP"
246272
stream_name "$HEADSET_CODEC_NAME"
247273
node_type $I2S_LINK_INPUT_CLASS
248-
Object.Base.input_audio_format [
249-
{
250-
in_bit_depth 32
251-
in_valid_bit_depth 32
274+
275+
IncludeByKey.SSP_HS_FMT_24 {
276+
"true" {
277+
Object.Base.input_audio_format [
278+
{
279+
in_bit_depth 32
280+
in_valid_bit_depth 24
281+
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
282+
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
283+
}
284+
]
285+
Object.Base.output_audio_format [
286+
{
287+
out_bit_depth 32
288+
out_valid_bit_depth 32
289+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
290+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
291+
}
292+
]
252293
}
253-
]
254-
Object.Base.output_audio_format [
255-
{
256-
out_bit_depth 32
257-
out_valid_bit_depth 32
294+
"false" {
295+
Object.Base.input_audio_format [
296+
{
297+
in_bit_depth 32
298+
in_valid_bit_depth 32
299+
}
300+
301+
]
302+
Object.Base.output_audio_format [
303+
{
304+
out_bit_depth 32
305+
out_valid_bit_depth 32
306+
}
307+
]
258308
}
259-
]
309+
}
260310
}
261311
}
262312
]

tools/topology/topology2/platform/intel/speaker-echo-ref.conf

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,26 @@ Object.Pipeline {
1414
stream_name $SPEAKER_CODEC_NAME
1515
node_type $I2S_LINK_INPUT_CLASS
1616
num_input_audio_formats 1
17-
Object.Base.input_audio_format [
18-
{
19-
in_bit_depth 32
20-
in_valid_bit_depth 32
17+
IncludeByKey.SSP_SPK_FMT_24 {
18+
"true" {
19+
Object.Base.input_audio_format [
20+
{
21+
in_bit_depth 32
22+
in_valid_bit_depth 24
23+
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
24+
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
25+
}
26+
]
2127
}
22-
]
28+
"false" {
29+
Object.Base.input_audio_format [
30+
{
31+
in_bit_depth 32
32+
in_valid_bit_depth 32
33+
}
34+
]
35+
}
36+
}
2337
num_output_audio_formats 1
2438
Object.Base.output_audio_format [
2539
{

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,19 @@ NHLT_BIN=nhlt-sof-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_I
6464
SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\
6565
INCLUDE_ECHO_REF=true,INCLUDE_BT_OFFLOAD=false"
6666

67+
"cavs-rt5682\;sof-mtl-rt5650\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\
68+
PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\
69+
NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_INDEX=2,\
70+
SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\
71+
BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,\
72+
DEEP_BUF_SPK=true,SSP_SPK_FMT_24=true,SSP_HS_FMT_24=true"
73+
6774
"cavs-rt5682\;sof-mtl-rt5650-dts\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\
6875
PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\
6976
NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_INDEX=2,\
7077
SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\
71-
BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,USE_CHAIN_DMA=true,\
72-
GOOGLE_RTC_AEC_SUPPORT=1,DEEP_BUF_SPK=true,PLAYBACK_PIPELINE_SRC=dts"
78+
BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,\
79+
DEEP_BUF_SPK=true,SSP_SPK_FMT_24=true,SSP_HS_FMT_24=true,PLAYBACK_PIPELINE_SRC=dts"
7380

7481
#ES83x6+HDMI-IN
7582
"cavs-es83x6\;sof-mtl-es83x6-ssp1-hdmi-ssp02\;PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,\

0 commit comments

Comments
 (0)