blob: a2e41c2d6486abf5de185b79d0d4e783caaa90ef [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
Banajit Goswami22582e72014-10-15 18:29:34 -070011ifneq ($(filter msm8974 msm8226 msm8610 apq8084 msm8994 thulium,$(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
Mingming Yin0e1b2902014-05-19 18:20:59 -070024ifneq ($(filter msm8994,$(TARGET_BOARD_PLATFORM)),)
25 LOCAL_CFLAGS := -DPLATFORM_MSM8994
26endif
Banajit Goswami22582e72014-10-15 18:29:34 -070027ifneq ($(filter thulium,$(TARGET_BOARD_PLATFORM)),)
28 LOCAL_CFLAGS := -DPLATFORM_THULIUM
29endif
Ajay Dudanibe3335a2013-08-19 18:47:21 -070030endif
31
padarshr04e74812014-09-17 13:34:31 +053032ifneq ($(filter msm8916 msm8909,$(TARGET_BOARD_PLATFORM)),)
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053033 AUDIO_PLATFORM = msm8916
34 MULTIPLE_HW_VARIANTS_ENABLED := true
35 LOCAL_CFLAGS := -DPLATFORM_MSM8916
padarshr04e74812014-09-17 13:34:31 +053036ifneq ($(filter msm8909,$(TARGET_BOARD_PLATFORM)),)
Dhananjay Kumar2bb2fc12014-07-11 19:14:23 +053037 LOCAL_CFLAGS := -DPLATFORM_MSM8909
38endif
Naresh Tannirudb72d1e2014-03-05 17:33:47 +053039endif
Naresh Tanniru8b919ac2014-01-30 19:12:53 +053040
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080041LOCAL_SRC_FILES := \
42 audio_hw.c \
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070043 voice.c \
Ben Romberger61764e32014-01-10 13:49:02 -080044 platform_info.c \
Ajay Dudanibe3335a2013-08-19 18:47:21 -070045 $(AUDIO_PLATFORM)/platform.c
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080046
Subhash Chandra Bose Naripeddy19dc03b2014-03-10 14:43:05 -070047LOCAL_SRC_FILES += audio_extn/audio_extn.c \
48 audio_extn/utils.c
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -070049LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
50LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070051
Mingming Yina6dad602014-05-16 12:10:55 -070052ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PCM_OFFLOAD)),true)
Mingming Yin67e34512014-04-03 17:47:22 -070053 LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED
54endif
55
Mingming Yina6dad602014-05-16 12:10:55 -070056ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ANC_HEADSET)),true)
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070057 LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
58endif
59
Mingming Yina6dad602014-05-16 12:10:55 -070060ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FLUENCE)),true)
Venkata Narendra Kumar Gutta88fd0bc2014-03-27 19:47:56 +053061 LOCAL_CFLAGS += -DFLUENCE_ENABLED
62endif
63
Mingming Yina6dad602014-05-16 12:10:55 -070064ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PROXY_DEVICE)),true)
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070065 LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
66endif
67
Mingming Yina6dad602014-05-16 12:10:55 -070068ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FM)),true)
Apoorv Raghuvanshi6e262842013-10-06 14:39:35 -070069 LOCAL_CFLAGS += -DFM_ENABLED
70 LOCAL_SRC_FILES += audio_extn/fm.c
71endif
72
Mingming Yina6dad602014-05-16 12:10:55 -070073ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USBAUDIO)),true)
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070074 LOCAL_CFLAGS += -DUSB_HEADSET_ENABLED
75 LOCAL_SRC_FILES += audio_extn/usb.c
76endif
Mingming Yina6dad602014-05-16 12:10:55 -070077
78ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HFP)),true)
Vimal Puthanveed5b4d3f12013-11-05 15:57:39 -080079 LOCAL_CFLAGS += -DHFP_ENABLED
80 LOCAL_SRC_FILES += audio_extn/hfp.c
81endif
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070082
Mingming Yina6dad602014-05-16 12:10:55 -070083ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CUSTOMSTEREO)),true)
Jitendra Singh Naruka9a6a8d42014-02-10 20:07:12 -080084 LOCAL_CFLAGS += -DCUSTOM_STEREO_ENABLED
85endif
86
Mingming Yina6dad602014-05-16 12:10:55 -070087ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SSR)),true)
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070088 LOCAL_CFLAGS += -DSSR_ENABLED
89 LOCAL_SRC_FILES += audio_extn/ssr.c
90 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/surround_sound/
Nagender Telkarca2b4942014-03-24 12:25:42 -060091 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/common/inc/
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070092endif
93
Mingming Yina6dad602014-05-16 12:10:55 -070094ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS)),true)
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070095 LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
96 LOCAL_SRC_FILES += voice_extn/voice_extn.c
Vidyakumar Athota21b3bb92014-04-25 11:08:08 -070097
Mingming Yina6dad602014-05-16 12:10:55 -070098ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INCALL_MUSIC)),true)
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070099 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
100endif
Mingming Yina6dad602014-05-16 12:10:55 -0700101ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_VOIP)),true)
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800102 LOCAL_CFLAGS += -DCOMPRESS_VOIP_ENABLED
103 LOCAL_SRC_FILES += voice_extn/compress_voip.c
104endif
Subhash Chandra Bose Naripeddy19dc03b2014-03-10 14:43:05 -0700105
106endif
107
Mingming Yina6dad602014-05-16 12:10:55 -0700108ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FORMATS)),true)
Subhash Chandra Bose Naripeddy19dc03b2014-03-10 14:43:05 -0700109LOCAL_CFLAGS += -DFORMATS_ENABLED
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700110endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700111
Anish Kumard80a1392014-07-16 16:18:51 -0700112ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true)
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700113 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
114 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -0700115endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -0700116
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -0700117ifdef MULTIPLE_HW_VARIANTS_ENABLED
118 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
119 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
120endif
121
Mingming Yina6dad602014-05-16 12:10:55 -0700122ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE)),true)
Mingming Yine62d7842013-10-25 16:26:03 -0700123 LOCAL_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED
124 LOCAL_SRC_FILES += audio_extn/compress_capture.c
125endif
126
Mingming Yina6dad602014-05-16 12:10:55 -0700127ifeq ($(strip $(DOLBY_DDP)),true)
Mingming Yin90310102013-11-13 16:57:00 -0800128 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800129 LOCAL_SRC_FILES += audio_extn/dolby.c
Mingming Yin90310102013-11-13 16:57:00 -0800130endif
131
Mingming Yina6dad602014-05-16 12:10:55 -0700132ifeq ($(strip $(DOLBY_DAP)),true)
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800133 LOCAL_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
Mingming Yina6dad602014-05-16 12:10:55 -0700134ifneq ($(strip $(DOLBY_DDP)),true)
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800135 LOCAL_SRC_FILES += audio_extn/dolby.c
136endif
137endif
138
Subhash Chandra Bose Naripeddy16ff4f82014-04-01 21:03:10 -0700139ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTIPLE_TUNNEL)), true)
140 LOCAL_CFLAGS += -DMULTIPLE_OFFLOAD_ENABLED
141endif
Subhash Chandra Bose Naripeddy7690c562013-12-14 00:34:53 -0800142
Mingming Yin3ee55c62014-08-04 14:23:35 -0700143ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER)),true)
144 LOCAL_CFLAGS += -DQTI_FLAC_DECODER
145endif
146
Lior Barenboim0b61bc72014-05-13 13:01:37 +0300147ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DEV_ARBI)),true)
148 LOCAL_CFLAGS += -DDEV_ARBI_ENABLED
149 LOCAL_SRC_FILES += audio_extn/dev_arbi.c
150endif
151
Naresh Tanniruc0517bc2014-10-26 15:30:55 +0530152ifeq ($(strip $(AUDIO_FEATURE_ENABLED_RECORD_PLAY_CONCURRENCY)),true)
153 LOCAL_CFLAGS += -DRECORD_PLAY_CONCURRENCY
154endif
155
Pradnya Chaphekar8a9dcd82014-09-09 09:49:10 -0700156ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP)),true)
157 LOCAL_CFLAGS += -DDS2_DOLBY_DAP_ENABLED
158ifneq ($(strip $(DOLBY_DDP)),true)
159 ifneq ($(strip $(DOLBY_DAP)),true)
160 LOCAL_SRC_FILES += audio_extn/dolby.c
161 endif
162endif
163endif
164
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800165LOCAL_SHARED_LIBRARIES := \
166 liblog \
167 libcutils \
168 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700169 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800170 libaudioroute \
Ben Romberger61764e32014-01-10 13:49:02 -0800171 libdl \
Vidyakumar Athota77327dd2014-08-07 16:44:25 -0700172 libexpat
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800173
174LOCAL_C_INCLUDES += \
175 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700176 external/tinycompress/include \
Ben Romberger61764e32014-01-10 13:49:02 -0800177 external/expat/lib \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -0700178 $(call include-path-for, audio-route) \
Eric Laurentb23d5282013-05-14 15:27:20 -0700179 $(call include-path-for, audio-effects) \
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700180 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800181 $(LOCAL_PATH)/audio_extn \
Vidyakumar Athota77327dd2014-08-07 16:44:25 -0700182 $(LOCAL_PATH)/voice_extn
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800183
Kiran Kandi910e1862013-10-29 13:29:42 -0700184ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
185 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
186 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
187 LOCAL_SRC_FILES += audio_extn/listen.c
188endif
189
Ravi Kumar Alamanda8fa6b192014-09-09 16:06:42 -0700190ifeq ($(strip $(BOARD_SUPPORTS_SOUND_TRIGGER)),true)
191 LOCAL_CFLAGS += -DSOUND_TRIGGER_ENABLED
192 LOCAL_CFLAGS += -DSOUND_TRIGGER_PLATFORM_NAME=$(TARGET_BOARD_PLATFORM)
193 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/sound_trigger
194 LOCAL_SRC_FILES += audio_extn/soundtrigger.c
195endif
196
Damir Didjustof1d46c72013-11-06 17:59:04 -0800197ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
198 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
199endif
200
Mingming Yin5b7c0b32014-08-04 15:49:24 -0700201LOCAL_COPY_HEADERS_TO := mm-audio
202LOCAL_COPY_HEADERS := audio_extn/audio_defs.h
203
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700204LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800205
Apoorv Raghuvanshi1b555f72014-05-29 12:48:15 -0700206LOCAL_MODULE_RELATIVE_PATH := hw
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800207
208LOCAL_MODULE_TAGS := optional
209
210include $(BUILD_SHARED_LIBRARY)
211
212endif