blob: edd50bc4b89b8a9bfed47470260730b7a487108d [file] [log] [blame]
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -08001ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
2
3LOCAL_PATH := $(call my-dir)
4
5include $(CLEAR_VARS)
6
7LOCAL_ARM_MODE := arm
8
Ajay Dudanibe3335a2013-08-19 18:47:21 -07009AUDIO_PLATFORM := $(TARGET_BOARD_PLATFORM)
Jean-Michel Trivic0750692015-10-12 12:12:32 -070010ifneq ($(filter msm8960,$(TARGET_BOARD_PLATFORM)),)
11 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
12endif
Cyan_Hsieh8e9b92d2019-01-22 18:22:57 +080013ifneq ($(filter msm8974 msm8226 msm8084 msm8992 msm8994 msm8996 msm8998 sdm845 sdm710 msmnile,$(TARGET_BOARD_PLATFORM)),)
Ajay Dudanibe3335a2013-08-19 18:47:21 -070014 # B-family platform uses msm8974 code base
15 AUDIO_PLATFORM = msm8974
Jean-Michel Trivi7246fb62015-10-08 20:20:48 -070016ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070017 LOCAL_CFLAGS := -DPLATFORM_MSM8974
Jean-Michel Trivi7246fb62015-10-08 20:20:48 -070018 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
19endif
Ravi Kumar Alamanda8e6e98f2013-11-05 15:57:39 -080020ifneq ($(filter msm8226,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070021 LOCAL_CFLAGS := -DPLATFORM_MSM8x26
Prashant Malanic92c5962015-08-11 15:10:18 -070022 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
Ravi Kumar Alamanda8e6e98f2013-11-05 15:57:39 -080023endif
Ravi Kumar Alamanda83281a92014-05-19 18:14:57 -070024ifneq ($(filter msm8084,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070025 LOCAL_CFLAGS := -DPLATFORM_MSM8084
Prashant Malanic92c5962015-08-11 15:10:18 -070026 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
Ravi Kumar Alamanda83281a92014-05-19 18:14:57 -070027endif
Patrick Tjin11c2e2d2015-03-12 11:44:18 -070028ifneq ($(filter msm8992,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070029 LOCAL_CFLAGS := -DPLATFORM_MSM8994
Prashant Malanic92c5962015-08-11 15:10:18 -070030 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Ravi Kumar Alamanda533bb722015-09-23 13:47:03 -070031 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
Patrick Tjin11c2e2d2015-03-12 11:44:18 -070032endif
33ifneq ($(filter msm8994,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070034 LOCAL_CFLAGS := -DPLATFORM_MSM8994
Prashant Malanic92c5962015-08-11 15:10:18 -070035 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Ravi Kumar Alamanda533bb722015-09-23 13:47:03 -070036 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
Patrick Tjin11c2e2d2015-03-12 11:44:18 -070037endif
vivek mehta295916b2016-02-04 14:47:22 -080038ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
Ed Tam70b5c142016-03-21 19:14:29 -070039 LOCAL_CFLAGS := -DPLATFORM_MSM8996
vivek mehta295916b2016-02-04 14:47:22 -080040 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
41 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
Nadav Bar3d72cfc2018-01-07 12:19:24 +020042 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
vivek mehtade4849c2016-03-03 17:23:38 -080043 MULTIPLE_HW_VARIANTS_ENABLED := true
vivek mehta295916b2016-02-04 14:47:22 -080044endif
Thierry Strudel8a8deaa2016-12-15 13:34:42 -080045ifneq ($(filter msm8998,$(TARGET_BOARD_PLATFORM)),)
46 LOCAL_CFLAGS := -DPLATFORM_MSM8998
Thierry Strudel0cfc50a2016-10-26 23:58:53 -070047 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Nadav Bar3d72cfc2018-01-07 12:19:24 +020048 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
Thierry Strudel0cfc50a2016-10-26 23:58:53 -070049 MULTIPLE_HW_VARIANTS_ENABLED := true
50endif
Alexey Polyudove920d4b2017-09-15 17:09:07 -070051ifneq ($(filter sdm845,$(TARGET_BOARD_PLATFORM)),)
52 LOCAL_CFLAGS := -DPLATFORM_SDM845
53 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Nadav Bar3d72cfc2018-01-07 12:19:24 +020054 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
Arun Mirpuriba2749a2018-04-17 14:32:24 -070055 LOCAL_CFLAGS += -DINCALL_STEREO_CAPTURE_ENABLED
Alexey Polyudove920d4b2017-09-15 17:09:07 -070056 MULTIPLE_HW_VARIANTS_ENABLED := true
57endif
vincenttewe56cd4b2018-08-02 15:39:33 +080058ifneq ($(filter sdm710,$(TARGET_BOARD_PLATFORM)),)
59 LOCAL_CFLAGS := -DPLATFORM_SDM710
60 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
61 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
62 LOCAL_CFLAGS += -DINCALL_STEREO_CAPTURE_ENABLED
63 MULTIPLE_HW_VARIANTS_ENABLED := true
64endif
Cyan_Hsieh8e9b92d2019-01-22 18:22:57 +080065ifneq ($(filter msmnile,$(TARGET_BOARD_PLATFORM)),)
Thierry Strudel07f96d12018-09-20 13:31:34 -070066 LOCAL_CFLAGS := -DPLATFORM_SM8150
67 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
68 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
69 LOCAL_CFLAGS += -DINCALL_STEREO_CAPTURE_ENABLED
70 MULTIPLE_HW_VARIANTS_ENABLED := true
71endif
Ajay Dudanibe3335a2013-08-19 18:47:21 -070072endif
73
Yamit Mehta6b4b1272016-06-10 15:12:50 +053074ifneq ($(filter msm8916 msm8909 msm8952,$(TARGET_BOARD_PLATFORM)),)
75 AUDIO_PLATFORM = msm8916
76 LOCAL_CFLAGS := -DPLATFORM_MSM8916
77ifneq ($(filter msm8909,$(TARGET_BOARD_PLATFORM)),)
78 LOCAL_CFLAGS := -DPLATFORM_MSM8909
79endif
80 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
81 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
82 MULTIPLE_HW_VARIANTS_ENABLED := true
83endif
84
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080085LOCAL_SRC_FILES := \
86 audio_hw.c \
Vineeta Srivastava4b89e372014-06-19 14:21:42 -070087 voice.c \
Haynes Mathew George5bc18842014-06-16 16:36:20 -070088 platform_info.c \
Eric Laurent0499d4f2014-08-25 22:39:29 -050089 audio_extn/ext_speaker.c \
Ravi Kumar Alamanda533bb722015-09-23 13:47:03 -070090 audio_extn/audio_extn.c \
Yamit Mehtae3b99562016-09-16 22:44:00 +053091 audio_extn/utils.c \
vivek mehta0fb11312017-05-15 19:35:32 -070092 $(AUDIO_PLATFORM)/platform.c \
93 acdb.c
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080094
vivek mehtade4849c2016-03-03 17:23:38 -080095ifdef MULTIPLE_HW_VARIANTS_ENABLED
96 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
97 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
98endif
99
David Linee3fe402017-03-13 10:00:42 -0700100ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_TUNNEL)),true)
101 LOCAL_CFLAGS += -DUSB_TUNNEL_ENABLED
102 LOCAL_SRC_FILES += audio_extn/usb.c
103endif
104
vivek mehta90933872017-06-15 18:04:39 -0700105ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_SIDETONE_VOLUME)),true)
106 LOCAL_CFLAGS += -DUSB_SIDETONE_VOLUME
107endif
108
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800109LOCAL_SHARED_LIBRARIES := \
Andy Hungfc044e12017-03-20 09:24:22 -0700110 libaudioutils \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800111 liblog \
112 libcutils \
Suren Baghdasaryan7f924c22018-12-21 15:07:18 -0800113 libprocessgroup \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800114 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700115 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800116 libaudioroute \
Haynes Mathew George5bc18842014-06-16 16:36:20 -0700117 libdl \
118 libexpat
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800119
120LOCAL_C_INCLUDES += \
121 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700122 external/tinycompress/include \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -0700123 $(call include-path-for, audio-route) \
Kevin Rocardbae0dcb2018-01-24 06:13:37 +0000124 $(call include-path-for, audio-effects) \
Ravi Kumar Alamanda8e6e98f2013-11-05 15:57:39 -0800125 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
Vineeta Srivastava4b89e372014-06-19 14:21:42 -0700126 $(LOCAL_PATH)/audio_extn \
Haynes Mathew George5bc18842014-06-16 16:36:20 -0700127 $(LOCAL_PATH)/voice_extn \
128 external/expat/lib
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800129
Alain Vongsouvanh13f26e82016-11-18 14:39:11 -0800130ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SMART_PA_TFA_98XX)),true)
131 LOCAL_SHARED_LIBRARIES += libexTfa98xx
132 LOCAL_CFLAGS += -DSMART_PA_TFA_98XX_SUPPORTED
133 LOCAL_SRC_FILES += audio_extn/tfa_98xx.c
134endif
135
Vineeta Srivastava4b89e372014-06-19 14:21:42 -0700136ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS)),true)
137 LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
138 LOCAL_SRC_FILES += voice_extn/voice_extn.c
139endif
140
Ravi Kumar Alamanda8e6e98f2013-11-05 15:57:39 -0800141ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HFP)),true)
142 LOCAL_CFLAGS += -DHFP_ENABLED
143 LOCAL_SRC_FILES += audio_extn/hfp.c
144endif
145
Uday Kishore Pasupuleti075842f2015-07-28 15:18:31 -0700146ifeq ($(strip $(AUDIO_FEATURE_SUPPORTED_EXTERNAL_BT)),true)
147 LOCAL_CFLAGS += -DEXTERNAL_BT_SUPPORTED
148endif
149
Xu Han1638fd12018-04-20 12:42:23 -0700150ifeq ($(strip $(AUDIO_FEATURE_FLICKER_SENSOR_INPUT)),true)
151 LOCAL_CFLAGS += -DFLICKER_SENSOR_INPUT
152endif
153
Uday Kishore Pasupuleticec8ad82015-04-15 10:34:06 -0700154ifeq ($(strip $(AUDIO_FEATURE_NO_AUDIO_OUT)),true)
155 LOCAL_CFLAGS += -DNO_AUDIO_OUT
156endif
157
Ravi Kumar Alamandaa417cc52015-05-01 16:41:56 -0700158ifeq ($(strip $(BOARD_SUPPORTS_SOUND_TRIGGER)),true)
159 LOCAL_CFLAGS += -DSOUND_TRIGGER_ENABLED
160 LOCAL_CFLAGS += -DSOUND_TRIGGER_PLATFORM_NAME=$(TARGET_BOARD_PLATFORM)
161 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/sound_trigger
162 LOCAL_SRC_FILES += audio_extn/soundtrigger.c
Vijay Venkatraman49543ea2017-02-28 17:29:29 -0800163ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
164LOCAL_HEADER_LIBRARIES := sound_trigger.primary_headers
165endif
166
Ravi Kumar Alamandaa417cc52015-05-01 16:41:56 -0700167endif
168
Ravi Kumar Alamanda63863002015-04-22 11:15:25 -0700169ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true)
170 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
171 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
172endif
173
David Lin84e262b2017-11-07 22:51:07 -0800174ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CIRRUS_SPKR_PROTECTION)),true)
175 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
176 LOCAL_SRC_FILES += audio_extn/cirrus_playback.c
177endif
178
zhaoyang yin4211fad2015-06-04 21:13:25 +0800179ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DSM_FEEDBACK)),true)
180 LOCAL_CFLAGS += -DDSM_FEEDBACK_ENABLED
181 LOCAL_SRC_FILES += audio_extn/dsm_feedback.c
182endif
183
Aniket Kumar Lata26483012018-01-31 20:21:42 -0800184ifeq ($(strip $(AUDIO_FEATURE_ENABLED_A2DP_OFFLOAD)),true)
185 LOCAL_CFLAGS += -DA2DP_OFFLOAD_ENABLED
186 LOCAL_SRC_FILES += audio_extn/a2dp.c
187endif
188
vincenttewe56cd4b2018-08-02 15:39:33 +0800189ifneq ($(filter msm8992 msm8994 msm8996 msm8998 sdm845 sdm710,$(TARGET_BOARD_PLATFORM)),)
Ravi Kumar Alamanda76315572015-04-23 13:13:56 -0700190 # push codec/mad calibration to HW dep node
191 # applicable to msm8992/8994 or newer platforms
192 LOCAL_CFLAGS += -DHWDEP_CAL_ENABLED
193 LOCAL_SRC_FILES += audio_extn/hwdep_cal.c
194endif
195
Haynes Mathew Georgec735fb02016-06-30 18:00:28 -0700196ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SND_MONITOR)), true)
197 LOCAL_CFLAGS += -DSND_MONITOR_ENABLED
198 LOCAL_SRC_FILES += audio_extn/sndmonitor.c
199endif
200
Haynes Mathew George65f6b432018-02-27 17:44:55 -0800201ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_SERVICE_INTERVAL)), true)
202 LOCAL_CFLAGS += -DUSB_SERVICE_INTERVAL_ENABLED
203endif
204
jasmine cha270b7762018-03-30 15:41:33 +0800205ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MAXX_AUDIO)), true)
206 LOCAL_CFLAGS += -DMAXXAUDIO_QDSP_ENABLED
207 LOCAL_SRC_FILES += audio_extn/maxxaudio.c
208endif
209
justinwengc6347db2019-02-21 18:49:00 +0800210ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUDIO_ZOOM)), true)
211 LOCAL_CFLAGS += -DAUDIOZOOM_QDSP_ENABLED
212 LOCAL_SRC_FILES += audio_extn/audiozoom.c
213endif
214
juyuchenbe5c67e2018-08-29 17:19:20 +0800215ifeq ($(strip $(AUDIO_FEATURE_ENABLED_24BITS_CAMCORDER)), true)
216 LOCAL_CFLAGS += -DENABLED_24BITS_CAMCORDER
217endif
218
Ashish Jain1c849702018-05-11 20:11:55 +0530219ifeq ($(strip $(AUDIO_FEATURE_ENABLED_BG_CAL)),true)
220 LOCAL_CFLAGS += -DBG_CODEC_CAL
221endif
222
Vignesh Kulothungan64698822018-01-23 11:25:18 -0800223ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DYNAMIC_ECNS)),true)
224 LOCAL_CFLAGS += -DDYNAMIC_ECNS_ENABLED
225endif
226
Wei Wang01cf84d2017-12-13 16:51:36 -0800227LOCAL_SHARED_LIBRARIES += libbase libhidlbase libhwbinder libutils android.hardware.power@1.2 liblog
228
229LOCAL_SRC_FILES += audio_perf.cpp
Wei Wangf4837d52017-11-21 14:51:20 -0800230
Kevin Rocardbae0dcb2018-01-24 06:13:37 +0000231LOCAL_HEADER_LIBRARIES += libhardware_headers
Jiyong Park6431fe62017-06-29 15:15:58 +0900232
razorloves50600552018-10-03 11:09:43 -0500233LOCAL_HEADER_LIBRARIES += generated_kernel_headers
234
Ravi Kumar Alamanda80e2d862014-05-05 16:00:33 -0700235LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800236
Isaac Chen7c4fca22017-02-24 20:47:31 +0800237LOCAL_MODULE_RELATIVE_PATH := hw
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800238
239LOCAL_MODULE_TAGS := optional
240
Diego Wilson8c83e0a2017-03-17 15:29:43 -0700241LOCAL_MODULE_OWNER := qcom
242
243LOCAL_PROPRIETARY_MODULE := true
244
Glenn Kastencf4cddf2016-11-09 10:49:03 -0800245LOCAL_CFLAGS += -Werror
246
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800247include $(BUILD_SHARED_LIBRARY)
248
249endif