Skip to content

Commit 42f86f6

Browse files
committed
topology1: sof-hda-generic: enable Waves playback
Create eq_iir + waves pipeline: pipe-eq-iir-waves-codec-playback.m4 and enable this pipeline on HDA0 for speaker/headphone playaback. HDA0.OUT dai pipeline is included if codec adapter pipeline is enabled. Signed-off-by: Mac Chiang <mac.chiang@intel.com>
1 parent 8c1cf55 commit 42f86f6

3 files changed

Lines changed: 130 additions & 2 deletions

File tree

tools/topology/topology1/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ set(TPLGS
2929
"sof-hda-generic\;sof-hda-generic-4ch\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1"
3030
"sof-hda-generic\;sof-hda-generic-4ch-bt\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1\;-DBT_OFFLOAD"
3131
"sof-hda-generic\;sof-hda-generic-4ch-dts\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1\;-DDTS=`DTS'"
32+
"sof-hda-generic\;sof-hda-generic-4ch-waves\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1\;-DWAVES"
3233
## end HDaudio codec topologies
3334

3435
"sof-hda-generic-idisp\;sof-hda-generic-idisp\;-DCHANNELS=0\;-DDYNAMIC=1"

tools/topology/topology1/sof-hda-generic.m4

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ define(`BT_PCM_ID', `8')
4646
define(`HW_CONFIG_ID', 8)
4747
include(`platform/intel/intel-generic-bt.m4')')
4848

49+
# define HDA0_OUT DAI pipeline if the codec adapter is included.
50+
ifdef(`DTS',`define(PIPELINE_HDA0_OUT)')
51+
ifdef(`WAVES',`define(PIPELINE_HDA0_OUT)')
52+
4953
# The pipeline naming notation is pipe-mixer-PROCESSING-dai-DIRECTION.m4
5054
# HSPROC is set by makefile, if not the default above is applied
5155
define(PIPE_HEADSET_PLAYBACK, `sof/pipe-mixer-`HSPROC'-dai-playback.m4')
@@ -107,14 +111,15 @@ DAI_ADD(PIPE_HEADSET_PLAYBACK,
107111
# Low Latency playback pipeline 1 on PCM 30 using max 2 channels of s32le.
108112
# 1000us deadline on core 0 with priority 0
109113
PIPELINE_PCM_ADD(
110-
ifdef(`DTS', sof/pipe-eq-iir-dts-codec-playback.m4, sof/pipe-host-volume-playback.m4),
114+
ifdef(`DTS', sof/pipe-eq-iir-dts-codec-playback.m4,
115+
ifdef(`WAVES', sof/pipe-eq-iir-waves-codec-playback.m4, sof/pipe-host-volume-playback.m4)),
111116
30, 0, 2, s32le,
112117
1000, 0, 0,
113118
48000, 48000, 48000,
114119
SCHEDULE_TIME_DOMAIN_TIMER,
115120
PIPELINE_PLAYBACK_SCHED_COMP_1)
116121

117-
ifdef(`DTS',
122+
ifdef(`PIPELINE_HDA0_OUT',
118123
`
119124
# Because there is no dai pipeline.30 for HDA0.OUT in pipe-eq-iir-dts-codec-playback.m4, so
120125
# using macro defined W_PIPELINE_TOP() to add missing dai pipeline back. Instead of
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Low Latency Passthrough with EQIIR and Waves codec Pipeline
2+
#
3+
# Pipeline Endpoints for connection are :
4+
#
5+
# host PCM_P -- B0 --> EQIIR0 -> B1 --> Waves -- B2 --> sink DAI0
6+
# |
7+
8+
DECLARE_SOF_RT_UUID("Waves codec", waves_codec_uuid, 0xd944281a, 0xafe9,
9+
0x4695, 0xa0, 0x43, 0xd7, 0xf6, 0x2b, 0x89, 0x53, 0x8e);
10+
define(`CA_UUID', waves_codec_uuid)
11+
12+
# Include topology builder
13+
include(`utils.m4')
14+
include(`buffer.m4')
15+
include(`pcm.m4')
16+
include(`pga.m4')
17+
include(`bytecontrol.m4')
18+
include(`dai.m4')
19+
include(`pipeline.m4')
20+
include(`codec_adapter.m4')
21+
include(`eq_iir.m4')
22+
23+
ifelse(PLATFORM, `tgl', `
24+
define(SETUP_PARAMS_NAME, `MaxxChrome Setup' PIPELINE_ID)', `
25+
define(SETUP_PARAMS_NAME, `Waves Codec Setup' PIPELINE_ID)')
26+
27+
CONTROLBYTES_PRIV(PP_SETUP_CONFIG,
28+
` bytes "0x53,0x4f,0x46,0x00,'
29+
` 0x00,0x00,0x00,0x00,'
30+
` 0x0c,0x00,0x00,0x00,'
31+
` 0x00,0x10,0x00,0x03,'
32+
` 0x00,0x00,0x00,0x00,'
33+
` 0x00,0x00,0x00,0x00,'
34+
` 0x00,0x00,0x00,0x00,'
35+
` 0x00,0x00,0x00,0x00,'
36+
` 0x00,0x00,0x00,0x00,'
37+
` 0x0c,0x00,0x00,0x00,'
38+
` 0x00,0x00,0x00,0x00"'
39+
)
40+
41+
# Post process Bytes control for setup config
42+
C_CONTROLBYTES(SETUP_PARAMS_NAME, PIPELINE_ID,
43+
CONTROLBYTES_OPS(bytes),
44+
CONTROLBYTES_EXTOPS(void, 258, 258),
45+
, , ,
46+
CONTROLBYTES_MAX(, 8192),
47+
,
48+
PP_SETUP_CONFIG)
49+
50+
#
51+
# EQIIR
52+
#
53+
define(DEF_EQIIR_COEF, concat(`eqiir_coef_', PIPELINE_ID))
54+
define(DEF_EQIIR_PRIV, concat(`eqiir_priv_', PIPELINE_ID))
55+
56+
# define filter. eq_iir_coef_flat.m4 is set by default
57+
ifdef(`PIPELINE_FILTER1', , `define(PIPELINE_FILTER1, eq_iir_coef_flat.m4)')
58+
include(PIPELINE_FILTER1)
59+
60+
# EQ Bytes control with max value of 255
61+
C_CONTROLBYTES(DEF_EQIIR_COEF, PIPELINE_ID,
62+
CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258),
63+
CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258),
64+
, , ,
65+
CONTROLBYTES_MAX(, 1024),
66+
,
67+
DEF_EQIIR_PRIV)
68+
69+
#
70+
# Components and Buffers
71+
#
72+
73+
# Host "Low latency Playback" PCM
74+
# with 2 sink and 0 source periods
75+
W_PCM_PLAYBACK(PCM_ID, Low Latency Playback, 2, 0, SCHEDULE_CORE)
76+
77+
W_CODEC_ADAPTER(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, SCHEDULE_CORE,
78+
LIST(` ', "SETUP_PARAMS_NAME"))
79+
80+
# "EQIIR0" has 2 sink period and 2 source periods
81+
W_EQ_IIR(0, PIPELINE_FORMAT, 2, 2, SCHEDULE_CORE,
82+
LIST(` ', "DEF_EQIIR_COEF"))
83+
84+
# Low Latency Buffers
85+
W_BUFFER(0, COMP_BUFFER_SIZE(2,
86+
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)),
87+
PLATFORM_HOST_MEM_CAP)
88+
W_BUFFER(1, COMP_BUFFER_SIZE(2,
89+
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)),
90+
PLATFORM_COMP_MEM_CAP)
91+
W_BUFFER(2, COMP_BUFFER_SIZE(DAI_PERIODS,
92+
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, COMP_PERIOD_FRAMES(PCM_MAX_RATE, SCHEDULE_PERIOD)),
93+
PLATFORM_COMP_MEM_CAP)
94+
95+
#
96+
# Pipeline Graph
97+
#
98+
# host PCM_P --> B0 --> EQ_IIR 0 --> B1 --> Waves Codec --> B2 --> sink DAI0
99+
100+
P_GRAPH(pipe-eq-iir-waves-codec-playback, PIPELINE_ID,
101+
LIST(` ',
102+
`dapm(N_BUFFER(0), N_PCMP(PCM_ID))',
103+
`dapm(N_EQ_IIR(0), N_BUFFER(0))',
104+
`dapm(N_BUFFER(1), N_EQ_IIR(0))',
105+
`dapm(N_CODEC_ADAPTER(0), N_BUFFER(1))',
106+
`dapm(N_BUFFER(2), N_CODEC_ADAPTER(0))'))
107+
108+
#
109+
# Pipeline Source and Sinks
110+
#
111+
indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(2))
112+
indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Low Latency Playback PCM_ID)
113+
114+
#
115+
# PCM Configuration
116+
#
117+
118+
# PCM capabilities supported by FW
119+
PCM_CAPABILITIES(Low Latency Playback PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE_FORMAT), 48000, 48000, 2, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536)
120+
121+
undefine(`DEF_EQIIR_COEF')
122+
undefine(`DEF_EQIIR_PRIV')

0 commit comments

Comments
 (0)