Skip to content

Commit be01bce

Browse files
committed
Tools: Topology: Add selector to compress playback pipeline
The purpose of this patch is to add conversion of possible mono output from decoder to stereo format in the selector (micsel) module. If the decoded output is stereo, the selector goes to pass-through mode with minimal impact to processing load. This patch adds the mono format to all needed objects (host-copier, decoder, module-copier, src, input of selector). Selector has single stereo, S32_LE, 48 kHz output format. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 30919f4 commit be01bce

8 files changed

Lines changed: 243 additions & 10 deletions

tools/topology/topology2/include/formats/compr_input_audio_formats.conf

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,64 @@
1-
# All input formats for e.g. host-copier
2-
num_input_audio_formats 20
1+
# All input formats for e.g. host-copier, decoder,
2+
# and module-copier
3+
num_input_audio_formats 40
34
CombineArrays.Object.Base.input_audio_format [
5+
{
6+
in_channels [ 1 ]
7+
in_rate [
8+
8000
9+
44100
10+
48000
11+
96000
12+
192000
13+
]
14+
in_bit_depth [ 8 ]
15+
in_valid_bit_depth [ 8 ]
16+
in_sample_type [ $SAMPLE_TYPE_UNSIGNED_INTEGER ]
17+
in_ch_map [ $CHANNEL_MAP_MONO ]
18+
in_ch_cfg [ $CHANNEL_CONFIG_MONO ]
19+
}
20+
{
21+
in_channels [ 1 ]
22+
in_rate [
23+
8000
24+
44100
25+
48000
26+
96000
27+
192000
28+
]
29+
in_bit_depth [ 16 ]
30+
in_valid_bit_depth [ 16 ]
31+
in_ch_map [ $CHANNEL_MAP_MONO ]
32+
in_ch_cfg [ $CHANNEL_CONFIG_MONO ]
33+
}
34+
{
35+
in_channels [ 1 ]
36+
in_rate [
37+
8000
38+
44100
39+
48000
40+
96000
41+
192000
42+
]
43+
in_bit_depth [ 32 ]
44+
in_valid_bit_depth [ 24 ]
45+
in_ch_map [ $CHANNEL_MAP_MONO ]
46+
in_ch_cfg [ $CHANNEL_CONFIG_MONO ]
47+
}
48+
{
49+
in_channels [ 1 ]
50+
in_rate [
51+
8000
52+
44100
53+
48000
54+
96000
55+
192000
56+
]
57+
in_bit_depth [ 32 ]
58+
in_valid_bit_depth [ 32 ]
59+
in_ch_map [ $CHANNEL_MAP_MONO ]
60+
in_ch_cfg [ $CHANNEL_CONFIG_MONO ]
61+
}
462
{
563
in_rate [
664
8000
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# All input formats for e.g. host-copier, decoder,
2+
# and module-copier
3+
num_input_audio_formats 10
4+
CombineArrays.Object.Base.input_audio_format [
5+
{
6+
in_channels [ 1 ]
7+
in_rate [
8+
8000
9+
44100
10+
48000
11+
96000
12+
192000
13+
]
14+
in_bit_depth [ 32 ]
15+
in_valid_bit_depth [ 32 ]
16+
in_ch_map [ $CHANNEL_MAP_MONO ]
17+
in_ch_cfg [ $CHANNEL_CONFIG_MONO ]
18+
}
19+
{
20+
in_rate [
21+
8000
22+
44100
23+
48000
24+
96000
25+
192000
26+
]
27+
in_bit_depth [ 32 ]
28+
in_valid_bit_depth [ 32 ]
29+
}
30+
]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Input and output audio formats for SRC
2+
num_input_audio_formats 14
3+
CombineArrays.Object.Base.input_audio_format [
4+
{
5+
in_rate [
6+
8000
7+
11025
8+
12000
9+
16000
10+
22050
11+
24000
12+
32000
13+
44100
14+
48000
15+
64000
16+
88200
17+
96000
18+
176400
19+
192000
20+
]
21+
in_bit_depth [ 32 ]
22+
in_valid_bit_depth [ 32 ]
23+
}
24+
]
25+
26+
num_output_audio_formats 1
27+
Object.Base.output_audio_format [
28+
{
29+
out_channels 2
30+
out_rate 48000
31+
out_bit_depth 32
32+
out_valid_bit_depth 32
33+
}
34+
]

tools/topology/topology2/include/formats/compr_output_audio_formats.conf

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,63 @@
1-
# Output audio formats for e.g. host-copier
2-
num_output_audio_formats 20
1+
# Output audio formats for e.g. host-copier and decoder
2+
num_output_audio_formats 40
33
CombineArrays.Object.Base.output_audio_format [
4+
{
5+
out_channels [ 1 ]
6+
out_rate [
7+
8000
8+
44100
9+
48000
10+
96000
11+
192000
12+
]
13+
out_bit_depth [ 8 ]
14+
out_valid_bit_depth [ 8 ]
15+
out_sample_type [ $SAMPLE_TYPE_UNSIGNED_INTEGER ]
16+
out_ch_map [ $CHANNEL_MAP_MONO ]
17+
out_ch_cfg [ $CHANNEL_CONFIG_MONO ]
18+
}
19+
{
20+
out_channels [ 1 ]
21+
out_rate [
22+
8000
23+
44100
24+
48000
25+
96000
26+
192000
27+
]
28+
out_bit_depth [ 16 ]
29+
out_valid_bit_depth [ 16 ]
30+
out_ch_map [ $CHANNEL_MAP_MONO ]
31+
out_ch_cfg [ $CHANNEL_CONFIG_MONO ]
32+
}
33+
{
34+
out_channels [ 1 ]
35+
out_rate [
36+
8000
37+
44100
38+
48000
39+
96000
40+
192000
41+
]
42+
out_bit_depth [ 32 ]
43+
out_valid_bit_depth [ 24 ]
44+
out_ch_map [ $CHANNEL_MAP_MONO ]
45+
out_ch_cfg [ $CHANNEL_CONFIG_MONO ]
46+
}
47+
{
48+
out_channels [ 1 ]
49+
out_rate [
50+
8000
51+
44100
52+
48000
53+
96000
54+
192000
55+
]
56+
out_bit_depth [ 32 ]
57+
out_valid_bit_depth [ 32 ]
58+
out_ch_map [ $CHANNEL_MAP_MONO ]
59+
out_ch_cfg [ $CHANNEL_CONFIG_MONO ]
60+
}
461
{
562
out_rate [
663
8000

tools/topology/topology2/include/formats/compr_output_audio_formats_s32.conf

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
# Output audio formats for e.g. module-copier, s32
2-
num_output_audio_formats 5
1+
# Output audio formats e.g. module-copier
2+
num_output_audio_formats 10
33
CombineArrays.Object.Base.output_audio_format [
4+
{
5+
out_channels [ 1 ]
6+
out_rate [
7+
8000
8+
44100
9+
48000
10+
96000
11+
192000
12+
]
13+
out_bit_depth [ 32 ]
14+
out_valid_bit_depth [ 32 ]
15+
out_ch_map [ $CHANNEL_MAP_MONO ]
16+
out_ch_cfg [ $CHANNEL_CONFIG_MONO ]
17+
}
418
{
519
out_rate [
620
8000
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Output audio formats e.g. module-copier
2+
num_output_audio_formats 5
3+
CombineArrays.Object.Base.output_audio_format [
4+
{
5+
out_rate [
6+
8000
7+
44100
8+
48000
9+
96000
10+
192000
11+
]
12+
out_bit_depth [ 32 ]
13+
out_valid_bit_depth [ 32 ]
14+
}
15+
]

tools/topology/topology2/include/pipelines/cavs/compr-playback.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<include/components/pipeline.conf>
2323
<include/components/gain.conf>
2424
<include/components/decoder.conf>
25+
<include/components/micsel.conf>
2526

2627
Class.Pipeline."compr-playback" {
2728

@@ -57,6 +58,8 @@ Class.Pipeline."compr-playback" {
5758

5859
module-copier."2" {}
5960

61+
micsel."1" {}
62+
6063
src."1" {}
6164

6265
gain."1" {}
@@ -77,6 +80,10 @@ Class.Pipeline."compr-playback" {
7780
}
7881
{
7982
source module-copier.$index.2
83+
sink micsel.$index.1
84+
}
85+
{
86+
source micsel.$index.1
8087
sink src.$index.1
8188
}
8289
{

tools/topology/topology2/platform/intel/compr.conf

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,21 @@ IncludeByKey.COMPRESSED_1 {
2424
<include/formats/compr_output_audio_formats_s32.conf>
2525
}
2626

27+
# converts the input to stereo
28+
Object.Widget.micsel.1 {
29+
Object.Control.bytes."1" {
30+
name '$COMPR_PCM_NAME selector bytes'
31+
<include/components/micsel/stereo_endpoint_playback_updownmix.conf>
32+
}
33+
<include/formats/compr_input_audio_formats_s32.conf>
34+
<include/formats/compr_output_audio_formats_s32_stereo.conf>
35+
}
36+
2737
# converts the input to 48KHz
2838
# note: this is wrong for 96/192KHz HiRes audio!!!!
2939
Object.Widget.src.1 {
3040
rate_out 48000
31-
32-
<include/components/src_format_s32_convert_to_48k.conf>
41+
<include/formats/compr_input_output_formats_src_s32_stereo_to_48k.conf>
3342
}
3443

3544
Object.Widget.gain.1 {
@@ -130,12 +139,21 @@ IncludeByKey.COMPRESSED_2 {
130139
<include/formats/compr_output_audio_formats_s32.conf>
131140
}
132141

142+
# converts the input to stereo
143+
Object.Widget.micsel.1 {
144+
Object.Control.bytes."1" {
145+
name '$COMPR_2_PCM_NAME selector bytes'
146+
<include/components/micsel/stereo_endpoint_playback_updownmix.conf>
147+
}
148+
<include/formats/compr_input_audio_formats_s32.conf>
149+
<include/formats/compr_output_audio_formats_s32_stereo.conf>
150+
}
151+
133152
# converts the input to 48KHz
134153
# note: this is wrong for 96/192KHz HiRes audio!!!!
135154
Object.Widget.src.1 {
136155
rate_out 48000
137-
138-
<include/components/src_format_s32_convert_to_48k.conf>
156+
<include/formats/compr_input_output_formats_src_s32_stereo_to_48k.conf>
139157
}
140158

141159
Object.Widget.gain.1 {

0 commit comments

Comments
 (0)