Skip to content

Commit 2e876b6

Browse files
committed
topology1: Add topology to support NXP EAP
This adds Essential Audio Processing (EAP) topology for i.MX8MP board with wm8960 codec. This will allow experiment with various EAP library preset parameters. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
1 parent 96d6e4a commit 2e876b6

File tree

4 files changed

+152
-0
lines changed

4 files changed

+152
-0
lines changed

tools/topology/topology1/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ set(TPLGS
5656
"sof-imx8mp-micfil\;sof-imx8mp-micfil"
5757
"sof-imx8mp-btsco-dual-8ch\;sof-imx8mp-btsco-dual-8ch"
5858
"sof-imx8-wm8960\;sof-imx8mp-wm8960\;-DCODEC=wm8960\;-DRATE=48000\;-DPPROC=volume\;-DSAI_INDEX=3"
59+
"sof-imx8-wm8960\;sof-imx8mp-eap-wm8960\;-DCODEC=wm8960\;-DRATE=48000\;-DPPROC=eap\;-DSAI_INDEX=3"
5960
"sof-imx8-wm8960\;sof-imx8mp-wm8904\;-DCODEC=wm8904\;-DRATE=44100\;-DPPROC=volume\;-DSAI_INDEX=3"
6061
"sof-imx8-wm8960\;sof-imx8mp-wm8962\;-DCODEC=wm8962\;-DRATE=48000\;-DPPROC=volume\;-DSAI_INDEX=3"
6162
"sof-imx8-wm8960\;sof-imx8mp-eq-iir-wm8960\;-DCODEC=wm8960\;-DRATE=48000\;-DPPROC=eq-iir-volume\;-DSAI_INDEX=3"

tools/topology/topology1/m4/eap.m4

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
divert(-1)
2+
3+
dnl Define macro for EAP (Essential Audio Processing) widget
4+
DECLARE_SOF_RT_UUID("eap", eap_uuid, 0x127f4eec, 0x23fa, 0x11f0,
5+
0xa4, 0xa6, 0xbf, 0x0c, 0xd6, 0xb4, 0x58, 0x3b)
6+
7+
dnl EAP(name)
8+
define(`N_EAP', `EAP'PIPELINE_ID`.'$1)
9+
10+
dnl W_EAP(name, format, periods_sink, periods_source, core, kcontrols_list)
11+
define(`W_EAP',
12+
`SectionVendorTuples."'N_EAP($1)`_tuples_uuid" {'
13+
` tokens "sof_comp_tokens"'
14+
` tuples."uuid" {'
15+
` SOF_TKN_COMP_UUID' STR(eap_uuid)
16+
` }'
17+
`}'
18+
`SectionData."'N_EAP($1)`_data_uuid" {'
19+
` tuples "'N_EAP($1)`_tuples_uuid"'
20+
`}'
21+
`SectionVendorTuples."'N_EAP($1)`_tuples_w" {'
22+
` tokens "sof_comp_tokens"'
23+
` tuples."word" {'
24+
` SOF_TKN_COMP_PERIOD_SINK_COUNT' STR($3)
25+
` SOF_TKN_COMP_PERIOD_SOURCE_COUNT' STR($4)
26+
` SOF_TKN_COMP_CORE_ID' STR($5)
27+
` }'
28+
`}'
29+
`SectionData."'N_EAP($1)`_data_w" {'
30+
` tuples "'N_EAP($1)`_tuples_w"'
31+
`}'
32+
`SectionVendorTuples."'N_EAP($1)`_tuples_str" {'
33+
` tokens "sof_comp_tokens"'
34+
` tuples."string" {'
35+
` SOF_TKN_COMP_FORMAT' STR($2)
36+
` }'
37+
`}'
38+
`SectionData."'N_EAP($1)`_data_str" {'
39+
` tuples "'N_EAP($1)`_tuples_str"'
40+
`}'
41+
`SectionVendorTuples."'N_EAP($1)`_tuples_str_type" {'
42+
` tokens "sof_process_tokens"'
43+
` tuples."string" {'
44+
` SOF_TKN_PROCESS_TYPE' "EAP"
45+
` }'
46+
`}'
47+
`SectionData."'N_EAP($1)`_data_str_type" {'
48+
` tuples "'N_EAP($1)`_tuples_str_type"'
49+
`}'
50+
`SectionWidget."'N_EAP($1)`" {'
51+
` index "'PIPELINE_ID`"'
52+
` type "effect"'
53+
` no_pm "true"'
54+
` data ['
55+
` "'N_EAP($1)`_data_uuid"'
56+
` "'N_EAP($1)`_data_w"'
57+
` "'N_EAP($1)`_data_str"'
58+
` "'N_EAP($1)`_data_str_type"'
59+
` ]'
60+
` enum ['
61+
$6
62+
$7
63+
` ]'
64+
` bytes ['
65+
$8
66+
` ]'
67+
`}')
68+
69+
divert(0)dnl
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# EAP supported Audio Processing algorithms
3+
CONTROLENUM_LIST(DEF_EAP_CFG_VALUES,
4+
LIST(` ', `"Off"', `"AutoVolumeLeveler"', `"ConcertSound"', `"LoudnessMaximiser"', `"MusicEnhancerRMSLimiter"', `"VoiceEnhancer"'))
5+
6+
# TDFB enum control
7+
C_CONTROLENUM(DEF_EAP_CFG, PIPELINE_ID,
8+
DEF_EAP_CFG_VALUES,
9+
LIST(` ', ENUM_CHANNEL(FC, 3, 0)),
10+
CONTROLENUM_OPS(enum,
11+
257 binds the mixer control to enum get/put handlers,
12+
257, 257))
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Low Latency Passthrough with volume Pipeline and PCM
2+
#
3+
# Pipeline Endpoints for connection are :-
4+
#
5+
# host PCM_P --> B0 --> EAP 0 --> B1 --> sink DAI0
6+
7+
# Include topology builder
8+
include(`utils.m4')
9+
include(`buffer.m4')
10+
include(`pcm.m4')
11+
include(`dai.m4')
12+
include(`mixercontrol.m4')
13+
include(`bytecontrol.m4')
14+
include(`enumcontrol.m4')
15+
include(`pipeline.m4')
16+
include(`eap.m4')
17+
18+
#
19+
# Controls
20+
#
21+
# Include defines for EAP controls
22+
include(`eap_controls.m4')
23+
24+
#
25+
# Components and Buffers
26+
#
27+
# Host "EAP Playback" PCM
28+
# with 2 sink and 0 source periods
29+
W_PCM_PLAYBACK(PCM_ID, EAP Playback, 2, 0)
30+
31+
# "EAP 0" has x sink period and 2 source periods
32+
W_EAP(0, PIPELINE_FORMAT, DAI_PERIODS, 2, SCHEDULE_CORE,
33+
LIST(` ', "DEF_EAP_CFG"))
34+
35+
# Playback Buffers
36+
W_BUFFER(0, COMP_BUFFER_SIZE(2,
37+
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS,
38+
COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)),
39+
PLATFORM_HOST_MEM_CAP)
40+
W_BUFFER(1, COMP_BUFFER_SIZE(DAI_PERIODS,
41+
COMP_SAMPLE_SIZE(DAI_FORMAT), PIPELINE_CHANNELS,
42+
COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)),
43+
PLATFORM_DAI_MEM_CAP)
44+
45+
#
46+
# Pipeline Graph
47+
#
48+
# host host PCM_P --> B0 --> EAP --> B1 --> sink DAI0
49+
P_GRAPH(pipe-eap-playback, PIPELINE_ID,
50+
LIST(` ',
51+
`dapm(N_BUFFER(0), N_PCMP(PCM_ID))',
52+
`dapm(N_EAP(0), N_BUFFER(0))',
53+
`dapm(N_BUFFER(1), N_EAP(0))'))
54+
55+
#
56+
# Pipeline Source and Sinks
57+
#
58+
indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(1))
59+
indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID),
60+
EAP Playback PCM_ID)
61+
62+
#
63+
# PCM Configuration
64+
65+
#
66+
PCM_CAPABILITIES(EAP Playback PCM_ID, `S16_LE',
67+
PCM_MIN_RATE, PCM_MAX_RATE, 2, PIPELINE_CHANNELS,
68+
2, 16, 192, 16384, 65536, 65536)
69+
70+
undefine(`DAI_EAP_CFG')

0 commit comments

Comments
 (0)