Skip to content

Commit 08efff3

Browse files
committed
topology2: force all SoundWire link-side copiers to use S24_LE
Using S32_LE wastes bandwdith for no good reason, we should use 24 bits on the link to maximize bus efficiency with the 9.6 MHz bus clock. There is no need for a kernel-side change, the dailink fixup already changes the dailink format based on the topology information. Link: #8960 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent 0a39bb5 commit 08efff3

File tree

5 files changed

+62
-170
lines changed

5 files changed

+62
-170
lines changed

tools/topology/topology2/cavs-sdw.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Define {
7979
PASSTHROUGH false
8080
SDW_JACK_CAPTURE_CH 2
8181
ADD_BT false
82+
SDW_LINK_VALID_BITS 24
8283
}
8384

8485
# override defaults with platform-specific config

tools/topology/topology2/platform/intel/sdw-amp-generic.conf

Lines changed: 34 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Define {
99
SDW_AMP_IN_BE_ID 3
1010
AMP_FEEDBACK_CH 2
1111
SDW_AMP_FEEDBACK true
12-
SDW_AMP_FMT_24 false
1312
}
1413

1514
Object.Dai.ALH [
@@ -55,19 +54,15 @@ IncludeByKey.PASSTHROUGH {
5554
Object.Widget.alh-copier.1 {
5655
stream_name $SDW_SPK_STREAM
5756
node_type $ALH_LINK_OUTPUT_CLASS
58-
IncludeByKey.SDW_AMP_FMT_24 {
59-
"true" {
60-
num_output_audio_formats 1
61-
Object.Base.output_audio_format [
62-
{
63-
out_bit_depth 32
64-
out_valid_bit_depth 24
65-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
66-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
67-
}
68-
]
57+
num_output_audio_formats 1
58+
Object.Base.output_audio_format [
59+
{
60+
out_bit_depth 32
61+
out_valid_bit_depth $SDW_LINK_VALID_BITS
62+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
63+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
6964
}
70-
}
65+
]
7166
}
7267
Object.Widget.gain.1 {
7368
Object.Control.mixer.1 {
@@ -150,44 +145,15 @@ IncludeByKey.PASSTHROUGH {
150145
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
151146
}
152147
]
153-
IncludeByKey.SDW_AMP_FMT_24 {
154-
"true" {
155-
num_output_audio_formats 1
156-
Object.Base.output_audio_format [
157-
{
158-
out_bit_depth 32
159-
out_valid_bit_depth 24
160-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
161-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
162-
163-
}
164-
]
165-
}
166-
"false" {
167-
num_output_audio_formats 3
168-
num_output_audio_formats 3
169-
Object.Base.output_audio_format [
170-
{
171-
out_bit_depth 16
172-
out_valid_bit_depth 16
173-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
174-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
175-
}
176-
{
177-
out_bit_depth 32
178-
out_valid_bit_depth 24
179-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
180-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
181-
}
182-
{
183-
out_bit_depth 32
184-
out_valid_bit_depth 32
185-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
186-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
187-
}
188-
]
148+
num_output_audio_formats 1
149+
Object.Base.output_audio_format [
150+
{
151+
out_bit_depth 32
152+
out_valid_bit_depth $SDW_LINK_VALID_BITS
153+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
154+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
189155
}
190-
}
156+
]
191157
}
192158
]
193159
pipeline [
@@ -229,28 +195,14 @@ IncludeByKey.NUM_SDW_AMP_LINKS {
229195
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
230196
}
231197
]
232-
IncludeByKey.SDW_AMP_FMT_24 {
233-
"true" {
234-
Object.Base.output_audio_format [
235-
{
236-
out_bit_depth 32
237-
out_valid_bit_depth 24
238-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
239-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
240-
}
241-
]
242-
}
243-
"false" {
244-
Object.Base.output_audio_format [
245-
{
246-
out_bit_depth 32
247-
out_valid_bit_depth 32
248-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
249-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
250-
}
251-
]
198+
Object.Base.output_audio_format [
199+
{
200+
out_bit_depth 32
201+
out_valid_bit_depth $SDW_LINK_VALID_BITS
202+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
203+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
252204
}
253-
}
205+
]
254206
}
255207
]
256208
IncludeByKey.SDW_AMP_FEEDBACK {
@@ -268,28 +220,14 @@ IncludeByKey.NUM_SDW_AMP_LINKS {
268220
num_output_audio_formats 1
269221
num_output_pins 1
270222

271-
IncludeByKey.SDW_AMP_FMT_24 {
272-
"true" {
273-
Object.Base.input_audio_format [
274-
{
275-
in_bit_depth 32
276-
in_valid_bit_depth 24
277-
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
278-
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
279-
}
280-
]
281-
}
282-
"false" {
283-
Object.Base.input_audio_format [
284-
{
285-
in_bit_depth 32
286-
in_valid_bit_depth 32
287-
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
288-
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
289-
}
290-
]
223+
Object.Base.input_audio_format [
224+
{
225+
in_bit_depth 32
226+
in_valid_bit_depth $SDW_LINK_VALID_BITS
227+
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
228+
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
291229
}
292-
}
230+
]
293231
Object.Base.output_audio_format [
294232
{
295233
out_bit_depth 32
@@ -449,7 +387,7 @@ IncludeByKey.SDW_AMP_FEEDBACK {
449387
{
450388
in_channels 4
451389
in_bit_depth 32
452-
in_valid_bit_depth 32
390+
in_valid_bit_depth $SDW_LINK_VALID_BITS
453391
in_ch_cfg $CHANNEL_CONFIG_3_POINT_1
454392
in_ch_map $CHANNEL_MAP_3_POINT_1
455393
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
@@ -473,7 +411,7 @@ IncludeByKey.SDW_AMP_FEEDBACK {
473411
Object.Base.input_audio_format [
474412
{
475413
in_bit_depth 32
476-
in_valid_bit_depth 32
414+
in_valid_bit_depth $SDW_LINK_VALID_BITS
477415
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
478416
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
479417
}
@@ -482,7 +420,7 @@ IncludeByKey.SDW_AMP_FEEDBACK {
482420
{
483421
out_bit_depth 32
484422
out_valid_bit_depth 32
485-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
423+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
486424
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
487425
}
488426
]
@@ -510,7 +448,7 @@ IncludeByKey.SDW_AMP_FEEDBACK {
510448

511449
Object.PCM.pcm_caps.1 {
512450
name "amp feedback"
513-
formats 'S16_LE,S32_LE'
451+
formats 'S16_LE,S24_LE,S32_LE'
514452
channels_min $AMP_FEEDBACK_CH
515453
channels_max $AMP_FEEDBACK_CH
516454
}

tools/topology/topology2/platform/intel/sdw-dmic-generic.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Object.Widget {
5252
Object.Base.input_audio_format [
5353
{
5454
in_bit_depth 32
55-
in_valid_bit_depth 32
55+
in_valid_bit_depth $SDW_LINK_VALID_BITS
5656
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
5757
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
5858
}

tools/topology/topology2/platform/intel/sdw-jack-generic.conf

Lines changed: 23 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ IncludeByKey.PASSTHROUGH {
1010
Define {
1111
JACK_PLAYBACK_PCM_NAME "Jack Out"
1212
JACK_CAPTURE_PCM_NAME "Jack In"
13-
SDW_JACK_FMT_24 "false"
1413
}
1514

1615
#
@@ -76,19 +75,15 @@ IncludeByKey.PASSTHROUGH {
7675
Object.Widget.alh-copier.1 {
7776
stream_name $SDW_JACK_OUT_STREAM
7877
node_type $ALH_LINK_OUTPUT_CLASS
79-
IncludeByKey.SDW_JACK_FMT_24 {
80-
"true" {
81-
num_output_audio_formats 1
82-
Object.Base.output_audio_format [
83-
{
84-
out_bit_depth 32
85-
out_valid_bit_depth 24
86-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
87-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256)) | ($out_sample_type * 65536)]"
88-
}
89-
]
78+
num_output_audio_formats 1
79+
Object.Base.output_audio_format [
80+
{
81+
out_bit_depth 32
82+
out_valid_bit_depth $SDW_LINK_VALID_BITS
83+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
84+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256)) | ($out_sample_type * 65536)]"
9085
}
91-
}
86+
]
9287
}
9388
Object.Widget.gain.1 {
9489
Object.Control.mixer.1 {
@@ -170,42 +165,15 @@ IncludeByKey.PASSTHROUGH {
170165
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
171166
}
172167
]
173-
IncludeByKey.SDW_JACK_FMT_24 {
174-
"true" {
175-
num_output_audio_formats 1
176-
Object.Base.output_audio_format [
177-
{
178-
out_bit_depth 32
179-
out_valid_bit_depth 24
180-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
181-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
182-
}
183-
]
184-
}
185-
"false" {
186-
num_output_audio_formats 3
187-
Object.Base.output_audio_format [
188-
{
189-
out_bit_depth 16
190-
out_valid_bit_depth 16
191-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
192-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
193-
}
194-
{
195-
out_bit_depth 32
196-
out_valid_bit_depth 24
197-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
198-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
199-
}
200-
{
201-
out_bit_depth 32
202-
out_valid_bit_depth 32
203-
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
204-
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
205-
}
206-
]
168+
num_output_audio_formats 1
169+
Object.Base.output_audio_format [
170+
{
171+
out_bit_depth 32
172+
out_valid_bit_depth $SDW_LINK_VALID_BITS
173+
out_sample_type $SAMPLE_TYPE_MSB_INTEGER
174+
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
207175
}
208-
}
176+
]
209177
}
210178
]
211179
pipeline [
@@ -323,28 +291,14 @@ Object.Widget {
323291
num_output_audio_formats 1
324292
num_output_pins 1
325293

326-
IncludeByKey.SDW_JACK_FMT_24 {
327-
"true" {
328-
Object.Base.input_audio_format [
329-
{
330-
in_bit_depth 32
331-
in_valid_bit_depth 24
332-
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
333-
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
334-
}
335-
]
336-
}
337-
"false" {
338-
Object.Base.input_audio_format [
339-
{
340-
in_bit_depth 32
341-
in_valid_bit_depth 32
342-
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
343-
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
344-
}
345-
]
294+
Object.Base.input_audio_format [
295+
{
296+
in_bit_depth 32
297+
in_valid_bit_depth $SDW_LINK_VALID_BITS
298+
in_sample_type $SAMPLE_TYPE_MSB_INTEGER
299+
in_fmt_cfg "$[($in_channels | ($in_valid_bit_depth * 256))]"
346300
}
347-
}
301+
]
348302
Object.Base.output_audio_format [
349303
{
350304
out_bit_depth 32

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack"
5757
"cavs-sdw\;sof-mtl-cs42l43-l0-cs35l56-l12\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\
5858
SDW_SPK_STREAM=Playback-SmartAmp,SDW_SPK_IN_STREAM=Capture-SmartAmp,\
5959
SDW_DMIC_STREAM=Capture-SmartMic,SDW_JACK_OUT_STREAM=Playback-SimpleJack,\
60-
SDW_JACK_IN_STREAM=Capture-SimpleJack,SDW_AMP_FMT_24=true,SDW_JACK_FMT_24=true"
60+
SDW_JACK_IN_STREAM=Capture-SimpleJack"
6161

6262
"cavs-sdw\;sof-mtl-cs42l43-l0-cs35l56-l23\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\
6363
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\
64-
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack,\
65-
SDW_AMP_FMT_24=true,SDW_JACK_FMT_24=true"
64+
SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack"
6665

6766
# Below topologies are used on Chromebooks
6867

@@ -149,5 +148,5 @@ PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,\
149148
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2.bin,\
150149
BT_NAME=SSP1-BT,BT_INDEX=1,BT_PCM_ID=20,BT_ID=8,BT_PCM_NAME=Bluetooth,ADD_BT=true,\
151150
NUM_SDW_AMP_LINKS=1,SDW_SPK_STREAM=SDW2-Playback,SDW_AMP_FEEDBACK=false,\
152-
SDW_JACK_CAPTURE_CH=1,SDW_AMP_FMT_24=true"
151+
SDW_JACK_CAPTURE_CH=1"
153152
)

0 commit comments

Comments
 (0)