Skip to content

Commit 5371886

Browse files
committed
topology: imx8mp: Add compress decoding pipeline for i.MX8MP with aac/mp3 codecs
Add topology to support compress playback for MP3/AAC on i.MX8MP with wm8960 codec. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
1 parent 64be6a6 commit 5371886

File tree

3 files changed

+197
-0
lines changed

3 files changed

+197
-0
lines changed

tools/topology/topology1/development/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ set(TPLGS
2424
"sof-imx8-src-cs42888\;sof-imx8-src-cs42888"
2525
"sof-imx8-compr-aac-wm8960\;sof-imx8-compr-aac-wm8960"
2626
"sof-imx8-compr-mp3-wm8960\;sof-imx8-compr-mp3-wm8960"
27+
"sof-imx8mp-compr-aac-wm8960\;sof-imx8mp-compr-aac-wm8960"
28+
"sof-imx8mp-compr-mp3-wm8960\;sof-imx8mp-compr-mp3-wm8960"
29+
2730
)
2831

2932

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#
2+
# Topology with codec_adapter processing component for i.MX8MP
3+
#
4+
5+
# Include topology builder
6+
include(`utils.m4')
7+
include(`dai.m4')
8+
include(`pipeline.m4')
9+
include(`sai.m4')
10+
include(`pcm.m4')
11+
include(`buffer.m4')
12+
13+
# Include TLV library
14+
include(`common/tlv.m4')
15+
16+
# Include Token library
17+
include(`sof/tokens.m4')
18+
19+
# Include DSP configuration
20+
include(`platform/imx/imx8.m4')
21+
22+
23+
# Post process setup config
24+
25+
#codec Post Process setup config
26+
#
27+
# Define the pipelines
28+
#
29+
# PCM0 <----> volume <-----> SAI3 (wm8960)
30+
#
31+
32+
33+
DECLARE_SOF_RT_UUID("Cadence Codec", cadence_codec_uuid, 0xd8218443, 0x5ff3,
34+
0x4a4c, 0xb3, 0x88, 0x6c, 0xfe, 0x07, 0xb9, 0x56, 0xaa);
35+
36+
define(`CA_UUID', cadence_codec_uuid)
37+
38+
# Post process setup config
39+
define(`CA_SETUP_CONTROLBYTES',
40+
`` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,'
41+
` 0x2C,0x00,0x00,0x00,0x00,0x10,0x00,0x03,'
42+
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
43+
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
44+
` 0x02,0x01,0xDE,0xCA,0x00,0x00,0x00,0x00,'
45+
` 0x80,0xBB,0x00,0x00,0x20,0x00,0x00,0x00,'
46+
` 0x02,0x00,0x00,0x00,0x07,0x00,0x00,0x00,'
47+
` 0x0C,0x00,0x00,0x00,0x18,0x00,0x00,0x00,'
48+
` 0x03,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,'
49+
` 0x02,0x00,0x00,0x00"''
50+
)
51+
52+
define(`CA_SETUP_CONTROLBYTES_MAX', 300)
53+
54+
undefine(`DAI_PERIODS')
55+
define(`DAI_PERIODS', 8)
56+
57+
dnl PIPELINE_PCM_ADD(pipeline,
58+
dnl pipe id, pcm, max channels, format,
59+
dnl period, priority, core,
60+
dnl pcm_min_rate, pcm_max_rate, pipeline_rate,
61+
dnl time_domain, sched_comp)
62+
63+
# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le.
64+
# Set 1000us deadline on core 0 with priority 0
65+
PIPELINE_PCM_ADD(sof/pipe-codec-adapter-playback.m4,
66+
1, 0, 2, s32le,
67+
1000, 0, 0,
68+
48000, 48000, 48000)
69+
70+
#
71+
# DAIs configuration
72+
#
73+
74+
dnl DAI_ADD(pipeline,
75+
dnl pipe id, dai type, dai_index, dai_be,
76+
dnl buffer, periods, format,
77+
dnl period, priority, core, time_domain)
78+
79+
# playback DAI is SAI3 using 2 periods
80+
# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0
81+
DAI_ADD(sof/pipe-dai-playback.m4,
82+
1, SAI, 3, sai3-wm8960-hifi,
83+
PIPELINE_SOURCE_1, 2, s32le,
84+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA)
85+
86+
87+
# PCM Low Latency, id 0
88+
89+
dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture)
90+
COMPR_PLAYBACK_ADD(Port0, 0, PIPELINE_PCM_1)
91+
92+
dnl DAI_CONFIG(type, idx, link_id, name, sai_config)
93+
DAI_CONFIG(SAI, 3, 0, sai3-wm8960-hifi,
94+
SAI_CONFIG(I2S, SAI_CLOCK(mclk, 12288000, codec_mclk_in),
95+
SAI_CLOCK(bclk, 3072000, codec_master),
96+
SAI_CLOCK(fsync, 48000, codec_master),
97+
SAI_TDM(2, 32, 3, 3),
98+
SAI_CONFIG_DATA(SAI, 3, 0)))
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#
2+
# Topology with codec_adapter processing component for i.MX8MP
3+
#
4+
5+
# Include topology builder
6+
include(`utils.m4')
7+
include(`dai.m4')
8+
include(`pipeline.m4')
9+
include(`sai.m4')
10+
include(`pcm.m4')
11+
include(`buffer.m4')
12+
13+
# Include TLV library
14+
include(`common/tlv.m4')
15+
16+
# Include Token library
17+
include(`sof/tokens.m4')
18+
19+
# Include DSP configuration
20+
include(`platform/imx/imx8.m4')
21+
22+
23+
# Post process setup config
24+
25+
#codec Post Process setup config
26+
#
27+
# Define the pipelines
28+
#
29+
# PCM0 <----> volume <-----> SAI3 (wm8960)
30+
#
31+
32+
33+
DECLARE_SOF_RT_UUID("Cadence Codec", cadence_codec_uuid, 0xd8218443, 0x5ff3,
34+
0x4a4c, 0xb3, 0x88, 0x6c, 0xfe, 0x07, 0xb9, 0x56, 0xaa);
35+
36+
define(`CA_UUID', cadence_codec_uuid)
37+
38+
# Post process setup config
39+
define(`CA_SETUP_CONTROLBYTES',
40+
`` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,'
41+
` 0x20,0x00,0x00,0x00,0x00,0x10,0x00,0x03,'
42+
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
43+
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
44+
` 0x06,0x01,0xDE,0xCA,0x00,0x00,0x00,0x00,'
45+
` 0x80,0xBB,0x00,0x00,0x20,0x00,0x00,0x00,'
46+
` 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
47+
` 0x0C,0x00,0x00,0x00,0x20,0x00,0x00,0x00"''
48+
)
49+
50+
define(`CA_SETUP_CONTROLBYTES_MAX', 300)
51+
52+
undefine(`DAI_PERIODS')
53+
define(`DAI_PERIODS', 8)
54+
55+
dnl PIPELINE_PCM_ADD(pipeline,
56+
dnl pipe id, pcm, max channels, format,
57+
dnl period, priority, core,
58+
dnl pcm_min_rate, pcm_max_rate, pipeline_rate,
59+
dnl time_domain, sched_comp)
60+
61+
# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le.
62+
# Set 1000us deadline on core 0 with priority 0
63+
PIPELINE_PCM_ADD(sof/pipe-codec-adapter-playback.m4,
64+
1, 0, 2, s32le,
65+
1000, 0, 0,
66+
48000, 48000, 48000)
67+
68+
#
69+
# DAIs configuration
70+
#
71+
72+
dnl DAI_ADD(pipeline,
73+
dnl pipe id, dai type, dai_index, dai_be,
74+
dnl buffer, periods, format,
75+
dnl period, priority, core, time_domain)
76+
77+
# playback DAI is SAI3 using 2 periods
78+
# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0
79+
DAI_ADD(sof/pipe-dai-playback.m4,
80+
1, SAI, 3, sai3-wm8960-hifi,
81+
PIPELINE_SOURCE_1, 2, s32le,
82+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA)
83+
84+
85+
# PCM Low Latency, id 0
86+
87+
dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture)
88+
COMPR_PLAYBACK_ADD(Port0, 0, PIPELINE_PCM_1)
89+
90+
dnl DAI_CONFIG(type, idx, link_id, name, sai_config)
91+
DAI_CONFIG(SAI, 3, 0, sai3-wm8960-hifi,
92+
SAI_CONFIG(I2S, SAI_CLOCK(mclk, 12288000, codec_mclk_in),
93+
SAI_CLOCK(bclk, 3072000, codec_master),
94+
SAI_CLOCK(fsync, 48000, codec_master),
95+
SAI_TDM(2, 32, 3, 3),
96+
SAI_CONFIG_DATA(SAI, 3, 0)))

0 commit comments

Comments
 (0)