Skip to content

Commit 64fe2ea

Browse files
singalsulgirdwood
authored andcommitted
Tools: Topology2: Add topology to test playback SRC conversions
This patch adds to development topologies a topology sof-hda-src-generic.tplg. It is similar to sof-hda-generic but adds to first playback PCM pipeline a SRC component after gain. The pipeline supports playback of S32_LE with 8 - 192 kHz rates. The cavs/src.conf is merged to src.conf, and the SRC format include files are brought up from cavs directory. The topology cavs-sdw-src-gain-mixin.tplg related .conf files are updated for common location. The missing rate_out attribute is added. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent d806350 commit 64fe2ea

File tree

10 files changed

+249
-108
lines changed

10 files changed

+249
-108
lines changed

tools/topology/topology2/cavs-sdw-src-gain-mixin.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<searchdir:include>
22
<searchdir:include/common>
33
<searchdir:include/components>
4-
<searchdir:include/components/cavs>
54
<searchdir:include/dais>
65
<searchdir:include/controls>
76
<searchdir:include/pipelines/cavs>
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
Define {
2+
ANALOG_PLAYBACK_PCM 'Analog Playback'
3+
ANALOG_CAPTURE_PCM 'Analog Capture'
4+
HDA_ANALOG_DAI_NAME 'Analog Playback and Capture'
5+
DEEP_BUFFER_PIPELINE_ID 15
6+
DEEP_BUFFER_PCM_ID 31
7+
DEEP_BUFFER_PIPELINE_SRC 'mixin.15.1'
8+
DEEP_BUFFER_PIPELINE_SINK 'mixout.2.1'
9+
DEEP_BUFFER_PCM_NAME 'Deepbuffer HDA Analog'
10+
}
11+
12+
# include deep buffer config if buffer size is in 1 - 1000 ms.
13+
IncludeByKey.DEEPBUFFER_FW_DMA_MS{
14+
"[1-1000]" "platform/intel/deep-buffer.conf"
15+
}
16+
17+
Object.Dai {
18+
HDA.0 {
19+
name $HDA_ANALOG_DAI_NAME
20+
dai_index 0
21+
id 4
22+
default_hw_conf_id 4
23+
Object.Base.hw_config.1 {
24+
name "HDA0"
25+
}
26+
direction duplex
27+
}
28+
}
29+
Object.Pipeline {
30+
mixout-gain-dai-copier-playback.0 {
31+
index 2
32+
33+
Object.Widget.copier.1 {
34+
stream_name $HDA_ANALOG_DAI_NAME
35+
dai_type "HDA"
36+
copier_type "HDA"
37+
}
38+
Object.Widget.gain.1 {
39+
Object.Control.mixer.1 {
40+
name '2 Main Playback Volume'
41+
}
42+
}
43+
}
44+
45+
host-copier-gain-src-mixin-playback.0 {
46+
index 1
47+
48+
Object.Widget.copier.1 {
49+
stream_name $ANALOG_PLAYBACK_PCM
50+
}
51+
52+
Object.Widget.src.1 {
53+
}
54+
55+
Object.Widget.gain.1 {
56+
Object.Control.mixer.1 {
57+
name '1 2nd Playback Volume'
58+
}
59+
}
60+
}
61+
62+
passthrough-capture.1 {
63+
index 3
64+
Object.Widget.copier.1 {
65+
stream_name $ANALOG_CAPTURE_PCM
66+
}
67+
}
68+
69+
passthrough-be.1 {
70+
index 4
71+
direction capture
72+
73+
Object.Widget.copier."1" {
74+
dai_type "HDA"
75+
type "dai_out"
76+
copier_type "HDA"
77+
stream_name $HDA_ANALOG_DAI_NAME
78+
node_type $HDA_LINK_INPUT_CLASS
79+
Object.Base.audio_format.1 {
80+
in_bit_depth 32
81+
in_valid_bit_depth 32
82+
out_bit_depth 32
83+
out_valid_bit_depth 32
84+
dma_buffer_size "$[$ibs * 2]"
85+
}
86+
}
87+
}
88+
}
89+
Object.PCM {
90+
pcm.0 {
91+
id 0
92+
name 'HDA Analog'
93+
Object.Base.fe_dai.1 {
94+
name "HDA Analog"
95+
}
96+
Object.PCM.pcm_caps.1 {
97+
direction "playback"
98+
name $ANALOG_PLAYBACK_PCM
99+
formats 'S32_LE,S24_LE,S16_LE'
100+
rate_min 8000
101+
rate_max 192000
102+
}
103+
Object.PCM.pcm_caps.2 {
104+
direction "capture"
105+
name $ANALOG_CAPTURE_PCM
106+
formats 'S32_LE,S24_LE,S16_LE'
107+
}
108+
direction duplex
109+
}
110+
}
111+
112+
# top-level pipeline connections
113+
Object.Base {
114+
route.1 {
115+
sink 'copier.HDA.2.1'
116+
source 'gain.2.1'
117+
}
118+
route.2 {
119+
source 'mixin.1.1'
120+
sink 'mixout.2.1'
121+
}
122+
route.3 {
123+
source 'copier.HDA.4.1'
124+
sink 'copier.host.3.1'
125+
}
126+
}

tools/topology/topology2/development/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100,EFX_FIR_PARAMS=passthrough,EFX_IIR_P
3737
HDA_CONFIG=efx,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\
3838
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-efx-generic-4ch.bin,USE_CHAIN_DMA=true,\
3939
DEEPBUFFER_FW_DMA_MS=100,EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough"
40+
# CAVS HDA topology with gain and SRC before mixin for HDA and passthrough pipelines for HDMI
41+
"sof-hda-generic\;sof-hda-src-generic\;HDA_CONFIG=src,USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100"
4042
)
4143
add_custom_target(topology2_dev)
4244

tools/topology/topology2/include/components/cavs/src.conf

Lines changed: 0 additions & 100 deletions
This file was deleted.

tools/topology/topology2/include/components/src.conf

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ Class.Widget."src" {
3737
token_ref "sof_tkn_comp.uuid"
3838
}
3939

40+
DefineAttribute."num_audio_formats" {
41+
# Token set reference name and type
42+
token_ref "sof_tkn_comp.word"
43+
}
44+
4045
#
4146
# Bespoke attributes for SRC
4247
#
@@ -65,10 +70,11 @@ Class.Widget."src" {
6570
]
6671

6772
!mandatory [
68-
"format"
6973
"rate_out"
7074
"num_input_audio_formats"
7175
"num_output_audio_formats"
76+
"num_input_pins"
77+
"num_output_pins"
7278
]
7379

7480
#
@@ -92,7 +98,12 @@ Class.Widget."src" {
9298
#
9399
# Default attributes for src
94100
#
95-
type "src"
96-
uuid "6d:32:c5:c1:90:83:b4:46:aa:47:95:c3:be:ca:65:50"
97-
no_pm "true"
101+
type "src"
102+
uuid "8d:b2:1b:e6:9a:14:1f:4c:b7:09:46:82:3e:f5:f5:ae"
103+
no_pm "true"
104+
period_sink_count 2
105+
period_source_count 2
106+
core_id 0
107+
num_input_pins 1
108+
num_output_pins 1
98109
}

tools/topology/topology2/include/components/cavs/src_format.conf renamed to tools/topology/topology2/include/components/src_format.conf

File renamed without changes.

tools/topology/topology2/include/components/cavs/src_passthrough_format.conf renamed to tools/topology/topology2/include/components/src_passthrough_format.conf

File renamed without changes.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#
2+
# FE playback pipeline: host-copier-gain-mixin-playback
3+
#
4+
# All attributes defined herein are namespaced
5+
# by alsatplg to "Object.Pipeline.host-copier-gain-src-mixin-playback.N.attribute_name"
6+
#
7+
# Usage: host-copier-gain-src-mixin-playback pipeline object can be instantiated as:
8+
#
9+
# Object.Pipeline.host-copier-gain-src-mixin-playback."N" {
10+
# period 1000
11+
# time_domain "timer"
12+
# channels 2
13+
# rate 48000
14+
# }
15+
#
16+
# Where N is the unique pipeline ID within the same alsaconf node.
17+
#
18+
19+
<include/common/audio_format.conf>
20+
<include/components/copier.conf>
21+
<include/components/mixin.conf>
22+
<include/components/pipeline.conf>
23+
<include/components/gain.conf>
24+
<include/components/src.conf>
25+
26+
Class.Pipeline."host-copier-gain-src-mixin-playback" {
27+
28+
DefineAttribute."index" {}
29+
30+
<include/pipelines/pipeline-common.conf>
31+
32+
attributes {
33+
!constructor [
34+
"index"
35+
]
36+
37+
!immutable [
38+
"direction"
39+
]
40+
41+
#
42+
# host-copier-gain-src-mixin-playback objects instantiated within the same
43+
# alsaconf node must have unique pipeline_id attribute
44+
#
45+
unique "instance"
46+
}
47+
48+
Object.Widget {
49+
copier."1" {
50+
copier_type "host"
51+
type "aif_in"
52+
node_type $HDA_HOST_OUTPUT_CLASS
53+
54+
<include/components/src_passthrough_format.conf>
55+
}
56+
57+
gain."1" {
58+
<include/components/src_passthrough_format.conf>
59+
}
60+
61+
src."1" {
62+
rate_out 48000
63+
64+
<include/components/src_format.conf>
65+
}
66+
67+
mixin."1" {}
68+
69+
pipeline."1" {
70+
priority 0
71+
lp_mode 0
72+
}
73+
}
74+
75+
Object.Base {
76+
route.1 {
77+
source copier.host..1
78+
sink gain..1
79+
}
80+
route.2 {
81+
source gain..1
82+
sink src..1
83+
}
84+
route.3 {
85+
source src..1
86+
sink mixin..1
87+
}
88+
}
89+
90+
direction "playback"
91+
dynamic_pipeline 1
92+
time_domain "timer"
93+
channels 2
94+
channels_min 2
95+
channels_max 2
96+
rate 48000
97+
rate_min 8000
98+
rate_max 192000
99+
}

0 commit comments

Comments
 (0)