blob: 35b0823f209a56d7574212ae0e112459092e0fd3 [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
Ajay Dudanibe3335a2013-08-19 18:47:21 -070024endif
25
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080026LOCAL_SRC_FILES := \
27 audio_hw.c \
Shiv Maliyappanahalli34b585f2013-10-01 15:49:05 -070028 voice.c \
Ajay Dudanibe3335a2013-08-19 18:47:21 -070029 $(AUDIO_PLATFORM)/platform.c
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -080030
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070031LOCAL_SRC_FILES += audio_extn/audio_extn.c
32
Mingming Yin78541282014-05-16 12:10:55 -070033ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PCM_OFFLOAD)),true)
34 LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED
35endif
36
37ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ANC_HEADSET)),true)
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070038 LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
39endif
40
Mingming Yin78541282014-05-16 12:10:55 -070041ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FLUENCE)),true)
Venkata Narendra Kumar Gutta9c38b182014-03-27 17:39:57 +053042 LOCAL_CFLAGS += -DFLUENCE_ENABLED
43endif
44
Mingming Yin78541282014-05-16 12:10:55 -070045ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PROXY_DEVICE)),true)
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -070046 LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
47endif
48
Ramjee Singhfd4323f2015-11-18 13:26:59 +053049ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FM_POWER_OPT)),true)
50 LOCAL_CFLAGS += -DFM_POWER_OPT
Apoorv Raghuvanshi6e262842013-10-06 14:39:35 -070051 LOCAL_SRC_FILES += audio_extn/fm.c
52endif
53
Mingming Yin78541282014-05-16 12:10:55 -070054ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USBAUDIO)),true)
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070055 LOCAL_CFLAGS += -DUSB_HEADSET_ENABLED
56 LOCAL_SRC_FILES += audio_extn/usb.c
57endif
Mingming Yin78541282014-05-16 12:10:55 -070058
59ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HFP)),true)
Vimal Puthanveed5b4d3f12013-11-05 15:57:39 -080060 LOCAL_CFLAGS += -DHFP_ENABLED
61 LOCAL_SRC_FILES += audio_extn/hfp.c
62endif
Apoorv Raghuvanshi5792d4b2013-10-07 18:40:05 -070063
Mingming Yin78541282014-05-16 12:10:55 -070064ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CUSTOMSTEREO)),true)
65 LOCAL_CFLAGS += -DCUSTOM_STEREO_ENABLED
66endif
67
68ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SSR)),true)
Apoorv Raghuvanshi6178a3f2013-10-19 12:38:54 -070069 LOCAL_CFLAGS += -DSSR_ENABLED
70 LOCAL_SRC_FILES += audio_extn/ssr.c
71 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/surround_sound/
72endif
73
Mingming Yin78541282014-05-16 12:10:55 -070074ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS)),true)
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070075 LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
76 LOCAL_SRC_FILES += voice_extn/voice_extn.c
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070077 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Nagender44733a42013-12-08 00:05:20 -070078 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Mingming Yin78541282014-05-16 12:10:55 -070079ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INCALL_MUSIC)),true)
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070080 LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
81endif
Mingming Yin78541282014-05-16 12:10:55 -070082ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_VOIP)),true)
Narsinga Rao Chella05573b72013-11-15 15:21:40 -080083 LOCAL_CFLAGS += -DCOMPRESS_VOIP_ENABLED
84 LOCAL_SRC_FILES += voice_extn/compress_voip.c
85endif
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070086endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070087
Mingming Yin78541282014-05-16 12:10:55 -070088
89ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FORMATS)),true)
90LOCAL_CFLAGS += -DFORMATS_ENABLED
91endif
92
Ramjee Singh3e68db32014-08-07 17:21:00 +053093ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true)
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070094 LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
95 LOCAL_SRC_FILES += audio_extn/spkr_protection.c
96 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Nagender44733a42013-12-08 00:05:20 -070097 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Gopikrishnaiah Anandanf538cef2013-10-28 14:06:03 -070098endif
Shiv Maliyappanahalli303f51d2013-10-25 16:24:27 -070099
Ravi Kumar Alamanda48c921d2013-10-29 06:07:44 -0700100ifdef MULTIPLE_HW_VARIANTS_ENABLED
101 LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
102 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
103endif
104
Mingming Yin78541282014-05-16 12:10:55 -0700105ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE)),true)
Mingming Yine62d7842013-10-25 16:26:03 -0700106 LOCAL_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED
107 LOCAL_SRC_FILES += audio_extn/compress_capture.c
108endif
109
Mingming Yin78541282014-05-16 12:10:55 -0700110ifeq ($(strip $(DOLBY_DDP)),true)
Mingming Yin90310102013-11-13 16:57:00 -0800111 LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
112 LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Nagender44733a42013-12-08 00:05:20 -0700113 LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
Subhash Chandra Bose Naripeddye0a07122013-12-14 00:34:53 -0800114 LOCAL_SRC_FILES += audio_extn/dolby.c
Mingming Yin90310102013-11-13 16:57:00 -0800115endif
116
Mingming Yin78541282014-05-16 12:10:55 -0700117ifeq ($(strip $(DOLBY_DAP)),true)
Subhash Chandra Bose Naripeddye0a07122013-12-14 00:34:53 -0800118 LOCAL_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
Mingming Yin78541282014-05-16 12:10:55 -0700119ifneq ($(strip $(DOLBY_DDP)),true)
Subhash Chandra Bose Naripeddye0a07122013-12-14 00:34:53 -0800120 LOCAL_SRC_FILES += audio_extn/dolby.c
121endif
122endif
123
124
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800125LOCAL_SHARED_LIBRARIES := \
126 liblog \
127 libcutils \
128 libtinyalsa \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700129 libtinycompress \
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800130 libaudioroute \
131 libdl
132
133LOCAL_C_INCLUDES += \
134 external/tinyalsa/include \
Ravi Kumar Alamanda4e02e552013-07-17 15:22:04 -0700135 external/tinycompress/include \
Ravi Kumar Alamandaf70ffb42013-04-16 15:55:53 -0700136 $(call include-path-for, audio-route) \
Eric Laurentb23d5282013-05-14 15:27:20 -0700137 $(call include-path-for, audio-effects) \
Apoorv Raghuvanshi9eaf94e2013-10-04 16:13:44 -0700138 $(LOCAL_PATH)/$(AUDIO_PLATFORM) \
Narsinga Rao Chella05573b72013-11-15 15:21:40 -0800139 $(LOCAL_PATH)/audio_extn \
Ramjee Singh716bd192015-07-10 16:34:41 +0530140 $(LOCAL_PATH)/voice_extn \
141 $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800142
Ben Rombergera1673712014-01-10 13:49:02 -0800143ifneq ($(filter msm8974,$(AUDIO_PLATFORM)),)
144 LOCAL_C_INCLUDES += external/expat/lib
145 LOCAL_SHARED_LIBRARIES += libexpat
146 LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/platform_parser.c
147endif
148
Kiran Kandi910e1862013-10-29 13:29:42 -0700149ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
150 LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
151 LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
152 LOCAL_SRC_FILES += audio_extn/listen.c
153endif
154
Damir Didjustof1d46c72013-11-06 17:59:04 -0800155ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
156 LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
157endif
158
Shreyas Nagasandra Chandrasekhar27cf5262014-09-30 15:16:21 +0530159ifeq ($(strip $(AUDIO_FEATURE_PCM_IOCTL_ENABLED)),true)
160 LOCAL_CFLAGS += -DPCM_IOCTL_ENABLED
161endif
162
Mingming Yind1179ad2014-08-04 15:49:24 -0700163LOCAL_COPY_HEADERS_TO := mm-audio
164LOCAL_COPY_HEADERS := audio_extn/audio_defs.h
165
Mingming Yin8e5a4f62013-10-07 15:23:41 -0700166LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
Ravi Kumar Alamanda2dfba2b2013-01-17 16:50:22 -0800167
168LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
169
170LOCAL_MODULE_TAGS := optional
171
172include $(BUILD_SHARED_LIBRARY)
173
174endif