Skip to content

Commit eff2fbb

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 40f379c commit eff2fbb

File tree

8 files changed

+266
-8
lines changed

8 files changed

+266
-8
lines changed

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

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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Micsel single format output
2+
num_output_audio_formats 1
3+
Object.Base.output_audio_format [
4+
{
5+
out_channels 2
6+
out_rate 48000
7+
out_bit_depth 32
8+
out_valid_bit_depth 32
9+
}
10+
]

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

@@ -59,6 +60,8 @@ Class.Pipeline."compr-playback" {
5960

6061
src."1" {}
6162

63+
micsel."1" {}
64+
6265
gain."1" {}
6366

6467
mixin."1" {}
@@ -81,6 +84,10 @@ Class.Pipeline."compr-playback" {
8184
}
8285
{
8386
source src.$index.1
87+
sink micsel.$index.1
88+
}
89+
{
90+
source micsel.$index.1
8491
sink gain.$index.1
8592
}
8693
{

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@ IncludeByKey.COMPRESSED_1 {
2828
# note: this is wrong for 96/192KHz HiRes audio!!!!
2929
Object.Widget.src.1 {
3030
rate_out 48000
31+
<include/formats/compr_input_output_formats_src_s32_to_48k.conf>
32+
}
3133

32-
<include/components/src_format_s32_convert_to_48k.conf>
34+
# converts the input to stereo
35+
Object.Widget.micsel.1 {
36+
Object.Control.bytes."1" {
37+
name '$COMPR_PCM_NAME selector bytes'
38+
<include/components/micsel/stereo_endpoint_playback_updownmix.conf>
39+
}
40+
<include/formats/compr_input_audio_formats_s32_48k.conf>
41+
<include/formats/compr_output_audio_formats_s32_48k_stereo.conf>
3342
}
3443

3544
Object.Widget.gain.1 {
@@ -134,8 +143,17 @@ IncludeByKey.COMPRESSED_2 {
134143
# note: this is wrong for 96/192KHz HiRes audio!!!!
135144
Object.Widget.src.1 {
136145
rate_out 48000
146+
<include/formats/compr_input_output_formats_src_s32_to_48k.conf>
147+
}
137148

138-
<include/components/src_format_s32_convert_to_48k.conf>
149+
# converts the input to stereo
150+
Object.Widget.micsel.1 {
151+
Object.Control.bytes."1" {
152+
name '$COMPR_2_PCM_NAME selector bytes'
153+
<include/components/micsel/stereo_endpoint_playback_updownmix.conf>
154+
}
155+
<include/formats/compr_input_audio_formats_s32_48k.conf>
156+
<include/formats/compr_output_audio_formats_s32_48k_stereo.conf>
139157
}
140158

141159
Object.Widget.gain.1 {

0 commit comments

Comments
 (0)