blob: 3d7255320e452560def1dbce287611736227e102 [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)
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070010
David Nga5ad5ea2013-10-10 20:36:49 -070011ifneq ($(filter msm8974 msm8226 msm8610 apq8084,$(TARGET_BOARD_PLATFORM)),)
Ajay Dudanibe3335a2013-08-19 18:47:21 -070012 # B-family platform uses msm8974 code base
13 AUDIO_PLATFORM = msm8974
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -070014 MULTIPLE_HW_VARIANTS_ENABLED := true
Mingming Yin8e5a4f62013-10-07 15:23:41 -070015ifneq ($(filter msm8610,$(TARGET_BOARD_PLATFORM)),)
16 LOCAL_CFLAGS := -DPLATFORM_MSM8610
17endif
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070018ifneq ($(filter msm8226,$(TARGET_BOARD_PLATFORM)),)
19 LOCAL_CFLAGS := -DPLATFORM_MSM8x26
20endif
Vidyakumar Athotad9d9ff32013-11-13 11:46:52 -080021ifneq ($(filter apq8084,$(TARGET_BOARD_PLATFORM)),)
22 LOCAL_CFLAGS := -DPLATFORM_APQ8084
23endif
Steve Kondikac72feb2014-07-20 23:15:34 -070024ifneq ($(filter msm8974,$(TARGET_BOARD_PLATFORM)),)
25 LOCAL_CFLAGS := -DPLATFORM_MSM8974
26endif
Ajay Dudanibe3335a2013-08-19 18:47:21 -070027endif
28
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080029LOCAL_SRC_FILES := \
30 audio_hw.c \
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070031 voice.c \
Ben Romberger5c5af692014-01-10 13:49:02 -080032 platform_info.c \
Ajay Dudanibe3335a2013-08-19 18:47:21 -070033 $(AUDIO_PLATFORM)/platform.c
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080034
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070035LOCAL_SRC_FILES += audio_extn/audio_extn.c
36
Tony Layher692f19a2015-01-03 13:16:45 -050037LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
38LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
39
Mingming Yin78541282014-05-16 12:10:55 -070040ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ANC_HEADSET)),true)
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070041 LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
42endif
43
Steve Kondik79733032014-12-08 04:02:28 -080044ifneq ($(strip $(AUDIO_FEATURE_ENABLED_FLUENCE)),false)
Venkata Narendra Kumar Gutta9c38b182014-03-27 17:39:57 +053045 LOCAL_CFLAGS += -DFLUENCE_ENABLED
46endif
47
Steve Kondik79733032014-12-08 04:02:28 -080048ifneq ($(strip $(AUDIO_FEATURE_ENABLED_PROXY_DEVICE)),false)
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070049 LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
50endif
51
Ramjee Singhfd4323f2015-11-18 13:26:59 +053052ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FM_POWER_OPT)),true)
53 LOCAL_CFLAGS += -DFM_POWER_OPT
Apoorv Raghuvanshi6e262842013-10-06 14:39:35 -070054 LOCAL_SRC_FILES += audio_extn/fm.c
55endif
56
Mingming Yin78541282014-05-16 12:10:55 -070057ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USBAUDIO)),true)
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070058 LOCAL_CFLAGS += -DUSB_HEADSET_ENABLED
59 LOCAL_SRC_FILES += audio_extn/usb.c
60endif
Mingming Yin78541282014-05-16 12:10:55 -070061
Steve Kondik79733032014-12-08 04:02:28 -080062ifneq ($(strip $(AUDIO_FEATURE_ENABLED_HFP)),false)
Vimal Puthanveed5b4d3f12013-11-05 15:57:39 -080063 LOCAL_CFLAGS += -DHFP_ENABLED
64 LOCAL_SRC_FILES += audio_extn/hfp.c
65endif
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070066
Mingming Yin78541282014-05-16 12:10:55 -070067ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CUSTOMSTEREO)),true)
68 LOCAL_CFLAGS += -DCUSTOM_STEREO_ENABLED
69endif
70
71ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SSR)),true)
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070072 LOCAL_CFLAGS += -DSSR_ENABLED
73 LOCAL_SRC_FILES += audio_extn/ssr.c
74 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/surround_sound/
75endif
76
Christopher R. Palmerbecbb2f2017-01-06 14:50:48 -050077ifeq ($(strip $(AUDIO_FEATURE_HUAWEI_SOUND_PARAM_PATH)),true)
78 LOCAL_CFLAGS += -DHUAWEI_SOUND_PARAM_PATH
79endif
80
Mingming Yin78541282014-05-16 12:10:55 -070081ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS)),true)
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070082 LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
83 LOCAL_SRC_FILES += voice_extn/voice_extn.c
Steve Kondik504b9db2015-10-16 02:04:59 -070084ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INCALL_MUSIC)),true)
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070085 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
86endif
Bruno Martinse2078812015-08-03 22:52:51 +010087ifeq ($(strip $(AUDIO_FEATURE_HTC_DUAL_SIM)),true)
88 LOCAL_CFLAGS += -DHTC_DUAL_SIM
89 LOCAL_SRC_FILES += voice_extn/msim_voice_extn.c
90endif
ljzyala53260b2015-07-25 00:41:56 -070091ifeq ($(strip $(AUDIO_FEATURE_SAMSUNG_DUAL_SIM)),true)
92 LOCAL_CFLAGS += -DSAMSUNG_DUAL_SIM
Bruno Martinse2078812015-08-03 22:52:51 +010093 LOCAL_SRC_FILES += voice_extn/msim_voice_extn.c
ljzyala53260b2015-07-25 00:41:56 -070094endif
Steve Kondik72f069b2014-01-05 16:00:57 -080095endif
dhacker2966184b02014-03-29 03:02:50 -040096
Tony Layher29451af2015-01-03 13:10:54 -050097ifneq ($(filter apq8084 msm8974 msm8226 msm8610,$(TARGET_BOARD_PLATFORM)),)
Steve Kondik79733032014-12-08 04:02:28 -080098ifneq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_VOIP)),false)
Narsinga Rao Chella05573b72013-11-15 15:21:40 -080099 LOCAL_CFLAGS += -DCOMPRESS_VOIP_ENABLED
100 LOCAL_SRC_FILES += voice_extn/compress_voip.c
101endif
dhacker2966184b02014-03-29 03:02:50 -0400102endif
Mingming Yin78541282014-05-16 12:10:55 -0700103
Steve Kondik79733032014-12-08 04:02:28 -0800104ifneq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FORMATS)),false)
Amit Shekharfaefb322014-09-08 14:08:19 -0700105LOCAL_CFLAGS += -DAUDIO_EXTN_FORMATS_ENABLED
Mingming Yin78541282014-05-16 12:10:55 -0700106endif
107
Tony Layher29451af2015-01-03 13:10:54 -0500108ifneq ($(filter apq8084 msm8974,$(TARGET_BOARD_PLATFORM)),)
Ramjee Singh3e68db32014-08-07 17:21:00 +0530109ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true)
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700110 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
111 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700112endif
dhacker2966184b02014-03-29 03:02:50 -0400113endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700114
Eric Laurentda46bfb2014-08-25 22:39:29 -0500115ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTERNAL_SPEAKER)),true)
116 LOCAL_CFLAGS += -DEXTERNAL_SPEAKER_ENABLED
117 LOCAL_SRC_FILES += audio_extn/ext_speaker.c
118endif
119
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -0700120ifdef MULTIPLE_HW_VARIANTS_ENABLED
121 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
122 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
123endif
124
Steve Kondik504b9db2015-10-16 02:04:59 -0700125#ifneq ($(filter apq8084 msm8974 msm8226 msm8610,$(TARGET_BOARD_PLATFORM)),)
126#ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE)),true)
127# LOCAL_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED
128# LOCAL_SRC_FILES += audio_extn/compress_capture.c
129#endif
130#endif
Mingming Yine62d7842013-10-25 16:26:03 -0700131
Eric Laurent0043e152014-10-23 14:42:59 -0700132ifeq ($(strip $(AUDIO_FEATURE_ENABLED_NEW_SAMPLE_RATE)),true)
133 LOCAL_CFLAGS += -DNEW_SAMPLE_RATE_ENABLED
134endif
135
Tony Layher29451af2015-01-03 13:10:54 -0500136ifneq ($(filter apq8084 msm8974 msm8226 msm8610,$(TARGET_BOARD_PLATFORM)),)
Mingming Yin78541282014-05-16 12:10:55 -0700137ifeq ($(strip $(DOLBY_DDP)),true)
Mingming Yin90310102013-11-13 16:57:00 -0800138 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
Subhash Chandra Bose Naripeddye0a07122013-12-14 00:34:53 -0800139 LOCAL_SRC_FILES += audio_extn/dolby.c
Mingming Yin90310102013-11-13 16:57:00 -0800140endif
dhacker2966184b02014-03-29 03:02:50 -0400141endif
Mingming Yin90310102013-11-13 16:57:00 -0800142
Mingming Yin78541282014-05-16 12:10:55 -0700143ifeq ($(strip $(DOLBY_DAP)),true)
Subhash Chandra Bose Naripeddye0a07122013-12-14 00:34:53 -0800144 LOCAL_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
Mingming Yin78541282014-05-16 12:10:55 -0700145ifneq ($(strip $(DOLBY_DDP)),true)
Subhash Chandra Bose Naripeddye0a07122013-12-14 00:34:53 -0800146 LOCAL_SRC_FILES += audio_extn/dolby.c
147endif
148endif
149
Steve Kondikb045f472014-11-12 23:24:07 -0800150ifeq ($(AUDIO_FEATURE_LOW_LATENCY_PRIMARY),true)
151 LOCAL_CFLAGS += -DLOW_LATENCY_PRIMARY
152endif
153
Alexy Joseph505da3f2015-09-10 01:31:51 -0700154ifeq ($(strip $(AUDIO_FEATURE_ENABLED_WMA_OFFLOAD)),true)
Ethan Chenc856d972014-07-25 14:57:15 -0700155 LOCAL_CFLAGS += -DWMA_OFFLOAD_ENABLED
Alexy Joseph505da3f2015-09-10 01:31:51 -0700156 LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Ethan Chenc856d972014-07-25 14:57:15 -0700157endif
158
Tony Layher29451af2015-01-03 13:10:54 -0500159ifneq ($(filter apq8084 msm8974 msm8226,$(TARGET_BOARD_PLATFORM)),)
Ethan Chenc856d972014-07-25 14:57:15 -0700160ifneq ($(strip $(AUDIO_FEATURE_DISABLED_MP2_OFFLOAD)),true)
161 LOCAL_CFLAGS += -DMP2_OFFLOAD_ENABLED
Ethan Chenc856d972014-07-25 14:57:15 -0700162endif
163endif
164
Subhash Chandra Bose Naripeddy148144e2014-04-01 21:03:10 -0700165ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTIPLE_TUNNEL)), true)
166 LOCAL_CFLAGS += -DMULTIPLE_OFFLOAD_ENABLED
167endif
168
Steve Kondik6bedcdf2014-07-21 11:48:30 -0700169ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD)),true)
170 LOCAL_CFLAGS += -DFLAC_OFFLOAD_ENABLED
Alexy Joseph505da3f2015-09-10 01:31:51 -0700171 LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
Steve Kondik6bedcdf2014-07-21 11:48:30 -0700172endif
173
Gabriele Md9ff3712015-12-17 22:00:12 +0100174ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LOW_LATENCY_CAPTURE)),true)
Ravi Kumar Alamanda1c3de5e2014-09-08 15:59:58 -0700175 LOCAL_CFLAGS += -DLOW_LATENCY_CAPTURE_USE_CASE=1
176endif
177
Steve Kondika7e38b72016-03-08 23:40:11 -0800178ifeq ($(strip $(AUDIO_FEATURE_ENABLED_KPI_OPTIMIZE)),true)
179 LOCAL_CFLAGS += -DKPI_OPTIMIZE_ENABLED
180endif
181
Sultan Qasim Khan3125b2c2017-02-26 22:58:35 -0500182ifeq ($(strip $(AUDIO_FEATURE_DISABLED_FM_VIRTUAL_RECORD)),true)
183 LOCAL_CFLAGS += -DNO_FM_VIRTUAL_RECORD
184endif
185
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800186LOCAL_SHARED_LIBRARIES := \
187 liblog \
188 libcutils \
Ethan Chen79c356c2015-06-07 12:26:14 -0700189 libhardware \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800190 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700191 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800192 libaudioroute \
Ben Romberger5c5af692014-01-10 13:49:02 -0800193 libdl \
194 libexpat
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800195
196LOCAL_C_INCLUDES += \
197 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700198 external/tinycompress/include \
Ben Romberger5c5af692014-01-10 13:49:02 -0800199 external/expat/lib \
Ethan Chen79c356c2015-06-07 12:26:14 -0700200 hardware/libhardware/include \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -0700201 $(call include-path-for, audio-route) \
Eric Laurentb23d5282013-05-14 15:27:20 -0700202 $(call include-path-for, audio-effects) \
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700203 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800204 $(LOCAL_PATH)/audio_extn \
Ramjee Singh716bd192015-07-10 16:34:41 +0530205 $(LOCAL_PATH)/voice_extn \
Steve Kondika7e38b72016-03-08 23:40:11 -0800206 $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800207
Kiran Kandi910e1862013-10-29 13:29:42 -0700208ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
209 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
210 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
211 LOCAL_SRC_FILES += audio_extn/listen.c
212endif
213
Damir Didjustof1d46c72013-11-06 17:59:04 -0800214ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
215 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
216endif
217
Tony Layherbe228ca2014-12-23 10:58:58 -0500218ifeq ($(BOARD_USES_ES705),true)
219 LOCAL_CFLAGS += -DUSE_ES705
220endif
221
Steve Kondik50ee8102015-01-02 14:47:25 -0800222ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HWDEP_CAL)),true)
223 LOCAL_CFLAGS += -DHWDEP_CAL_ENABLED
224endif
225
Mingming Yind1179ad2014-08-04 15:49:24 -0700226LOCAL_COPY_HEADERS_TO := mm-audio
227LOCAL_COPY_HEADERS := audio_extn/audio_defs.h
228
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700229LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800230
231LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
232
233LOCAL_MODULE_TAGS := optional
234
235include $(BUILD_SHARED_LIBRARY)
236
237endif