blob: fd1eca75dd5d03bc6da5b89514eebfd3527f8ece [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001###########################################################
2## Options to be translated into XML nodes.
3###########################################################
4_audio_param_parser_FO_list := \
5 MTK_WB_SPEECH_SUPPORT \
6 MTK_AUDIO_HD_REC_SUPPORT \
7 MTK_DUAL_MIC_SUPPORT \
8 MTK_HANDSFREE_DMNR_SUPPORT \
9 DMNR_TUNNING_AT_MODEMSIDE \
10 MTK_VOIP_ENHANCEMENT_SUPPORT \
11 MTK_TB_WIFI_3G_MODE \
12 MTK_DISABLE_EARPIECE \
13 MTK_ASR_SUPPORT \
14 MTK_VOIP_NORMAL_DMNR \
15 MTK_VOIP_HANDSFREE_DMNR \
16 MTK_INCALL_NORMAL_DMNR \
17 MTK_VOICE_UNLOCK_SUPPORT \
18 MTK_VOICE_UI_SUPPORT \
19 MTK_ACF_AUTO_GEN_SUPPORT \
20 MTK_SPEAKER_MONITOR_SUPPORT \
21 MTK_AUDIO_BLOUD_CUSTOMPARAMETER_REV \
22 MTK_MAGICONFERENCE_SUPPORT \
23 MTK_HAC_SUPPORT \
24 MTK_AUDIO_SPH_LPBK_PARAM \
25 MTK_AUDIO_GAIN_TABLE_BT \
26 MTK_AUDIO_BT_NREC_WO_ENH_MODE \
27 MTK_AUDIO_TUNING_TOOL_V2_PHASE \
28 MATV_AUDIO_SUPPORT \
29 MTK_FM_SUPPORT \
30 MTK_HEADSET_ACTIVE_NOISE_CANCELLATION \
31 MTK_SUPPORT_TC1_TUNNING \
32 MTK_AUDIO_SPEAKER_PATH \
33 MTK_AUDIO_NUMBER_OF_MIC \
34 MTK_PLATFORM \
35 MTK_AURISYS_FRAMEWORK_SUPPORT \
36 MTK_BESLOUDNESS_RUN_WITH_HAL \
37 MTK_AUDIO \
38 USE_CUSTOM_AUDIO_POLICY \
39 USE_XML_AUDIO_POLICY_CONF \
40 MTK_AUDIO_TUNING_TOOL_VERSION \
41 MTK_AUDIO_TUNNELING_SUPPORT \
42 MTK_SMARTPA_DUMMY_LIB \
43 MTK_HIFIAUDIO_SUPPORT \
44 MTK_BESLOUDNESS_SUPPORT \
45 MTK_USB_PHONECALL \
46 MTK_AUDIO_NUMBER_OF_SPEAKER \
47 MTK_A2DP_OFFLOAD_SUPPORT
48
49###########################################################
50## Complex option customization are defined here.
51##
52## Prefix temporary variables with "_aupapa_" to prevent
53## the temporary variable from messing up global namespace.
54## The string will be stripped while assembling the XML.
55##
56## Finally add the variable to _audio_param_parser_FO_list.
57###########################################################
58# MTK_WIFI_ONLY_SUPPORT
59ifeq ($(MTK_TB_WIFI_3G_MODE),WIFI_ONLY)
60 _aupapa_VIR_WIFI_ONLY_SUPPORT := yes
61else
62 _aupapa_VIR_WIFI_ONLY_SUPPORT := no
63endif
64_audio_param_parser_FO_list += _aupapa_VIR_WIFI_ONLY_SUPPORT
65
66# MTK_3G_DATA_ONLY_SUPPORT
67ifneq ($(filter 3GDATA_SMS 3GDATA_ONLY,$(MTK_TB_WIFI_3G_MODE)),)
68 _aupapa_VIR_3G_DATA_ONLY_SUPPORT := yes
69else
70 _aupapa_VIR_3G_DATA_ONLY_SUPPORT := no
71endif
72_audio_param_parser_FO_list += _aupapa_VIR_3G_DATA_ONLY_SUPPORT
73
74# SUPPORT_ASR
75ifeq ($(MTK_ASR_SUPPORT),yes)
76 ifeq ($(MTK_DUAL_MIC_SUPPORT),yes)
77 _aupapa_VIR_ASR_SUPPORT := yes
78 else
79 _aupapa_VIR_ASR_SUPPORT := no
80 endif
81else
82 _aupapa_VIR_ASR_SUPPORT:=no
83endif
84_audio_param_parser_FO_list += _aupapa_VIR_ASR_SUPPORT
85
86# SUPPORT_VOIP_NORMAL_DMNR
87ifneq ($(MTK_DISABLE_EARPIECE),yes)
88 ifeq ($(MTK_DUAL_MIC_SUPPORT),yes)
89 ifeq ($(MTK_VOIP_NORMAL_DMNR),yes)
90 ifeq ($(MTK_VOIP_ENHANCEMENT_SUPPORT),yes)
91 _aupapa_VIR_VOIP_NORMAL_DMNR_SUPPORT := yes
92 else
93 _aupapa_VIR_VOIP_NORMAL_DMNR_SUPPORT := no
94 endif
95 else
96 _aupapa_VIR_VOIP_NORMAL_DMNR_SUPPORT := no
97 endif
98 else
99 _aupapa_VIR_VOIP_NORMAL_DMNR_SUPPORT := no
100 endif
101else
102 _aupapa_VIR_VOIP_NORMAL_DMNR_SUPPORT := no
103endif
104_audio_param_parser_FO_list += _aupapa_VIR_VOIP_NORMAL_DMNR_SUPPORT
105
106# SUPPORT_VOIP_HANDSFREE_DMNR
107ifeq ($(MTK_DUAL_MIC_SUPPORT),yes)
108 ifeq ($(MTK_VOIP_HANDSFREE_DMNR),yes)
109 ifeq ($(MTK_VOIP_ENHANCEMENT_SUPPORT),yes)
110 _aupapa_VIR_VOIP_HANDSFREE_DMNR_SUPPORT := yes
111 else
112 _aupapa_VIR_VOIP_HANDSFREE_DMNR_SUPPORT := no
113 endif
114 else
115 _aupapa_VIR_VOIP_HANDSFREE_DMNR_SUPPORT := no
116 endif
117else
118 _aupapa_VIR_VOIP_HANDSFREE_DMNR_SUPPORT := no
119endif
120_audio_param_parser_FO_list += _aupapa_VIR_VOIP_HANDSFREE_DMNR_SUPPORT
121
122# NO_SPEECH
123_aupapa_VIR_NO_SPEECH := no
124ifeq ($(_aupapa_VIR_WIFI_ONLY_SUPPORT),yes)
125 _aupapa_VIR_NO_SPEECH := yes
126endif
127ifeq ($(_aupapa_VIR_3G_DATA_ONLY_SUPPORT),yes)
128 _aupapa_VIR_NO_SPEECH := yes
129endif
130_audio_param_parser_FO_list += _aupapa_VIR_NO_SPEECH
131
132# SUPPORT_INCALL_NORMAL_DMNR
133ifneq ($(MTK_DISABLE_EARPIECE),yes)
134 ifneq ($(_aupapa_VIR_NO_SPEECH),yes)
135 ifeq ($(MTK_DUAL_MIC_SUPPORT),yes)
136 ifneq ($(MTK_INCALL_NORMAL_DMNR),no)
137 _aupapa_VIR_INCALL_NORMAL_DMNR_SUPPORT := yes
138 else
139 _aupapa_VIR_INCALL_NORMAL_DMNR_SUPPORT := no
140 endif
141 else
142 _aupapa_VIR_INCALL_NORMAL_DMNR_SUPPORT := no
143 endif
144 else
145 _aupapa_VIR_INCALL_NORMAL_DMNR_SUPPORT := no
146 endif
147else
148 _aupapa_VIR_INCALL_NORMAL_DMNR_SUPPORT := no
149endif
150_audio_param_parser_FO_list += _aupapa_VIR_INCALL_NORMAL_DMNR_SUPPORT
151
152# SUPPORT_INCALL_HANDSFREE_DMNR
153ifneq ($(_aupapa_VIR_NO_SPEECH),yes)
154 ifeq ($(MTK_DUAL_MIC_SUPPORT),yes)
155 ifeq ($(MTK_INCALL_HANDSFREE_DMNR),yes)
156 _aupapa_VIR_INCALL_HANDSFREE_DMNR_SUPPORT := yes
157 else
158 _aupapa_VIR_INCALL_HANDSFREE_DMNR_SUPPORT := no
159 endif
160 else
161 _aupapa_VIR_INCALL_HANDSFREE_DMNR_SUPPORT := no
162 endif
163else
164 _aupapa_VIR_INCALL_HANDSFREE_DMNR_SUPPORT := no
165endif
166_audio_param_parser_FO_list += _aupapa_VIR_INCALL_HANDSFREE_DMNR_SUPPORT
167
168# SUPPORT_VOICE_UNLOCK
169ifeq ($(MTK_VOICE_UNLOCK_SUPPORT),yes)
170 _aupapa_VIR_VOICE_UNLOCK_SUPPORT := yes
171endif
172ifeq ($(MTK_VOICE_UI_SUPPORT),yes)
173 _aupapa_VIR_VOICE_UNLOCK_SUPPORT := yes
174endif
175_audio_param_parser_FO_list += VIR_VOICE_UNLOCK_SUPPORT
176
177# VIR_AUDIO_BLOUD_CUSTOMPARAMETER_V5
178_aupapa_VIR_AUDIO_BLOUD_CUSTOMPARAMETER_V5 := yes
179_audio_param_parser_FO_list += _aupapa_VIR_AUDIO_BLOUD_CUSTOMPARAMETER_V5
180
181# VIR_AUDIO_BLOUD_CUSTOMPARAMETER_V4
182_aupapa_VIR_AUDIO_BLOUD_CUSTOMPARAMETER_V4 := no
183_audio_param_parser_FO_list += _aupapa_VIR_AUDIO_BLOUD_CUSTOMPARAMETER_V4
184
185# SUPPORT_MAGI_CONFERENCE
186ifeq ($(MTK_MAGICONFERENCE_SUPPORT),yes)
187 ifeq ($(MTK_DUAL_MIC_SUPPORT),yes)
188 _aupapa_VIR_MAGI_CONFERENCE_SUPPORT := yes
189 else
190 _aupapa_VIR_MAGI_CONFERENCE_SUPPORT := no
191 endif
192else
193 _aupapa_VIR_MAGI_CONFERENCE_SUPPORT := no
194endif
195_audio_param_parser_FO_list += _aupapa_VIR_MAGI_CONFERENCE_SUPPORT
196
197# SUPPORT_AUDIO_LAYERED_PARAM
198ifneq ($(MTK_AUDIO_TUNING_TOOL_VERSION),)
199 ifneq ($(strip $(MTK_AUDIO_TUNING_TOOL_VERSION)),V1)
200 _aupapa_MTK_AUDIO_TUNING_TOOL_V2_PHASE := \
201 $(shell echo $(MTK_AUDIO_TUNING_TOOL_VERSION) | sed 's/V2\.//g')
202 _aupapa_MTK_AUDIO_HIERARCHICAL_PARAM_SUPPORT := yes
203 endif
204endif
205_audio_param_parser_FO_list += _aupapa_MTK_AUDIO_HIERARCHICAL_PARAM_SUPPORT
206_audio_param_parser_FO_list += _aupapa_MTK_AUDIO_TUNING_TOOL_V2_PHASE
207
208# VIR_MTK_XXXX_IIR_ENH_SUPPORT & VIR_MTK_VOIP_IIR_MIC_SUPPORT
209ifeq ($(MTK_AURISYS_FRAMEWORK_SUPPORT),yes)
210 _aupapa_VIR_MTK_RECORD_IIR_ENH_SUPPORT := yes
211 _aupapa_VIR_MTK_VOIP_IIR_ENH_SUPPORT := yes
212 _aupapa_VIR_MTK_VOIP_IIR_MIC_SUPPORT := yes
213else
214 _aupapa_VIR_MTK_RECORD_IIR_ENH_SUPPORT := no
215 _aupapa_VIR_MTK_VOIP_IIR_ENH_SUPPORT := no
216 _aupapa_VIR_MTK_VOIP_IIR_MIC_SUPPORT := no
217endif
218_audio_param_parser_FO_list += _aupapa_VIR_MTK_RECORD_IIR_ENH_SUPPORT
219_audio_param_parser_FO_list += _aupapa_VIR_MTK_VOIP_IIR_ENH_SUPPORT
220_audio_param_parser_FO_list += _aupapa_VIR_MTK_VOIP_IIR_MIC_SUPPORT
221
222###########################################################
223## Remove AUDIO_PARAM_OPTIONS_LIST duplicated item (keep first decleration)
224###########################################################
225
226$(foreach n,$(AUDIO_PARAM_OPTIONS_LIST),\
227 $(eval KEY := $(firstword $(subst =, ,$(n))))\
228 $(eval $(if $(filter $(KEY)=%,$(NEW_AUDIO_PARAM_OPTIONS_LIST)),$(info Ignore duplicated AUDIO_PARAM_OPTION: $(n)),NEW_AUDIO_PARAM_OPTIONS_LIST += $(n)))\
229)
230AUDIO_PARAM_OPTIONS_LIST := $(NEW_AUDIO_PARAM_OPTIONS_LIST)
231
232###########################################################
233## Target definition
234###########################################################
235AUDIOPARAM_XML_INSTALLED := $(TARGET_OUT_VENDOR_ETC)/audio_param/AudioParamOptions.xml
236AUDIOPARAM_XML_DEPS := \
237 $(LOCAL_PATH)/Android.mk \
238 $(lastword $(MAKEFILE_LIST))
239
240$(AUDIOPARAM_XML_INSTALLED): $(AUDIOPARAM_XML_DEPS)
241 @mkdir -p $(dir $@)
242 @echo '<?xml version="1.0" encoding="UTF-8"?>' >$@
243 @echo '<AudioParamOptions>' >>$@
244 @$(foreach i,$(_audio_param_parser_FO_list),echo ' <Param name="$(patsubst _aupapa_%,%,$(strip $(i)))" value="$(strip $($(i)))" />' >>$@;)
245 @$(foreach i,$(AUDIO_PARAM_OPTIONS_LIST),echo ' <Param name="$(firstword $(subst =, ,$(i)))" value="$(word 2,$(subst =, ,$(i)))" />' >>$@;)
246 @echo '</AudioParamOptions>' >>$@
247
248ALL_DEFAULT_INSTALLED_MODULES += $(AUDIOPARAM_XML_INSTALLED)
249$(LOCAL_BUILT_MODULE):$(AUDIOPARAM_XML_INSTALLED)