1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm
AUDIO_PLATFORM := $(TARGET_BOARD_PLATFORM)
ifneq ($(filter msm8974 msm8226 msm8610 apq8084,$(TARGET_BOARD_PLATFORM)),)
# B-family platform uses msm8974 code base
AUDIO_PLATFORM = msm8974
MULTIPLE_HW_VARIANTS_ENABLED := true
ifneq ($(filter msm8610,$(TARGET_BOARD_PLATFORM)),)
LOCAL_CFLAGS := -DPLATFORM_MSM8610
endif
ifneq ($(filter msm8226,$(TARGET_BOARD_PLATFORM)),)
LOCAL_CFLAGS := -DPLATFORM_MSM8x26
endif
ifneq ($(filter apq8084,$(TARGET_BOARD_PLATFORM)),)
LOCAL_CFLAGS := -DPLATFORM_APQ8084
endif
endif
ifneq ($(filter msm8960,$(TARGET_BOARD_PLATFORM)),)
# A-family platform uses msm8960 code base
AUDIO_PLATFORM = msm8960
endif
LOCAL_SRC_FILES := \
audio_hw.c \
voice.c \
platform_info.c \
$(AUDIO_PLATFORM)/platform.c
LOCAL_SRC_FILES += audio_extn/audio_extn.c
LOCAL_HEADER_LIBRARIES := generated_kernel_headers
ifeq ($(strip $(AUDIO_USE_LL_AS_PRIMARY_OUTPUT)),true)
LOCAL_CFLAGS += -DUSE_LL_AS_PRIMARY_OUTPUT
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PCM_OFFLOAD)),true)
LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_ANC_HEADSET)),true)
LOCAL_CFLAGS += -DANC_HEADSET_ENABLED
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FLUENCE)),true)
LOCAL_CFLAGS += -DFLUENCE_ENABLED
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PROXY_DEVICE)),true)
LOCAL_CFLAGS += -DAFE_PROXY_ENABLED
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FM_POWER_OPT)),true)
LOCAL_CFLAGS += -DFM_POWER_OPT
LOCAL_SRC_FILES += audio_extn/fm.c
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_USBAUDIO)),true)
LOCAL_CFLAGS += -DUSB_HEADSET_ENABLED
LOCAL_SRC_FILES += audio_extn/usb.c
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HFP)),true)
LOCAL_CFLAGS += -DHFP_ENABLED
LOCAL_SRC_FILES += audio_extn/hfp.c
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_CUSTOMSTEREO)),true)
LOCAL_CFLAGS += -DCUSTOM_STEREO_ENABLED
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SSR)),true)
LOCAL_CFLAGS += -DSSR_ENABLED
LOCAL_SRC_FILES += audio_extn/ssr.c
LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/surround_sound/
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS)),true)
LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
LOCAL_SRC_FILES += voice_extn/voice_extn.c
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INCALL_MUSIC)),true)
LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED
endif
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_VOIP)),true)
LOCAL_CFLAGS += -DCOMPRESS_VOIP_ENABLED
LOCAL_SRC_FILES += voice_extn/compress_voip.c
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true)
LOCAL_CFLAGS += -DSPKR_PROT_ENABLED
LOCAL_SRC_FILES += audio_extn/spkr_protection.c
endif
ifdef MULTIPLE_HW_VARIANTS_ENABLED
LOCAL_CFLAGS += -DHW_VARIANTS_ENABLED
LOCAL_SRC_FILES += $(AUDIO_PLATFORM)/hw_info.c
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_COMPRESS_CAPTURE)),true)
LOCAL_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED
LOCAL_SRC_FILES += audio_extn/compress_capture.c
endif
ifeq ($(strip $(DOLBY_DDP)),true)
LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
LOCAL_SRC_FILES += audio_extn/dolby.c
endif
ifeq ($(strip $(DOLBY_DAP)),true)
LOCAL_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
ifneq ($(strip $(DOLBY_DDP)),true)
LOCAL_SRC_FILES += audio_extn/dolby.c
endif
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LOW_LATENCY_CAPTURE)),true)
LOCAL_CFLAGS += -DLOW_LATENCY_CAPTURE_USE_CASE=1
endif
ifeq ($(strip $(BOARD_HAVE_NEW_QCOM_CSDCLIENT)),true)
LOCAL_CFLAGS += -DNEW_CSDCLIENT
endif
ifeq ($(strip $(BOARD_HAVE_HTC_CSDCLIENT)),true)
LOCAL_CFLAGS += -DHTC_CSDCLIENT
endif
ifeq ($(strip $(BOARD_HAVE_SAMSUNG_CSDCLIENT)),true)
LOCAL_CFLAGS += -DSAMSUNG_CSDCLIENT
endif
ifeq ($(strip $(BOARD_USES_MOTOROLA_EMU_AUDIO)),true)
LOCAL_CFLAGS += -DDOCK_SUPPORT -DMOTOROLA_EMU_AUDIO
endif
ifeq ($(strip $(BOARD_HAVE_SAMSUNG_AUDIO)),true)
LOCAL_CFLAGS += -DDOCK_SUPPORT
endif
ifeq ($(strip $(BOARD_FUSION3_PLATFORM)),true)
LOCAL_CFLAGS += -DFUSION3_PLATFORM
endif
LOCAL_SHARED_LIBRARIES := \
liblog \
libcutils \
libhardware \
libtinyalsa \
libtinycompress \
libaudioroute \
libdl \
libexpat
LOCAL_C_INCLUDES += \
external/tinyalsa/include \
external/tinycompress/include \
external/expat/lib \
$(call include-path-for, audio-route) \
$(call include-path-for, audio-effects) \
$(LOCAL_PATH)/$(AUDIO_PLATFORM) \
$(LOCAL_PATH)/audio_extn \
$(LOCAL_PATH)/voice_extn
LOCAL_HEADER_LIBRARIES := libhardware_headers
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_LISTEN)),true)
LOCAL_CFLAGS += -DAUDIO_LISTEN_ENABLED
LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-listen
LOCAL_SRC_FILES += audio_extn/listen.c
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_AUXPCM_BT)),true)
LOCAL_CFLAGS += -DAUXPCM_BT_ENABLED
endif
ifeq ($(strip $(AUDIO_FEATURE_PCM_IOCTL_ENABLED)),true)
LOCAL_CFLAGS += -DPCM_IOCTL_ENABLED
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HWDEP_CAL)),true)
LOCAL_CFLAGS += -DHWDEP_CAL_ENABLED
endif
LOCAL_CLANG_CFLAGS += -Wno-unused-variable -Wno-unused-function -Wno-missing-field-initializers
LOCAL_COPY_HEADERS_TO := mm-audio
LOCAL_COPY_HEADERS := audio_extn/audio_defs.h
LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_MODULE_TAGS := optional
LOCAL_VENDOR_MODULE := true
LOCAL_CFLAGS += -Werror
include $(BUILD_SHARED_LIBRARY)
endif
|