blob: d9d45e7409e13a623e2ed72df5ac03acd73b103b [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
Aalique Grahame22e49102018-12-18 14:23:57 -080012ifneq ($(filter msm8974 msm8226 msm8084 msm8610 apq8084 msm8994 msm8992 msm8996 msm8998 apq8098_latv sdm845 sdm710 qcs605 msmnile $(MSMSTEPPE) $(TRINKET),$(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
Sharad Sangled39232d2017-08-08 20:27:18 +053063endif
Ashok Sidipotu5accc8d2017-11-08 11:21:55 +053064ifneq ($(filter qcs605,$(TARGET_BOARD_PLATFORM)),)
65 LOCAL_CFLAGS := -DPLATFORM_QCS605
66endif
Xiaoyu Ye91553e62017-11-21 17:35:50 -080067ifneq ($(filter msmnile,$(TARGET_BOARD_PLATFORM)),)
68 LOCAL_CFLAGS := -DPLATFORM_MSMNILE
Aalique Grahame22e49102018-12-18 14:23:57 -080069 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="4"
70 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
71 LOCAL_CFLAGS += -DINCALL_STEREO_CAPTURE_ENABLED
Xiaoyu Ye91553e62017-11-21 17:35:50 -080072endif
Tanya Dixit6e3bccc2018-04-05 13:42:18 +053073ifneq ($(filter $(MSMSTEPPE) ,$(TARGET_BOARD_PLATFORM)),)
74 LOCAL_CFLAGS := -DPLATFORM_MSMSTEPPE
75endif
Ajay Dudanibe3335a2013-08-19 18:47:21 -070076endif
77
Arusha Goyalfda29152016-12-26 10:53:39 +053078ifneq ($(filter msm8916 msm8909 msm8952 msm8937 thorium msm8953 msmgold sdm660,$(TARGET_BOARD_PLATFORM)),)
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053079 AUDIO_PLATFORM = msm8916
80 MULTIPLE_HW_VARIANTS_ENABLED := true
81 LOCAL_CFLAGS := -DPLATFORM_MSM8916
Aalique Grahame22e49102018-12-18 14:23:57 -080082 LOCAL_CFLAGS += -DMAX_TARGET_SPECIFIC_CHANNEL_CNT="2"
83 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
padarshr04e74812014-09-17 13:34:31 +053084ifneq ($(filter msm8909,$(TARGET_BOARD_PLATFORM)),)
Dhananjay Kumar2bb2fc12014-07-11 19:14:23 +053085 LOCAL_CFLAGS := -DPLATFORM_MSM8909
86endif
Arusha Goyalfda29152016-12-26 10:53:39 +053087ifneq ($(filter sdm660,$(TARGET_BOARD_PLATFORM)),)
Dhananjay Kumard3ab9f42016-07-20 17:05:47 +053088 LOCAL_CFLAGS := -DPLATFORM_MSMFALCON
89endif
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053090endif
Naresh Tanniru8b919ac2014-01-30 19:12:53 +053091
Derek Chen3e5b30a2018-10-24 01:04:25 -070092ifeq ($(TARGET_BOARD_AUTO),true)
93 LOCAL_CFLAGS += -DPLATFORM_AUTO
94endif
95
Bruce Levycea5f172018-01-31 16:06:04 -080096LOCAL_CFLAGS += -Wno-macro-redefined
97
Revathi Uddarajue8bd13c2018-04-02 21:27:54 +053098LOCAL_HEADER_LIBRARIES := libhardware_headers
99
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800100LOCAL_SRC_FILES := \
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800101 audio_hw.c \
102 voice.c \
103 platform_info.c \
104 $(AUDIO_PLATFORM)/platform.c \
105 acdb.c \
106 ahal_config_helper.cpp
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800107
Subhash Chandra Bose Naripeddy19dc03b2014-03-10 14:43:05 -0700108LOCAL_SRC_FILES += audio_extn/audio_extn.c \
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800109 audio_extn/audio_feature_manager.c \
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800110 audio_extn/audio_hidl.cpp \
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800111 audio_extn/utils.c \
112 audio_extn/source_track.c \
113 voice_extn/voice_extn.c \
114 audio_extn/fm.c \
115 voice_extn/compress_voip.c \
116 audio_extn/keep_alive.c
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800117LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Asish Bhattacharya0b9bfb02017-07-15 08:39:36 +0530118LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/techpack/audio/include
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -0700119LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Sharad Sangledf0dd6f2018-04-04 19:07:39 +0530120
121ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
Revathi Uddaraju3f4cfa42018-06-04 20:35:10 +0530122 LOCAL_HEADER_LIBRARIES += audio_kernel_headers
Asish Bhattacharyad0665872017-09-07 19:46:29 +0530123 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
124 LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
125endif
126
Divya Narayanan Poojary8fd98c82017-07-03 11:17:08 +0530127LOCAL_CFLAGS += -DUSE_VENDOR_EXTN
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700128
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800129# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HDMI_EDID)),true)
130# LOCAL_CFLAGS += -DHDMI_EDID
131# LOCAL_SRC_FILES += edid.c
132# endif
Mingming Yin08c7e312015-03-16 18:10:58 -0700133
Mingming Yina6dad602014-05-16 12:10:55 -0700134ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PCM_OFFLOAD)),true)
Mingming Yin67e34512014-04-03 17:47:22 -0700135 LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED
136endif
137
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800138# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ANC_HEADSET)),true)
139# LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
140# endif
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700141
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800142# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HIFI_AUDIO)),true)
143# LOCAL_CFLAGS += -DHIFI_AUDIO_ENABLED
144# endif
Venkata Narendra Kumar Gutta4bd09d02016-01-29 15:31:04 +0530145
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800146# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_RAS)),true)
147# LOCAL_CFLAGS += -DRAS_ENABLED
148# endif
Srinivas Julakanti1ca769a2017-01-04 23:18:08 -0800149
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800150#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_VBAT_MONITOR)),true)
151# LOCAL_CFLAGS += -DVBAT_MONITOR_ENABLED
152#endif
Banajit Goswami20cdd212015-09-11 01:11:30 -0700153
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800154# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FLUENCE)),true)
155# LOCAL_CFLAGS += -DFLUENCE_ENABLED
156# endif
Venkata Narendra Kumar Gutta88fd0bc2014-03-27 19:47:56 +0530157
Mingming Yina6dad602014-05-16 12:10:55 -0700158ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PROXY_DEVICE)),true)
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700159 LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
160endif
161
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800162# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE)),true)
163# LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
164# endif
Sudheer Papothi390bcf32014-12-04 01:25:17 +0530165
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800166# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FM_POWER_OPT)),true)
167# LOCAL_CFLAGS += -DFM_POWER_OPT
168# LOCAL_SRC_FILES += audio_extn/fm.c
169# endif
Apoorv Raghuvanshi6e262842013-10-06 14:39:35 -0700170
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800171
172#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_TUNNEL)),true)
173# LOCAL_CFLAGS += -DUSB_TUNNEL_ENABLED
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -0700174 LOCAL_SRC_FILES += audio_extn/usb.c
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800175#endif
Mingming Yina6dad602014-05-16 12:10:55 -0700176
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800177#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_SIDETONE_VOLUME)),true)
178# LOCAL_CFLAGS += -DUSB_SIDETONE_VOLUME
179#endif
180
181#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USB_BURST_MODE)), true)
182# LOCAL_CFLAGS += -DUSB_BURST_MODE_ENABLED
183#endif
Aalique Grahame22e49102018-12-18 14:23:57 -0800184
Mingming Yina6dad602014-05-16 12:10:55 -0700185ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HFP)),true)
Vimal Puthanveed5b4d3f12013-11-05 15:57:39 -0800186 LOCAL_CFLAGS += -DHFP_ENABLED
187 LOCAL_SRC_FILES += audio_extn/hfp.c
188endif
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -0700189
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800190# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CUSTOMSTEREO)),true)
191# LOCAL_CFLAGS += -DCUSTOM_STEREO_ENABLED
192# endif
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -0700193
Mingming Yina6dad602014-05-16 12:10:55 -0700194ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INCALL_MUSIC)),true)
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700195 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
196endif
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800197# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_VOIP)),true)
198# LOCAL_CFLAGS += -DCOMPRESS_VOIP_ENABLED
199# LOCAL_SRC_FILES += voice_extn/compress_voip.c
200# endif
Subhash Chandra Bose Naripeddy19dc03b2014-03-10 14:43:05 -0700201
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800202# endif
Subhash Chandra Bose Naripeddy19dc03b2014-03-10 14:43:05 -0700203
Mingming Yina6dad602014-05-16 12:10:55 -0700204ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FORMATS)),true)
Aalique Grahame22e49102018-12-18 14:23:57 -0800205 LOCAL_CFLAGS += -DAUDIO_EXTN_FORMATS_ENABLED
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700206endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700207
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800208#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true)
209# LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
210# LOCAL_SRC_FILES += audio_extn/spkr_protection.c
211#endif
Aalique Grahame22e49102018-12-18 14:23:57 -0800212
213ifeq ($(strip $(AUDIO_FEATURE_ENABLED_BG_CAL)),true)
214 LOCAL_CFLAGS += -DBG_CODEC_CAL
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700215endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700216
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800217# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CIRRUS_SPKR_PROTECTION)),true)
218# LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
219# LOCAL_SRC_FILES += audio_extn/cirrus_playback.c
220# endif
221
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -0700222ifdef MULTIPLE_HW_VARIANTS_ENABLED
223 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
224 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
225endif
226
Jitendra Naruka1b6513f2014-11-22 19:34:13 -0800227ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DTS_EAGLE)),true)
228 LOCAL_CFLAGS += -DDTS_EAGLE
229 LOCAL_SRC_FILES += audio_extn/dts_eagle.c
230endif
231
Mingming Yina6dad602014-05-16 12:10:55 -0700232ifeq ($(strip $(DOLBY_DDP)),true)
Mingming Yin90310102013-11-13 16:57:00 -0800233 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800234 LOCAL_SRC_FILES += audio_extn/dolby.c
Mingming Yin90310102013-11-13 16:57:00 -0800235endif
236
Pradnya Chaphekar73e2e8b2015-05-01 02:18:17 -0700237ifeq ($(strip $(DS1_DOLBY_DAP)),true)
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800238 LOCAL_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
Mingming Yina6dad602014-05-16 12:10:55 -0700239ifneq ($(strip $(DOLBY_DDP)),true)
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800240 LOCAL_SRC_FILES += audio_extn/dolby.c
241endif
242endif
243
Mingming Yin3ee55c62014-08-04 14:23:35 -0700244ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER)),true)
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530245 LOCAL_CFLAGS += -DFLAC_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800246# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530247endif
248
249ifeq ($(strip $(AUDIO_FEATURE_ENABLED_VORBIS_OFFLOAD)),true)
250 LOCAL_CFLAGS += -DVORBIS_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800251# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530252endif
253
254ifeq ($(strip $(AUDIO_FEATURE_ENABLED_WMA_OFFLOAD)),true)
255 LOCAL_CFLAGS += -DWMA_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800256# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530257endif
258
259ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ALAC_OFFLOAD)),true)
260 LOCAL_CFLAGS += -DALAC_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800261# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Satya Krishna Pindiproli70471602015-04-24 19:12:43 +0530262endif
263
264ifeq ($(strip $(AUDIO_FEATURE_ENABLED_APE_OFFLOAD)),true)
265 LOCAL_CFLAGS += -DAPE_OFFLOAD_ENABLED
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800266# LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Mingming Yin3ee55c62014-08-04 14:23:35 -0700267endif
268
Vidyakumar Athotac1d39c92015-02-25 15:14:26 -0800269ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PCM_OFFLOAD_24)),true)
270 LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED_24
271endif
272
Manish Dewangana6fc5442015-08-24 20:30:31 +0530273ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD)),true)
274 LOCAL_CFLAGS += -DAAC_ADTS_OFFLOAD_ENABLED
275endif
276
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800277# # Removing flag as feature below is no longer needed
278# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DEV_ARBI)),true)
279# LOCAL_CFLAGS += -DDEV_ARBI_ENABLED
280# LOCAL_SRC_FILES += audio_extn/dev_arbi.c
281# endif
Lior Barenboim0b61bc72014-05-13 13:01:37 +0300282
Naresh Tanniruc0517bc2014-10-26 15:30:55 +0530283ifeq ($(strip $(AUDIO_FEATURE_ENABLED_RECORD_PLAY_CONCURRENCY)),true)
284 LOCAL_CFLAGS += -DRECORD_PLAY_CONCURRENCY
285endif
286
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800287# Removing following flag as dolby is not being used on mobile targets
288# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ACDB_LICENSE)), true)
289# LOCAL_CFLAGS += -DDOLBY_ACDB_LICENSE
290# endif
Ashish Jain8ec50472014-10-16 13:56:28 +0530291
Pradnya Chaphekar8a9dcd82014-09-09 09:49:10 -0700292ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP)),true)
293 LOCAL_CFLAGS += -DDS2_DOLBY_DAP_ENABLED
Pradnya Chaphekar73e2e8b2015-05-01 02:18:17 -0700294 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
Pradnya Chaphekar8a9dcd82014-09-09 09:49:10 -0700295ifneq ($(strip $(DOLBY_DDP)),true)
Pradnya Chaphekar73e2e8b2015-05-01 02:18:17 -0700296 ifneq ($(strip $(DS1_DOLBY_DAP)),true)
Pradnya Chaphekar8a9dcd82014-09-09 09:49:10 -0700297 LOCAL_SRC_FILES += audio_extn/dolby.c
298 endif
299endif
300endif
301
Pradnya Chaphekar80a8cfb2014-10-20 16:17:01 -0700302ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HDMI_PASSTHROUGH)),true)
303 LOCAL_CFLAGS += -DHDMI_PASSTHROUGH_ENABLED
Mingming Yin21854652016-04-13 11:54:02 -0700304 LOCAL_SRC_FILES += audio_extn/passthru.c
305endif
306
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800307# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_KEEP_ALIVE)),true)
308# LOCAL_CFLAGS += -DKEEP_ALIVE_ENABLED
309# LOCAL_SRC_FILES += audio_extn/keep_alive.c
310# endif
Pradnya Chaphekar80a8cfb2014-10-20 16:17:01 -0700311
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800312#This feature is depricated, file disabled
313#ifeq ($(strip $(AUDIO_FEATURE_IP_HDLR_ENABLED)),true)
314# LOCAL_CFLAGS += -DAUDIO_EXTN_IP_HDLR_ENABLED
315# LOCAL_SRC_FILES += audio_extn/ip_hdlr_intf.c
316#endif
Ashish Jaind5694242017-09-05 20:09:06 +0530317
Lakshman Chaluvaraju22ba9f12016-09-12 11:42:10 +0530318ifeq ($(strip $(AUDIO_FEATURE_ENABLED_QAF)),true)
319 LOCAL_CFLAGS += -DQAF_EXTN_ENABLED
320 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/qaf/
321 LOCAL_SRC_FILES += audio_extn/qaf.c
322endif
323
Samyak Jain15fda662018-12-18 16:40:52 +0530324ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CONCURRENT_CAPTURE)),true)
325 LOCAL_CFLAGS += -DCONCURRENT_CAPTURE_ENABLED
326endif
327
Dhananjay Kumaree4d2002016-10-25 18:02:58 +0530328ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_INPUT)),true)
329 LOCAL_CFLAGS += -DCOMPRESS_INPUT_ENABLED
330 LOCAL_SRC_FILES += audio_extn/compress_in.c
331endif
332
333ifeq ($(strip $(BOARD_SUPPORTS_QAHW)),true)
334 LOCAL_CFLAGS += -DAUDIO_HW_EXTN_API_ENABLED
335 LOCAL_SRC_FILES += audio_hw_extn_api.c
336endif
337
Bharath Gopal01310bb2016-12-05 15:39:32 +0530338ifeq ($(strip $(AUDIO_FEATURE_ENABLED_BT_HAL)),true)
339 LOCAL_CFLAGS += -DAUDIO_EXTN_BT_HAL_ENABLED
340 LOCAL_SRC_FILES += audio_extn/bt_hal.c
341endif
342
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800343LOCAL_SHARED_LIBRARIES := \
Aalique Grahame22e49102018-12-18 14:23:57 -0800344 liblog \
345 libcutils \
346 libtinyalsa \
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800347 libtinycompress \
Aalique Grahame22e49102018-12-18 14:23:57 -0800348 libaudioroute \
349 libdl \
350 libaudioutils \
Aniket Kumar Lata808e8d62019-01-28 22:54:28 -0800351 libexpat \
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800352 libqti_vndfwk_detect \
353 libhwbinder \
354 libhidlbase \
355 libhidltransport
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800356
357LOCAL_C_INCLUDES += \
Aalique Grahame22e49102018-12-18 14:23:57 -0800358 external/tinyalsa/include \
359 external/tinycompress/include \
360 system/media/audio_utils/include \
361 external/expat/lib \
Aniket Kumar Lata808e8d62019-01-28 22:54:28 -0800362 vendor/qcom/opensource/core-utils/fwk-detect \
Aalique Grahame22e49102018-12-18 14:23:57 -0800363 $(call include-path-for, audio-route) \
364 $(call include-path-for, audio-effects) \
365 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
366 $(LOCAL_PATH)/audio_extn \
367 $(LOCAL_PATH)/voice_extn
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800368
Kiran Kandi910e1862013-10-29 13:29:42 -0700369ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
370 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
371 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
372 LOCAL_SRC_FILES += audio_extn/listen.c
373endif
374
Srinivas Rao Narne8ff4db52018-01-25 16:04:44 -0800375ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
Aalique Grahame22e49102018-12-18 14:23:57 -0800376 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Srinivas Rao Narne8ff4db52018-01-25 16:04:44 -0800377 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/techpack/audio/include
Satish Babu Patakokila1d3b15d2018-07-03 17:09:40 +0530378 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Srinivas Rao Narne8ff4db52018-01-25 16:04:44 -0800379endif
380
Aalique Grahame22e49102018-12-18 14:23:57 -0800381ifeq ($(strip $(AUDIO_FEATURE_SUPPORTED_EXTERNAL_BT)),true)
382 LOCAL_CFLAGS += -DEXTERNAL_BT_SUPPORTED
383endif
384
385ifeq ($(strip $(AUDIO_FEATURE_FLICKER_SENSOR_INPUT)),true)
386 LOCAL_CFLAGS += -DFLICKER_SENSOR_INPUT
387endif
388
389ifeq ($(strip $(AUDIO_FEATURE_NO_AUDIO_OUT)),true)
390 LOCAL_CFLAGS += -DNO_AUDIO_OUT
391endif
392
Ashish Jain81eb2a82015-05-13 10:52:34 +0530393ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXT_HDMI)),true)
394 LOCAL_CFLAGS += -DAUDIO_EXTERNAL_HDMI_ENABLED
395ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HDMI_PASSTHROUGH)),true)
396 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-parsers
397 LOCAL_SHARED_LIBRARIES += libaudioparsers
398endif
399endif
400
Ravi Kumar Alamanda8fa6b192014-09-09 16:06:42 -0700401ifeq ($(strip $(BOARD_SUPPORTS_SOUND_TRIGGER)),true)
Banajit Goswami710f3532016-08-28 14:48:33 -0700402 ST_FEATURE_ENABLE := true
403endif
404
405ifeq ($(strip $(BOARD_SUPPORTS_SOUND_TRIGGER_HAL)),true)
406 ST_FEATURE_ENABLE := true
407endif
408
409ifeq ($(ST_FEATURE_ENABLE), true)
Ravi Kumar Alamanda8fa6b192014-09-09 16:06:42 -0700410 LOCAL_CFLAGS += -DSOUND_TRIGGER_ENABLED
411 LOCAL_CFLAGS += -DSOUND_TRIGGER_PLATFORM_NAME=$(TARGET_BOARD_PLATFORM)
412 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/sound_trigger
413 LOCAL_SRC_FILES += audio_extn/soundtrigger.c
Aalique Grahame22e49102018-12-18 14:23:57 -0800414ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
415 LOCAL_HEADER_LIBRARIES += sound_trigger.primary_headers
416endif
Ravi Kumar Alamanda8fa6b192014-09-09 16:06:42 -0700417endif
418
Damir Didjustof1d46c72013-11-06 17:59:04 -0800419ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
420 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
421endif
422
Preetam Singh Ranawat2d0e4632015-02-02 12:40:59 +0530423ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PM_SUPPORT)),true)
424 LOCAL_CFLAGS += -DPM_SUPPORT_ENABLED
425 LOCAL_SRC_FILES += audio_extn/pm.c
426 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libperipheralclient/inc
427 LOCAL_SHARED_LIBRARIES += libperipheral_client
428endif
429
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800430# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DISPLAY_PORT)),true)
431# LOCAL_CFLAGS += -DDISPLAY_PORT_ENABLED
432# endif
Shiv Maliyappanahallic0656402016-09-03 14:13:26 -0700433
Weiyin Jiangaa80acd2016-09-21 16:42:11 +0800434ifeq ($(strip $(AUDIO_FEATURE_ENABLED_GEF_SUPPORT)),true)
435 LOCAL_CFLAGS += -DAUDIO_GENERIC_EFFECT_FRAMEWORK_ENABLED
436 LOCAL_SRC_FILES += audio_extn/gef.c
437endif
438
Ben Rombergerd771a7c2017-02-22 18:05:17 -0800439ifeq ($(strip $($AUDIO_FEATURE_ADSP_HDLR_ENABLED)),true)
440 LOCAL_CFLAGS += -DAUDIO_EXTN_ADSP_HDLR_ENABLED
441 LOCAL_SRC_FILES += audio_extn/adsp_hdlr.c
442endif
443
Revathi Uddaraju1eac8b02017-05-18 17:13:33 +0530444ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DYNAMIC_LOG)), true)
445 LOCAL_CFLAGS += -DDYNAMIC_LOG_ENABLED
446 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-log-utils
447 LOCAL_SHARED_LIBRARIES += libaudio_log_utils
448endif
449
Vikram Pandurangaa8932c22018-07-02 15:54:28 -0700450ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DYNAMIC_ECNS)),true)
Vikram Pandurangadf59cae2017-08-03 18:04:55 -0700451 LOCAL_CFLAGS += -DDYNAMIC_ECNS_ENABLED
452endif
453
Aditya Bavanari29bcea22017-10-03 20:10:35 +0530454ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INSTANCE_ID)), true)
455 LOCAL_CFLAGS += -DINSTANCE_ID_ENABLED
456endif
457
Haynes Mathew George01156f92018-04-13 15:29:54 -0700458ifeq ($(strip $(AUDIO_FEATURE_ENABLED_BATTERY_LISTENER)), true)
459 LOCAL_CFLAGS += -DBATTERY_LISTENER_ENABLED
460 LOCAL_SRC_FILES += audio_extn/battery_listener.cpp
461 LOCAL_SHARED_LIBRARIES += android.hardware.health@1.0 android.hardware.health@2.0 \
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800462 libbase libutils android.hardware.power@1.2
Haynes Mathew George01156f92018-04-13 15:29:54 -0700463 LOCAL_STATIC_LIBRARIES := libhealthhalutils
464endif
465
Dhanalakshmi Siddani57b014e2018-04-23 12:52:02 +0530466ifeq ($(strip $(AUDIO_FEATURE_ENABLED_KEEP_ALIVE_ARM_FFV)), true)
Dhanalakshmi Siddani30e06a22018-03-27 23:11:34 +0530467 LOCAL_CFLAGS += -DRUN_KEEP_ALIVE_IN_ARM_FFV
468endif
469
Dhanalakshmi Siddani57b014e2018-04-23 12:52:02 +0530470ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FFV)), true)
Dhanalakshmi Siddani30e06a22018-03-27 23:11:34 +0530471 LOCAL_CFLAGS += -DFFV_ENABLED
Dhanalakshmi Siddani57b014e2018-04-23 12:52:02 +0530472 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio-noship/include/ffv
Dhanalakshmi Siddani30e06a22018-03-27 23:11:34 +0530473 LOCAL_SRC_FILES += audio_extn/ffv.c
474endif
475
Weiyin Jiange6ce6312019-01-28 18:28:22 +0800476ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AHAL_EXT)),true)
477 LOCAL_CFLAGS += -DAHAL_EXT_ENABLED
478 LOCAL_SHARED_LIBRARIES += vendor.qti.hardware.audiohalext@1.0
479endif
480
Satya Krishna Pindiprolif1cd92b2016-04-14 19:05:23 +0530481LOCAL_CFLAGS += -Wall -Werror
Alexy Josephb1379942016-01-29 15:49:38 -0800482
Mingming Yin5b7c0b32014-08-04 15:49:24 -0700483LOCAL_COPY_HEADERS_TO := mm-audio
484LOCAL_COPY_HEADERS := audio_extn/audio_defs.h
485
Arun Mirpurib1bec9c2019-01-29 16:42:45 -0800486# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SND_MONITOR)), true)
487# LOCAL_CFLAGS += -DSND_MONITOR_ENABLED
488# LOCAL_SRC_FILES += audio_extn/sndmonitor.c
489# endif
490
491# ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MAXX_AUDIO)), true)
492# LOCAL_CFLAGS += -DMAXXAUDIO_QDSP_ENABLED
493# LOCAL_SRC_FILES += audio_extn/maxxaudio.c
494# endif
Haynes Mathew George3a1f1fb2016-08-09 15:43:13 -0700495
Vatsal Buchac09ae062018-11-14 13:25:08 +0530496ifeq ($(strip $(AUDIO_FEATURE_ENABLED_GCOV)),true)
497 LOCAL_CFLAGS += --coverage -fprofile-arcs -ftest-coverage
498 LOCAL_CPPFLAGS += --coverage -fprofile-arcs -ftest-coverage
499 LOCAL_STATIC_LIBRARIES += libprofile_rt
500endif
501
Derek Chend2530072014-11-24 12:39:14 -0800502ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXT_HW_PLUGIN)),true)
503 LOCAL_CFLAGS += -DEXT_HW_PLUGIN_ENABLED
504 LOCAL_SRC_FILES += audio_extn/ext_hw_plugin.c
505endif
506
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700507LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800508
Apoorv Raghuvanshi1b555f72014-05-29 12:48:15 -0700509LOCAL_MODULE_RELATIVE_PATH := hw
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800510
511LOCAL_MODULE_TAGS := optional
512
Aalique Grahame22e49102018-12-18 14:23:57 -0800513LOCAL_MODULE_OWNER := qti
514
515LOCAL_PROPRIETARY_MODULE := true
516
Naresh Tanniru10758b62017-06-05 21:05:53 +0530517LOCAL_VENDOR_MODULE := true
518
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800519include $(BUILD_SHARED_LIBRARY)
520
Soumil Shah196157e2018-01-22 17:39:48 -0800521LOCAL_CFLAGS += -Wno-unused-variable
522LOCAL_CFLAGS += -Wno-sign-compare
523LOCAL_CFLAGS += -Wno-unused-parameter
524LOCAL_CFLAGS += -Wno-unused-label
525LOCAL_CFLAGS += -Wno-gnu-designator
526LOCAL_CFLAGS += -Wno-typedef-redefinition
527LOCAL_CFLAGS += -Wno-shorten-64-to-32
528LOCAL_CFLAGS += -Wno-tautological-compare
529LOCAL_CFLAGS += -Wno-unused-function
530LOCAL_CFLAGS += -Wno-unused-local-typedef
531
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800532endif
Naresh Tanniruf1290152018-11-27 12:16:45 +0530533endif