Skip to content

Commit 66de214

Browse files
singalsukv2019i
authored andcommitted
Tools: Topology: Add FLOAT_LE and U8 formats to SDW jack
This patch adds option to add the float and 8-bit unsigned format to SDW jack playback and capture. The formats are added only if PCM_FORMAT_ALL is set to true. The default value in common_definitions.conf if false. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 8830729 commit 66de214

2 files changed

Lines changed: 122 additions & 33 deletions

File tree

tools/topology/topology2/include/common/common_definitions.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,6 @@ Define {
6767
SSP_BLOB_VERSION_1_0 0x100
6868
SSP_BLOB_VERSION_1_5 0x105
6969
SSP_BLOB_VERSION_3_0 0x300
70+
71+
PCM_FORMAT_ALL false # Basic s16/s24/s32, no float, 8-bit etc.
7072
}

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

Lines changed: 120 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,60 @@ IncludeByKey.PASSTHROUGH {
6060
Object.Widget.host-copier.1 {
6161
stream_name "volume playback 0"
6262
pcm_id 0
63-
Object.Base.input_audio_format [
64-
{
65-
in_rate $JACK_RATE
66-
in_bit_depth 16
67-
in_valid_bit_depth 16
68-
}
69-
{
70-
in_rate $JACK_RATE
71-
in_bit_depth 32
72-
in_valid_bit_depth 32
63+
IncludeByKey.PCM_FORMAT_ALL {
64+
"true" {
65+
num_input_audio_formats 5
66+
Object.Base.input_audio_format [
67+
{
68+
in_rate $JACK_RATE
69+
in_bit_depth 16
70+
in_valid_bit_depth 16
71+
}
72+
{
73+
in_rate $JACK_RATE
74+
in_bit_depth 32
75+
in_valid_bit_depth 32
76+
}
77+
{
78+
in_rate $JACK_RATE
79+
in_bit_depth 32
80+
in_valid_bit_depth 24
81+
}
82+
{
83+
in_rate $JACK_RATE
84+
in_bit_depth 32
85+
in_valid_bit_depth 32
86+
in_sample_type $SAMPLE_TYPE_FLOAT
87+
}
88+
{
89+
in_rate $JACK_RATE
90+
in_bit_depth 8
91+
in_valid_bit_depth 8
92+
in_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER
93+
}
94+
]
7395
}
74-
{
75-
in_rate $JACK_RATE
76-
in_bit_depth 32
77-
in_valid_bit_depth 24
96+
"false" {
97+
num_input_audio_formats 3
98+
Object.Base.input_audio_format [
99+
{
100+
in_rate $JACK_RATE
101+
in_bit_depth 16
102+
in_valid_bit_depth 16
103+
}
104+
{
105+
in_rate $JACK_RATE
106+
in_bit_depth 32
107+
in_valid_bit_depth 32
108+
}
109+
{
110+
in_rate $JACK_RATE
111+
in_bit_depth 32
112+
in_valid_bit_depth 24
113+
}
114+
]
78115
}
79-
]
116+
}
80117
Object.Base.output_audio_format [
81118
{
82119
out_rate $JACK_RATE
@@ -311,24 +348,60 @@ Object.Pipeline.host-gateway-capture [
311348
in_valid_bit_depth 32
312349
}
313350
]
314-
num_output_audio_formats 3
315-
Object.Base.output_audio_format [
316-
{
317-
out_rate $JACK_RATE
318-
out_bit_depth 16
319-
out_valid_bit_depth 16
320-
}
321-
{
322-
out_rate $JACK_RATE
323-
out_bit_depth 32
324-
out_valid_bit_depth 24
351+
IncludeByKey.PCM_FORMAT_ALL {
352+
"true" {
353+
num_output_audio_formats 5
354+
Object.Base.output_audio_format [
355+
{
356+
out_rate $JACK_RATE
357+
out_bit_depth 16
358+
out_valid_bit_depth 16
359+
}
360+
{
361+
out_rate $JACK_RATE
362+
out_bit_depth 32
363+
out_valid_bit_depth 24
364+
}
365+
{
366+
out_rate $JACK_RATE
367+
out_bit_depth 32
368+
out_valid_bit_depth 32
369+
}
370+
{
371+
out_rate $JACK_RATE
372+
out_bit_depth 32
373+
out_valid_bit_depth 32
374+
out_sample_type $SAMPLE_TYPE_FLOAT
375+
}
376+
{
377+
out_rate $JACK_RATE
378+
out_bit_depth 8
379+
out_valid_bit_depth 8
380+
out_sample_type $SAMPLE_TYPE_UNSIGNED_INTEGER
381+
}
382+
]
325383
}
326-
{
327-
out_rate $JACK_RATE
328-
out_bit_depth 32
329-
out_valid_bit_depth 32
384+
"false" {
385+
num_output_audio_formats 3
386+
Object.Base.output_audio_format [
387+
{
388+
out_rate $JACK_RATE
389+
out_bit_depth 16
390+
out_valid_bit_depth 16
391+
}
392+
{
393+
out_rate $JACK_RATE
394+
out_bit_depth 32
395+
out_valid_bit_depth 24
396+
}
397+
{
398+
out_rate $JACK_RATE
399+
out_bit_depth 32
400+
out_valid_bit_depth 32
401+
}
402+
]
330403
}
331-
]
404+
}
332405
}
333406
}
334407
]
@@ -418,7 +491,14 @@ Object.PCM.pcm [
418491

419492
Object.PCM.pcm_caps.1 {
420493
name "volume playback 0"
421-
formats 'S16_LE,S24_LE,S32_LE'
494+
IncludeByKey.PCM_FORMAT_ALL {
495+
"true" {
496+
formats 'S16_LE,S24_LE,S32_LE,U8,FLOAT_LE'
497+
}
498+
"false" {
499+
formats 'S16_LE,S24_LE,S32_LE'
500+
}
501+
}
422502
IncludeByKey.JACK_RATE {
423503
"48000" {
424504
rates '48000'
@@ -442,7 +522,14 @@ Object.PCM.pcm [
442522

443523
Object.PCM.pcm_caps.1 {
444524
name "Passthrough Capture 0"
445-
formats 'S16_LE,S24_LE,S32_LE'
525+
IncludeByKey.PCM_FORMAT_ALL {
526+
"true" {
527+
formats 'S16_LE,S24_LE,S32_LE,U8,FLOAT_LE'
528+
}
529+
"false" {
530+
formats 'S16_LE,S24_LE,S32_LE'
531+
}
532+
}
446533
IncludeByKey.JACK_RATE {
447534
"48000" {
448535
rates '48000'

0 commit comments

Comments
 (0)