blob: 89efe546919b7ac75315d5b9e7a8a73107384f91 [file] [log] [blame]
Naresh Tanniruf1290152018-11-27 12:16:45 +05301ifneq ($(AUDIO_USE_STUB_HAL), true)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -08002ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
3
4LOCAL_PATH := $(call my-dir)
5
6include $(CLEAR_VARS)
7
8LOCAL_ARM_MODE := arm
9
Ajay Dudanibe3335a2013-08-19 18:47:21 -070010AUDIO_PLATFORM := $(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070011
Manisha Agarwal888e9762019-02-27 22:18:49 +053012ifneq ($(filter msm8974 msm8226 msm8084 msm8610 apq8084 msm8994 msm8992 msm8996 msm8998 apq8098_latv sdm845 sdm710 qcs605 msmnile kona $(MSMSTEPPE) $(TRINKET) lito,$(TARGET_BOARD_PLATFORM)),)
Ajay Dudanibe3335a2013-08-19 18:47:21 -070013 # B-family platform uses msm8974 code base
14 AUDIO_PLATFORM = msm8974
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070015 MULTIPLE_HW_VARIANTS_ENABLED := true
Aalique Grahame22e49102018-12-18 14:23:57 -080016ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
17 LOCAL_CFLAGS := -DPLATFORM_MSM8974
18 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
19endif
Mingming Yin8e5a4f62013-10-07 15:23:41 -070020ifneq ($(filter msm8610,$(TARGET_BOARD_PLATFORM)),)
21 LOCAL_CFLAGS := -DPLATFORM_MSM8610
22endif
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070023ifneq ($(filter msm8226,$(TARGET_BOARD_PLATFORM)),)
24 LOCAL_CFLAGS := -DPLATFORM_MSM8x26
Aalique Grahame22e49102018-12-18 14:23:57 -080025 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
26endif
27ifneq ($(filter msm8084,$(TARGET_BOARD_PLATFORM)),)
28 LOCAL_CFLAGS := -DPLATFORM_MSM8084
29 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070030endif
Vidyakumar Athotad9d9ff32013-11-13 11:46:52 -080031ifneq ($(filter apq8084,$(TARGET_BOARD_PLATFORM)),)
32 LOCAL_CFLAGS := -DPLATFORM_APQ8084
33endif
Mingming Yin0e1b2902014-05-19 18:20:59 -070034ifneq ($(filter msm8994,$(TARGET_BOARD_PLATFORM)),)
35 LOCAL_CFLAGS := -DPLATFORM_MSM8994
Aalique Grahame22e49102018-12-18 14:23:57 -080036 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
37 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
Mingming Yin0e1b2902014-05-19 18:20:59 -070038endif
Fred Oh68ad1d32014-12-09 13:08:07 -080039ifneq ($(filter msm8992,$(TARGET_BOARD_PLATFORM)),)
40 LOCAL_CFLAGS := -DPLATFORM_MSM8994
Aalique Grahame22e49102018-12-18 14:23:57 -080041 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
42 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
Fred Oh68ad1d32014-12-09 13:08:07 -080043endif
Mingming Yin89c6a7f2015-03-24 11:56:14 -070044ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
45 LOCAL_CFLAGS := -DPLATFORM_MSM8996
Aalique Grahame22e49102018-12-18 14:23:57 -080046 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
47 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
48 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
Banajit Goswami22582e72014-10-15 18:29:34 -070049endif
Venkataraman Nerellapallib8689ec2017-05-04 11:55:29 +053050ifneq ($(filter msm8998 apq8098_latv,$(TARGET_BOARD_PLATFORM)),)
Ben Romberger22d41232016-11-16 14:55:25 -080051 LOCAL_CFLAGS := -DPLATFORM_MSM8998
Aalique Grahame22e49102018-12-18 14:23:57 -080052 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
53 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
Banajit Goswami4c0dff22016-03-04 18:31:22 -080054endif
Soumild9f5bfa2017-04-04 19:31:22 -070055ifneq ($(filter sdm845,$(TARGET_BOARD_PLATFORM)),)
Garmond Leung986024b2017-04-28 14:41:10 -070056 LOCAL_CFLAGS := -DPLATFORM_SDM845
Aalique Grahame22e49102018-12-18 14:23:57 -080057 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
58 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
59 LOCAL_CFLAGS += -DINCALL_STEREO_CAPTURE_ENABLED
Xiaoyu Ye0afc9232017-03-28 21:31:22 -070060endif
Naresh Tanniru42e0e602018-03-16 19:45:21 +053061ifneq ($(filter sdm710,$(TARGET_BOARD_PLATFORM)),)
62 LOCAL_CFLAGS := -DPLATFORM_SDM710
Ramjee Singh970ad432019-03-13 10:28:43 +053063 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Sharad Sangled39232d2017-08-08 20:27:18 +053064endif
Ashok Sidipotu5accc8d2017-11-08 11:21:55 +053065ifneq ($(filter qcs605,$(TARGET_BOARD_PLATFORM)),)
66 LOCAL_CFLAGS := -DPLATFORM_QCS605
67endif
Xiaoyu Ye91553e62017-11-21 17:35:50 -080068ifneq ($(filter msmnile,$(TARGET_BOARD_PLATFORM)),)
69 LOCAL_CFLAGS := -DPLATFORM_MSMNILE
Aalique Grahame22e49102018-12-18 14:23:57 -080070 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
71 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
72 LOCAL_CFLAGS += -DINCALL_STEREO_CAPTURE_ENABLED
Xiaoyu Ye91553e62017-11-21 17:35:50 -080073endif
Meng Wangef2f6e12018-10-08 13:06:05 +080074ifneq ($(filter kona,$(TARGET_BOARD_PLATFORM)),)
75 LOCAL_CFLAGS := -DPLATFORM_KONA
Aalique Grahameee8c0ed2019-02-26 14:15:52 -080076 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Meng Wangef2f6e12018-10-08 13:06:05 +080077endif
Tanya Dixit6e3bccc2018-04-05 13:42:18 +053078ifneq ($(filter $(MSMSTEPPE) ,$(TARGET_BOARD_PLATFORM)),)
79 LOCAL_CFLAGS := -DPLATFORM_MSMSTEPPE
Ramjee Singh970ad432019-03-13 10:28:43 +053080 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Tanya Dixit6e3bccc2018-04-05 13:42:18 +053081endif
Hari Veerubhotlae56a5fa2018-10-14 16:52:10 +053082ifneq ($(filter $(TRINKET) ,$(TARGET_BOARD_PLATFORM)),)
83 LOCAL_CFLAGS := -DPLATFORM_TRINKET
Ramjee Singh970ad432019-03-13 10:28:43 +053084 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
Hari Veerubhotlae56a5fa2018-10-14 16:52:10 +053085endif
Manisha Agarwal888e9762019-02-27 22:18:49 +053086ifneq ($(filter lito,$(TARGET_BOARD_PLATFORM)),)
87 LOCAL_CFLAGS := -DPLATFORM_LITO
88endif
Ajay Dudanibe3335a2013-08-19 18:47:21 -070089endif
90
Arusha Goyalfda29152016-12-26 10:53:39 +053091ifneq ($(filter msm8916 msm8909 msm8952 msm8937 thorium msm8953 msmgold sdm660,$(TARGET_BOARD_PLATFORM)),)
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053092 AUDIO_PLATFORM = msm8916
93 MULTIPLE_HW_VARIANTS_ENABLED := true
94 LOCAL_CFLAGS := -DPLATFORM_MSM8916
Aalique Grahame22e49102018-12-18 14:23:57 -080095 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
96 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
padarshr04e74812014-09-17 13:34:31 +053097ifneq ($(filter msm8909,$(TARGET_BOARD_PLATFORM)),)
Dhananjay Kumar2bb2fc12014-07-11 19:14:23 +053098 LOCAL_CFLAGS := -DPLATFORM_MSM8909
99endif
Arusha Goyalfda29152016-12-26 10:53:39 +0530100ifneq ($(filter sdm660,$(TARGET_BOARD_PLATFORM)),)
Dhananjay Kumard3ab9f42016-07-20 17:05:47 +0530101 LOCAL_CFLAGS := -DPLATFORM_MSMFALCON
102endif
Naresh Tannirudb72d1e2014-03-05 17:33:47 +0530103endif
Naresh Tanniru8b919ac2014-01-30 19:12:53 +0530104
Derek Chen3e5b30a2018-10-24 01:04:25 -0700105ifeq ($(TARGET_BOARD_AUTO),true)
106 LOCAL_CFLAGS += -DPLATFORM_AUTO
107endif
108
Bruce Levycea5f172018-01-31 16:06:04 -0800109LOCAL_CFLAGS += -Wno-macro-redefined
110
Revathi Uddarajue8bd13c2018-04-02 21:27:54 +0530111LOCAL_HEADER_LIBRARIES := libhardware_headers
112
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800113LOCAL_SRC_FILES := \
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800114 audio_hw.c \
115 voice.c \
116 platform_info.c \
117 $(AUDIO_PLATFORM)/platform.c \
118 acdb.c \
119 ahal_config_helper.cpp
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800120
Subhash Chandra Bose Naripeddy19dc03b2014-03-10 14:43:05 -0700121LOCAL_SRC_FILES += audio_extn/audio_extn.c \
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800122 audio_extn/audio_feature_manager.c \
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800123 audio_extn/audio_hidl.cpp \
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800124 audio_extn/utils.c \
125 audio_extn/source_track.c \
126 voice_extn/voice_extn.c \
127 audio_extn/fm.c \
128 voice_extn/compress_voip.c \
129 audio_extn/keep_alive.c
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800130LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Asish Bhattacharya0b9bfb02017-07-15 08:39:36 +0530131LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/techpack/audio/include
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -0700132LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Sharad Sangledf0dd6f2018-04-04 19:07:39 +0530133
134ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
Revathi Uddaraju3f4cfa42018-06-04 20:35:10 +0530135 LOCAL_HEADER_LIBRARIES += audio_kernel_headers
Asish Bhattacharyad0665872017-09-07 19:46:29 +0530136 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
Asish Bhattacharyad0665872017-09-07 19:46:29 +0530137endif
138
Divya Narayanan Poojary8fd98c82017-07-03 11:17:08 +0530139LOCAL_CFLAGS += -DUSE_VENDOR_EXTN
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700140
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800141# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HDMI_EDID)),true)
142# LOCAL_CFLAGS += -DHDMI_EDID
143# LOCAL_SRC_FILES += edid.c
144# endif
Mingming Yin08c7e312015-03-16 18:10:58 -0700145
Mingming Yina6dad602014-05-16 12:10:55 -0700146ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PCM_OFFLOAD)),true)
Mingming Yin67e34512014-04-03 17:47:22 -0700147 LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED
148endif
149
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800150# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ANC_HEADSET)),true)
151# LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
152# endif
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700153
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800154# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HIFI_AUDIO)),true)
155# LOCAL_CFLAGS += -DHIFI_AUDIO_ENABLED
156# endif
Venkata Narendra Kumar Gutta4bd09d02016-01-29 15:31:04 +0530157
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800158# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_RAS)),true)
159# LOCAL_CFLAGS += -DRAS_ENABLED
160# endif
Srinivas Julakanti1ca769a2017-01-04 23:18:08 -0800161
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800162#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_VBAT_MONITOR)),true)
163# LOCAL_CFLAGS += -DVBAT_MONITOR_ENABLED
164#endif
Banajit Goswami20cdd212015-09-11 01:11:30 -0700165
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800166# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FLUENCE)),true)
167# LOCAL_CFLAGS += -DFLUENCE_ENABLED
168# endif
Venkata Narendra Kumar Gutta88fd0bc2014-03-27 19:47:56 +0530169
Mingming Yina6dad602014-05-16 12:10:55 -0700170ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PROXY_DEVICE)),true)
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700171 LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
172endif
173
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800174# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE)),true)
175# LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
176# endif
Sudheer Papothi390bcf32014-12-04 01:25:17 +0530177
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800178# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FM_POWER_OPT)),true)
179# LOCAL_CFLAGS += -DFM_POWER_OPT
180# LOCAL_SRC_FILES += audio_extn/fm.c
181# endif
Apoorv Raghuvanshi6e262842013-10-06 14:39:35 -0700182
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800183
184#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_TUNNEL)),true)
185# LOCAL_CFLAGS += -DUSB_TUNNEL_ENABLED
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -0700186 LOCAL_SRC_FILES += audio_extn/usb.c
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800187#endif
Mingming Yina6dad602014-05-16 12:10:55 -0700188
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800189#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_SIDETONE_VOLUME)),true)
190# LOCAL_CFLAGS += -DUSB_SIDETONE_VOLUME
191#endif
192
193#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_BURST_MODE)), true)
194# LOCAL_CFLAGS += -DUSB_BURST_MODE_ENABLED
195#endif
Aalique Grahame22e49102018-12-18 14:23:57 -0800196
Mingming Yina6dad602014-05-16 12:10:55 -0700197ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HFP)),true)
Vimal Puthanveed5b4d3f12013-11-05 15:57:39 -0800198 LOCAL_CFLAGS += -DHFP_ENABLED
199 LOCAL_SRC_FILES += audio_extn/hfp.c
200endif
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -0700201
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800202# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CUSTOMSTEREO)),true)
203# LOCAL_CFLAGS += -DCUSTOM_STEREO_ENABLED
204# endif
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -0700205
Mingming Yina6dad602014-05-16 12:10:55 -0700206ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INCALL_MUSIC)),true)
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700207 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
208endif
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800209# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_VOIP)),true)
210# LOCAL_CFLAGS += -DCOMPRESS_VOIP_ENABLED
211# LOCAL_SRC_FILES += voice_extn/compress_voip.c
212# endif
Subhash Chandra Bose Naripeddy19dc03b2014-03-10 14:43:05 -0700213
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800214# endif
Subhash Chandra Bose Naripeddy19dc03b2014-03-10 14:43:05 -0700215
Mingming Yina6dad602014-05-16 12:10:55 -0700216ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FORMATS)),true)
Aalique Grahame22e49102018-12-18 14:23:57 -0800217 LOCAL_CFLAGS += -DAUDIO_EXTN_FORMATS_ENABLED
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700218endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700219
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800220#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true)
221# LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
222# LOCAL_SRC_FILES += audio_extn/spkr_protection.c
223#endif
Aalique Grahame22e49102018-12-18 14:23:57 -0800224
225ifeq ($(strip $(AUDIO_FEATURE_ENABLED_BG_CAL)),true)
226 LOCAL_CFLAGS += -DBG_CODEC_CAL
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700227endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700228
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800229# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CIRRUS_SPKR_PROTECTION)),true)
230# LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
231# LOCAL_SRC_FILES += audio_extn/cirrus_playback.c
232# endif
233
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -0700234ifdef MULTIPLE_HW_VARIANTS_ENABLED
235 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
236 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
237endif
238
Jitendra Naruka1b6513f2014-11-22 19:34:13 -0800239ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DTS_EAGLE)),true)
240 LOCAL_CFLAGS += -DDTS_EAGLE
241 LOCAL_SRC_FILES += audio_extn/dts_eagle.c
242endif
243
Mingming Yina6dad602014-05-16 12:10:55 -0700244ifeq ($(strip $(DOLBY_DDP)),true)
Mingming Yin90310102013-11-13 16:57:00 -0800245 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800246 LOCAL_SRC_FILES += audio_extn/dolby.c
Mingming Yin90310102013-11-13 16:57:00 -0800247endif
248
Pradnya Chaphekar73e2e8b2015-05-01 02:18:17 -0700249ifeq ($(strip $(DS1_DOLBY_DAP)),true)
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800250 LOCAL_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
Mingming Yina6dad602014-05-16 12:10:55 -0700251ifneq ($(strip $(DOLBY_DDP)),true)
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800252 LOCAL_SRC_FILES += audio_extn/dolby.c
253endif
254endif
255
Mingming Yin3ee55c62014-08-04 14:23:35 -0700256ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER)),true)
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530257 LOCAL_CFLAGS += -DFLAC_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800258# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530259endif
260
261ifeq ($(strip $(AUDIO_FEATURE_ENABLED_VORBIS_OFFLOAD)),true)
262 LOCAL_CFLAGS += -DVORBIS_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800263# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530264endif
265
266ifeq ($(strip $(AUDIO_FEATURE_ENABLED_WMA_OFFLOAD)),true)
267 LOCAL_CFLAGS += -DWMA_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800268# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530269endif
270
271ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD)),true)
272 LOCAL_CFLAGS += -DALAC_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800273# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530274endif
275
276ifeq ($(strip $(AUDIO_FEATURE_ENABLED_APE_OFFLOAD)),true)
277 LOCAL_CFLAGS += -DAPE_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800278# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Mingming Yin3ee55c62014-08-04 14:23:35 -0700279endif
280
Vidyakumar Athotac1d39c92015-02-25 15:14:26 -0800281ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24)),true)
282 LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED_24
283endif
284
Manish Dewangana6fc5442015-08-24 20:30:31 +0530285ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD)),true)
286 LOCAL_CFLAGS += -DAAC_ADTS_OFFLOAD_ENABLED
287endif
288
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800289# # Removing flag as feature below is no longer needed
290# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DEV_ARBI)),true)
291# LOCAL_CFLAGS += -DDEV_ARBI_ENABLED
292# LOCAL_SRC_FILES += audio_extn/dev_arbi.c
293# endif
Lior Barenboim0b61bc72014-05-13 13:01:37 +0300294
Naresh Tanniruc0517bc2014-10-26 15:30:55 +0530295ifeq ($(strip $(AUDIO_FEATURE_ENABLED_RECORD_PLAY_CONCURRENCY)),true)
296 LOCAL_CFLAGS += -DRECORD_PLAY_CONCURRENCY
297endif
298
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800299# Removing following flag as dolby is not being used on mobile targets
300# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ACDB_LICENSE)), true)
301# LOCAL_CFLAGS += -DDOLBY_ACDB_LICENSE
302# endif
Ashish Jain8ec50472014-10-16 13:56:28 +0530303
Pradnya Chaphekar8a9dcd82014-09-09 09:49:10 -0700304ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP)),true)
305 LOCAL_CFLAGS += -DDS2_DOLBY_DAP_ENABLED
Pradnya Chaphekar73e2e8b2015-05-01 02:18:17 -0700306 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
Pradnya Chaphekar8a9dcd82014-09-09 09:49:10 -0700307ifneq ($(strip $(DOLBY_DDP)),true)
Pradnya Chaphekar73e2e8b2015-05-01 02:18:17 -0700308 ifneq ($(strip $(DS1_DOLBY_DAP)),true)
Pradnya Chaphekar8a9dcd82014-09-09 09:49:10 -0700309 LOCAL_SRC_FILES += audio_extn/dolby.c
310 endif
311endif
312endif
313
Pradnya Chaphekar80a8cfb2014-10-20 16:17:01 -0700314ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HDMI_PASSTHROUGH)),true)
315 LOCAL_CFLAGS += -DHDMI_PASSTHROUGH_ENABLED
Mingming Yin21854652016-04-13 11:54:02 -0700316 LOCAL_SRC_FILES += audio_extn/passthru.c
317endif
318
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800319# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_KEEP_ALIVE)),true)
320# LOCAL_CFLAGS += -DKEEP_ALIVE_ENABLED
321# LOCAL_SRC_FILES += audio_extn/keep_alive.c
322# endif
Pradnya Chaphekar80a8cfb2014-10-20 16:17:01 -0700323
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800324#This feature is depricated, file disabled
325#ifeq ($(strip $(AUDIO_FEATURE_IP_HDLR_ENABLED)),true)
326# LOCAL_CFLAGS += -DAUDIO_EXTN_IP_HDLR_ENABLED
327# LOCAL_SRC_FILES += audio_extn/ip_hdlr_intf.c
328#endif
Ashish Jaind5694242017-09-05 20:09:06 +0530329
Lakshman Chaluvaraju22ba9f12016-09-12 11:42:10 +0530330ifeq ($(strip $(AUDIO_FEATURE_ENABLED_QAF)),true)
331 LOCAL_CFLAGS += -DQAF_EXTN_ENABLED
332 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/qaf/
333 LOCAL_SRC_FILES += audio_extn/qaf.c
334endif
335
Samyak Jain15fda662018-12-18 16:40:52 +0530336ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CONCURRENT_CAPTURE)),true)
337 LOCAL_CFLAGS += -DCONCURRENT_CAPTURE_ENABLED
338endif
339
Dhananjay Kumaree4d2002016-10-25 18:02:58 +0530340ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_INPUT)),true)
341 LOCAL_CFLAGS += -DCOMPRESS_INPUT_ENABLED
342 LOCAL_SRC_FILES += audio_extn/compress_in.c
343endif
344
Samyak Jainb3f3ca52019-01-02 18:24:35 +0530345ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CONCURRENT_CAPTURE)),true)
346 LOCAL_CFLAGS += -DCONCURRENT_CAPTURE_ENABLED
347endif
348
Dhananjay Kumaree4d2002016-10-25 18:02:58 +0530349ifeq ($(strip $(BOARD_SUPPORTS_QAHW)),true)
350 LOCAL_CFLAGS += -DAUDIO_HW_EXTN_API_ENABLED
351 LOCAL_SRC_FILES += audio_hw_extn_api.c
352endif
353
Bharath Gopal01310bb2016-12-05 15:39:32 +0530354ifeq ($(strip $(AUDIO_FEATURE_ENABLED_BT_HAL)),true)
355 LOCAL_CFLAGS += -DAUDIO_EXTN_BT_HAL_ENABLED
356 LOCAL_SRC_FILES += audio_extn/bt_hal.c
357endif
358
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800359LOCAL_SHARED_LIBRARIES := \
Aalique Grahame22e49102018-12-18 14:23:57 -0800360 liblog \
361 libcutils \
362 libtinyalsa \
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800363 libtinycompress \
Aalique Grahame22e49102018-12-18 14:23:57 -0800364 libaudioroute \
365 libdl \
366 libaudioutils \
Aniket Kumar Lata808e8d62019-01-28 22:54:28 -0800367 libexpat \
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800368 libhwbinder \
369 libhidlbase \
Divya Sharmaa5ec6112019-01-29 15:41:23 -0800370 libhidltransport \
371 libprocessgroup
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800372
373LOCAL_C_INCLUDES += \
Aalique Grahame22e49102018-12-18 14:23:57 -0800374 external/tinyalsa/include \
375 external/tinycompress/include \
376 system/media/audio_utils/include \
377 external/expat/lib \
Aniket Kumar Lata808e8d62019-01-28 22:54:28 -0800378 vendor/qcom/opensource/core-utils/fwk-detect \
Aalique Grahame22e49102018-12-18 14:23:57 -0800379 $(call include-path-for, audio-route) \
380 $(call include-path-for, audio-effects) \
381 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
382 $(LOCAL_PATH)/audio_extn \
383 $(LOCAL_PATH)/voice_extn
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800384
Kiran Kandi910e1862013-10-29 13:29:42 -0700385ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
386 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
387 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
388 LOCAL_SRC_FILES += audio_extn/listen.c
389endif
390
Srinivas Rao Narne8ff4db52018-01-25 16:04:44 -0800391ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
Aalique Grahame22e49102018-12-18 14:23:57 -0800392 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Srinivas Rao Narne8ff4db52018-01-25 16:04:44 -0800393 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/techpack/audio/include
Satish Babu Patakokila1d3b15d2018-07-03 17:09:40 +0530394 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Srinivas Rao Narne8ff4db52018-01-25 16:04:44 -0800395endif
396
Aalique Grahame22e49102018-12-18 14:23:57 -0800397ifeq ($(strip $(AUDIO_FEATURE_SUPPORTED_EXTERNAL_BT)),true)
398 LOCAL_CFLAGS += -DEXTERNAL_BT_SUPPORTED
399endif
400
401ifeq ($(strip $(AUDIO_FEATURE_FLICKER_SENSOR_INPUT)),true)
402 LOCAL_CFLAGS += -DFLICKER_SENSOR_INPUT
403endif
404
405ifeq ($(strip $(AUDIO_FEATURE_NO_AUDIO_OUT)),true)
406 LOCAL_CFLAGS += -DNO_AUDIO_OUT
407endif
408
Ashish Jain81eb2a82015-05-13 10:52:34 +0530409ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXT_HDMI)),true)
410 LOCAL_CFLAGS += -DAUDIO_EXTERNAL_HDMI_ENABLED
411ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HDMI_PASSTHROUGH)),true)
412 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-parsers
413 LOCAL_SHARED_LIBRARIES += libaudioparsers
414endif
415endif
416
Ravi Kumar Alamanda8fa6b192014-09-09 16:06:42 -0700417ifeq ($(strip $(BOARD_SUPPORTS_SOUND_TRIGGER)),true)
Banajit Goswami710f3532016-08-28 14:48:33 -0700418 ST_FEATURE_ENABLE := true
419endif
420
421ifeq ($(strip $(BOARD_SUPPORTS_SOUND_TRIGGER_HAL)),true)
422 ST_FEATURE_ENABLE := true
423endif
424
425ifeq ($(ST_FEATURE_ENABLE), true)
Ravi Kumar Alamanda8fa6b192014-09-09 16:06:42 -0700426 LOCAL_CFLAGS += -DSOUND_TRIGGER_ENABLED
427 LOCAL_CFLAGS += -DSOUND_TRIGGER_PLATFORM_NAME=$(TARGET_BOARD_PLATFORM)
428 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/sound_trigger
429 LOCAL_SRC_FILES += audio_extn/soundtrigger.c
Aalique Grahame22e49102018-12-18 14:23:57 -0800430ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
431 LOCAL_HEADER_LIBRARIES += sound_trigger.primary_headers
432endif
Ravi Kumar Alamanda8fa6b192014-09-09 16:06:42 -0700433endif
434
Damir Didjustof1d46c72013-11-06 17:59:04 -0800435ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
436 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
437endif
438
Preetam Singh Ranawat2d0e4632015-02-02 12:40:59 +0530439ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PM_SUPPORT)),true)
440 LOCAL_CFLAGS += -DPM_SUPPORT_ENABLED
441 LOCAL_SRC_FILES += audio_extn/pm.c
442 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libperipheralclient/inc
443 LOCAL_SHARED_LIBRARIES += libperipheral_client
444endif
445
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800446# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DISPLAY_PORT)),true)
447# LOCAL_CFLAGS += -DDISPLAY_PORT_ENABLED
448# endif
Shiv Maliyappanahallic0656402016-09-03 14:13:26 -0700449
Weiyin Jiangaa80acd2016-09-21 16:42:11 +0800450ifeq ($(strip $(AUDIO_FEATURE_ENABLED_GEF_SUPPORT)),true)
451 LOCAL_CFLAGS += -DAUDIO_GENERIC_EFFECT_FRAMEWORK_ENABLED
452 LOCAL_SRC_FILES += audio_extn/gef.c
453endif
454
Ben Rombergerd771a7c2017-02-22 18:05:17 -0800455ifeq ($(strip $($AUDIO_FEATURE_ADSP_HDLR_ENABLED)),true)
456 LOCAL_CFLAGS += -DAUDIO_EXTN_ADSP_HDLR_ENABLED
457 LOCAL_SRC_FILES += audio_extn/adsp_hdlr.c
458endif
459
Revathi Uddaraju1eac8b02017-05-18 17:13:33 +0530460ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DYNAMIC_LOG)), true)
461 LOCAL_CFLAGS += -DDYNAMIC_LOG_ENABLED
462 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-log-utils
463 LOCAL_SHARED_LIBRARIES += libaudio_log_utils
464endif
465
Vikram Pandurangaa8932c22018-07-02 15:54:28 -0700466ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DYNAMIC_ECNS)),true)
Vikram Pandurangadf59cae2017-08-03 18:04:55 -0700467 LOCAL_CFLAGS += -DDYNAMIC_ECNS_ENABLED
468endif
469
Aditya Bavanari29bcea22017-10-03 20:10:35 +0530470ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INSTANCE_ID)), true)
471 LOCAL_CFLAGS += -DINSTANCE_ID_ENABLED
472endif
473
Haynes Mathew George01156f92018-04-13 15:29:54 -0700474ifeq ($(strip $(AUDIO_FEATURE_ENABLED_BATTERY_LISTENER)), true)
475 LOCAL_CFLAGS += -DBATTERY_LISTENER_ENABLED
476 LOCAL_SRC_FILES += audio_extn/battery_listener.cpp
477 LOCAL_SHARED_LIBRARIES += android.hardware.health@1.0 android.hardware.health@2.0 \
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800478 libbase libutils android.hardware.power@1.2
Haynes Mathew George01156f92018-04-13 15:29:54 -0700479 LOCAL_STATIC_LIBRARIES := libhealthhalutils
480endif
481
Dhanalakshmi Siddani57b014e2018-04-23 12:52:02 +0530482ifeq ($(strip $(AUDIO_FEATURE_ENABLED_KEEP_ALIVE_ARM_FFV)), true)
Dhanalakshmi Siddani30e06a22018-03-27 23:11:34 +0530483 LOCAL_CFLAGS += -DRUN_KEEP_ALIVE_IN_ARM_FFV
484endif
485
Dhanalakshmi Siddani57b014e2018-04-23 12:52:02 +0530486ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FFV)), true)
Dhanalakshmi Siddani30e06a22018-03-27 23:11:34 +0530487 LOCAL_CFLAGS += -DFFV_ENABLED
Dhanalakshmi Siddani57b014e2018-04-23 12:52:02 +0530488 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio-noship/include/ffv
Dhanalakshmi Siddani30e06a22018-03-27 23:11:34 +0530489 LOCAL_SRC_FILES += audio_extn/ffv.c
490endif
491
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800492ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AHAL_EXT)),true)
493 LOCAL_CFLAGS += -DAHAL_EXT_ENABLED
494 LOCAL_SHARED_LIBRARIES += vendor.qti.hardware.audiohalext@1.0
495endif
496
Satya Krishna Pindiprolif1cd92b2016-04-14 19:05:23 +0530497LOCAL_CFLAGS += -Wall -Werror
Alexy Josephb1379942016-01-29 15:49:38 -0800498
Mingming Yin5b7c0b32014-08-04 15:49:24 -0700499LOCAL_COPY_HEADERS_TO := mm-audio
500LOCAL_COPY_HEADERS := audio_extn/audio_defs.h
501
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800502# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SND_MONITOR)), true)
503# LOCAL_CFLAGS += -DSND_MONITOR_ENABLED
504# LOCAL_SRC_FILES += audio_extn/sndmonitor.c
505# endif
506
507# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MAXX_AUDIO)), true)
508# LOCAL_CFLAGS += -DMAXXAUDIO_QDSP_ENABLED
509# LOCAL_SRC_FILES += audio_extn/maxxaudio.c
510# endif
Haynes Mathew George3a1f1fb2016-08-09 15:43:13 -0700511
Vatsal Buchac09ae062018-11-14 13:25:08 +0530512ifeq ($(strip $(AUDIO_FEATURE_ENABLED_GCOV)),true)
513 LOCAL_CFLAGS += --coverage -fprofile-arcs -ftest-coverage
514 LOCAL_CPPFLAGS += --coverage -fprofile-arcs -ftest-coverage
515 LOCAL_STATIC_LIBRARIES += libprofile_rt
516endif
517
Derek Chenae7b0342019-02-08 15:17:04 -0800518ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUTO_HAL)),true)
519 LOCAL_CFLAGS += -DAUDIO_EXTN_AUTO_HAL_ENABLED
520 LOCAL_SRC_FILES += audio_extn/auto_hal.c
521endif
522
Derek Chend2530072014-11-24 12:39:14 -0800523ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXT_HW_PLUGIN)),true)
524 LOCAL_CFLAGS += -DEXT_HW_PLUGIN_ENABLED
525 LOCAL_SRC_FILES += audio_extn/ext_hw_plugin.c
526endif
527
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700528LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800529
Apoorv Raghuvanshi1b555f72014-05-29 12:48:15 -0700530LOCAL_MODULE_RELATIVE_PATH := hw
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800531
532LOCAL_MODULE_TAGS := optional
533
Aalique Grahame22e49102018-12-18 14:23:57 -0800534LOCAL_MODULE_OWNER := qti
535
Naresh Tanniru10758b62017-06-05 21:05:53 +0530536LOCAL_VENDOR_MODULE := true
537
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800538include $(BUILD_SHARED_LIBRARY)
539
Soumil Shah196157e2018-01-22 17:39:48 -0800540LOCAL_CFLAGS += -Wno-unused-variable
541LOCAL_CFLAGS += -Wno-sign-compare
542LOCAL_CFLAGS += -Wno-unused-parameter
543LOCAL_CFLAGS += -Wno-unused-label
544LOCAL_CFLAGS += -Wno-gnu-designator
545LOCAL_CFLAGS += -Wno-typedef-redefinition
546LOCAL_CFLAGS += -Wno-shorten-64-to-32
547LOCAL_CFLAGS += -Wno-tautological-compare
548LOCAL_CFLAGS += -Wno-unused-function
549LOCAL_CFLAGS += -Wno-unused-local-typedef
550
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800551endif
Naresh Tanniruf1290152018-11-27 12:16:45 +0530552endif