summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk3
-rw-r--r--hal/Android.mk6
-rw-r--r--hal/audio_extn/dts_eagle.c6
-rw-r--r--hal/audio_extn/sound_trigger_prop_intf.h66
-rw-r--r--hal/audio_hw.c2
-rw-r--r--hal/msm8960/platform.c6
-rw-r--r--hal/msm8974/platform.c17
-rw-r--r--hal/platform_api.h1
-rw-r--r--hal/platform_info.c48
-rw-r--r--policy_hal/Android.mk1
-rw-r--r--post_proc/Android.mk5
-rw-r--r--post_proc/volume_listener.c7
-rw-r--r--qahw_api/Android.mk2
13 files changed, 161 insertions, 9 deletions
diff --git a/Android.mk b/Android.mk
index 2f4054f7..60bb0db6 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,3 +1,5 @@
+ifeq ($(call my-dir),$(call project-path-for,qcom-audio))
+
ifneq ($(filter mpq8092 msm8960 msm8226 msm8x26 msm8610 msm8974 msm8x74 apq8084 msm8916 msm8994 msm8992 msm8909 msm8996 msm8952 msm8937 thorium msm8953 msmgold msm8998 sdm660 sdm845 apq8098_latv,$(TARGET_BOARD_PLATFORM)),)
MY_LOCAL_PATH := $(call my-dir)
@@ -23,3 +25,4 @@ include $(MY_LOCAL_PATH)/audiod/Android.mk
endif
endif
+endif
diff --git a/hal/Android.mk b/hal/Android.mk
index a9d334be..ff2dd411 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -183,6 +183,11 @@ ifneq ($(strip $(DOLBY_DDP)),true)
endif
endif
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD)),true)
+ LOCAL_CFLAGS += -DFLAC_OFFLOAD_ENABLED
+ LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
+endif
+
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER)),true)
LOCAL_CFLAGS += -DFLAC_OFFLOAD_ENABLED
LOCAL_CFLAGS += -DCOMPRESS_METADATA_NEEDED
@@ -368,6 +373,7 @@ ifeq ($(strip $($AUDIO_FEATURE_IP_HDLR_ENABLED)),true)
endif
LOCAL_CFLAGS += -Wall -Werror
+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
diff --git a/hal/audio_extn/dts_eagle.c b/hal/audio_extn/dts_eagle.c
index 7ae760b6..53e0e37d 100644
--- a/hal/audio_extn/dts_eagle.c
+++ b/hal/audio_extn/dts_eagle.c
@@ -60,7 +60,7 @@ static int32_t mDevices = 0;
static int32_t mCurrDevice = 0;
static const char* DTS_EAGLE_STR = DTS_EAGLE_KEY;
-static int do_DTS_Eagle_params_stream(struct stream_out *out, struct dts_eagle_param_desc_alsa *t, bool get) {
+static int do_DTS_Eagle_params_stream(const struct stream_out *out, struct dts_eagle_param_desc_alsa *t, bool get) {
char mixer_string[128];
char mixer_str_query[128];
struct mixer_ctl *ctl;
@@ -315,7 +315,7 @@ void audio_extn_dts_eagle_set_parameters(struct audio_device *adev, struct str_p
}
if (dts_found && count > 1 && size != (int)(count * sizeof(int))) {
- ALOGE("DTS_EAGLE_HAL (%s): size/count mismatch (size = %i bytes, count = %i integers / %u bytes).", __func__, size, count, count*sizeof(int));
+ ALOGE("DTS_EAGLE_HAL (%s): size/count mismatch (size = %i bytes, count = %i integers / %lu bytes).", __func__, size, count, (long unsigned int)count*sizeof(int));
} else if (dts_found) {
ALOGI("DTS_EAGLE_HAL (%s): param detected: %s", __func__, str_parms_to_str(parms));
if (!(*t))
@@ -397,7 +397,7 @@ int audio_extn_dts_eagle_get_parameters(const struct audio_device *adev,
if (dts_found) {
ALOGI("DTS_EAGLE_HAL (%s): param (get) detected: %s", __func__, str_parms_to_str(query));
- struct dts_eagle_param_desc_alsa *t = (struct dts_eagle_param_desc_alsa *)params;
+ struct dts_eagle_param_desc_alsa *t = (void *)params;
if (t) {
char buf[chars_4_int*count];
t->alsa_effect_ID = DTS_EAGLE_MODULE;
diff --git a/hal/audio_extn/sound_trigger_prop_intf.h b/hal/audio_extn/sound_trigger_prop_intf.h
new file mode 100644
index 00000000..bde563f5
--- /dev/null
+++ b/hal/audio_extn/sound_trigger_prop_intf.h
@@ -0,0 +1,66 @@
+/*
+ * Extrapolated / reversed header for Sound Trigger
+ */
+
+#ifndef SOUND_TRIGGER_PROP_INTF_H
+#define SOUND_TRIGGER_PROP_INTF_H
+
+struct sound_trigger_session_info {
+ int capture_handle;
+ void* p_ses;
+ struct pcm_config config;
+};
+
+enum audio_event_type {
+ AUDIO_EVENT_CAPTURE_DEVICE_INACTIVE,
+ AUDIO_EVENT_CAPTURE_DEVICE_ACTIVE,
+ AUDIO_EVENT_PLAYBACK_STREAM_INACTIVE,
+ AUDIO_EVENT_PLAYBACK_STREAM_ACTIVE,
+ AUDIO_EVENT_STOP_LAB,
+ AUDIO_EVENT_SSR,
+ AUDIO_EVENT_NUM_ST_SESSIONS,
+ AUDIO_EVENT_READ_SAMPLES,
+ AUDIO_EVENT_DEVICE_CONNECT,
+ AUDIO_EVENT_DEVICE_DISCONNECT,
+ AUDIO_EVENT_SVA_EXEC_MODE,
+ AUDIO_EVENT_SVA_EXEC_MODE_STATUS,
+};
+
+enum sound_trigger_event_type {
+ ST_EVENT_SESSION_REGISTER,
+ ST_EVENT_SESSION_DEREGISTER
+};
+typedef enum sound_trigger_event_type sound_trigger_event_type_t;
+
+enum ssr_event_status {
+ SND_CARD_STATUS_OFFLINE,
+ SND_CARD_STATUS_ONLINE,
+ CPE_STATUS_OFFLINE,
+ CPE_STATUS_ONLINE
+};
+
+struct sound_trigger_event_info {
+ struct sound_trigger_session_info st_ses;
+};
+typedef struct sound_trigger_event_info sound_trigger_event_info_t;
+
+struct audio_read_samples_info {
+ struct sound_trigger_session_info *ses_info;
+ void *buf;
+ size_t num_bytes;
+};
+
+struct audio_event_info {
+ union {
+ enum ssr_event_status status;
+ int value;
+ void *str_value;
+ struct sound_trigger_session_info ses_info;
+ struct audio_read_samples_info aud_info;
+ }u;
+};
+typedef struct audio_event_info audio_event_info_t;
+
+typedef int (*sound_trigger_hw_call_back_t)(enum audio_event_type,
+ struct audio_event_info*);
+#endif
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 6c04558b..77050bab 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -6409,6 +6409,7 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
in->config.channels = channel_count;
in->config.rate = config->sample_rate;
in->sample_rate = config->sample_rate;
+#ifdef SSR_ENABLED
} else if (!audio_extn_check_and_set_multichannel_usecase(adev,
in, config, &channel_mask_updated)) {
if (channel_mask_updated == true) {
@@ -6418,6 +6419,7 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
goto err_open;
}
ALOGD("%s: created surround sound session succesfully",__func__);
+#endif
} else if (audio_extn_compr_cap_enabled() &&
audio_extn_compr_cap_format_supported(config->format) &&
(in->dev->mode != AUDIO_MODE_IN_COMMUNICATION)) {
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index 43aeaed6..a208def5 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -1219,6 +1219,12 @@ void platform_set_gsm_mode(void *platform __unused, bool enable __unused)
ALOGE("%s: Not implemented", __func__);
}
+int platform_set_snd_device_name(snd_device_t snd_device __unused,
+ const char * name __unused)
+{
+ return -ENOSYS;
+}
+
bool platform_can_enable_spkr_prot_on_device(snd_device_t snd_device __unused)
{
/* speaker protection not implemented for this platform*/
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 0b2f21de..0764d67e 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -379,7 +379,7 @@ static int pcm_device_table[AUDIO_USECASE_MAX][2] = {
};
/* Array to store sound devices */
-static const char * const device_table[SND_DEVICE_MAX] = {
+static const char * device_table[SND_DEVICE_MAX] = {
[SND_DEVICE_NONE] = "none",
/* Playback sound devices */
[SND_DEVICE_OUT_HANDSET] = "handset",
@@ -6935,6 +6935,21 @@ done:
return ret;
}
+int platform_set_snd_device_name(snd_device_t device, const char *name)
+{
+ int ret = 0;
+
+ if ((device < SND_DEVICE_MIN) || (device >= SND_DEVICE_MAX)) {
+ ALOGE("%s:: Invalid snd_device = %d", __func__, device);
+ ret = -EINVAL;
+ goto done;
+ }
+
+ device_table[device] = strdup(name);
+done:
+ return ret;
+}
+
int platform_set_sidetone(struct audio_device *adev,
snd_device_t out_snd_device,
bool enable,
diff --git a/hal/platform_api.h b/hal/platform_api.h
index 6f8cf7e1..90ae1a84 100644
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -145,6 +145,7 @@ int platform_set_snd_device_backend(snd_device_t snd_device, const char * backen
const char * hw_interface);
int platform_get_snd_device_backend_index(snd_device_t device);
const char * platform_get_snd_device_backend_interface(snd_device_t device);
+int platform_set_snd_device_name(snd_device_t snd_device, const char * name);
/* From platform_info.c */
int platform_info_init(const char *filename, void *, caller_t);
diff --git a/hal/platform_info.c b/hal/platform_info.c
index 597d1f76..36a8c948 100644
--- a/hal/platform_info.c
+++ b/hal/platform_info.c
@@ -59,6 +59,7 @@ typedef enum {
CONFIG_PARAMS,
GAIN_LEVEL_MAPPING,
ACDB_METAINFO_KEY,
+ DEVICE_NAME,
} section_t;
typedef void (* section_process_fn)(const XML_Char **attr);
@@ -72,6 +73,7 @@ static void process_config_params(const XML_Char **attr);
static void process_root(const XML_Char **attr);
static void process_gain_db_to_level_map(const XML_Char **attr);
static void process_acdb_metainfo_key(const XML_Char **attr);
+static void process_device_name(const XML_Char **attr);
static section_process_fn section_table[] = {
[ROOT] = process_root,
@@ -83,6 +85,7 @@ static section_process_fn section_table[] = {
[CONFIG_PARAMS] = process_config_params,
[GAIN_LEVEL_MAPPING] = process_gain_db_to_level_map,
[ACDB_METAINFO_KEY] = process_acdb_metainfo_key,
+ [DEVICE_NAME] = process_device_name,
};
static section_t section;
@@ -122,6 +125,11 @@ static struct platform_info my_data;
* ...
* ...
* </config_params>
+ * <device_names>
+ * <device name="???" alias="???"/>
+ * ...
+ * ...
+ * </device_names>
* </audio_platform_info>
*/
@@ -398,6 +406,38 @@ done:
return;
}
+static void process_device_name(const XML_Char **attr)
+{
+ int index;
+
+ if (strcmp(attr[0], "name") != 0) {
+ ALOGE("%s: 'name' not found, no alias set!", __func__);
+ goto done;
+ }
+
+ index = platform_get_snd_device_index((char *)attr[1]);
+ if (index < 0) {
+ ALOGE("%s: Device %s in platform info xml not found, no alias set!",
+ __func__, attr[1]);
+ goto done;
+ }
+
+ if (strcmp(attr[2], "alias") != 0) {
+ ALOGE("%s: Device %s in platform info xml has no alias, no alias set!",
+ __func__, attr[1]);
+ goto done;
+ }
+
+ if (platform_set_snd_device_name(index, attr[3]) < 0) {
+ ALOGE("%s: Device %s, alias %s was not set!",
+ __func__, attr[1], attr[3]);
+ goto done;
+ }
+
+done:
+ return;
+}
+
static void start_tag(void *userdata __unused, const XML_Char *tag_name,
const XML_Char **attr)
{
@@ -430,10 +470,12 @@ static void start_tag(void *userdata __unused, const XML_Char *tag_name,
section = GAIN_LEVEL_MAPPING;
} else if(strcmp(tag_name, "acdb_metainfo_key") == 0) {
section = ACDB_METAINFO_KEY;
+ } else if (strcmp(tag_name, "device_names") == 0) {
+ section = DEVICE_NAME;
} else if (strcmp(tag_name, "device") == 0) {
if ((section != ACDB) && (section != BACKEND_NAME) && (section != BITWIDTH) &&
- (section != INTERFACE_NAME)) {
- ALOGE("device tag only supported for acdb/backend names/bitwitdh/interface names");
+ (section != INTERFACE_NAME) && (section != DEVICE_NAME)) {
+ ALOGE("device tag only supported for acdb/backend names/bitwidth/interface/device names");
return;
}
@@ -492,6 +534,8 @@ static void end_tag(void *userdata __unused, const XML_Char *tag_name)
section = ROOT;
} else if (strcmp(tag_name, "acdb_metainfo_key") == 0) {
section = ROOT;
+ } else if (strcmp(tag_name, "device_names") == 0) {
+ section = ROOT;
}
}
diff --git a/policy_hal/Android.mk b/policy_hal/Android.mk
index 0efe8d26..c49d1c87 100644
--- a/policy_hal/Android.mk
+++ b/policy_hal/Android.mk
@@ -42,6 +42,7 @@ LOCAL_STATIC_LIBRARIES := \
libmedia_helper \
LOCAL_CFLAGS += -Wall -Werror
+LOCAL_CLANG_CFLAGS += -Wno-overloaded-virtual -Wno-unused-variable -Wno-unused-private-field
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_VOICE_CONCURRENCY)),true)
LOCAL_CFLAGS += -DVOICE_CONCURRENCY
diff --git a/post_proc/Android.mk b/post_proc/Android.mk
index e9869de2..3b967b25 100644
--- a/post_proc/Android.mk
+++ b/post_proc/Android.mk
@@ -108,17 +108,18 @@ LOCAL_MODULE:= libvolumelistener
LOCAL_VENDOR_MODULE := true
LOCAL_C_INCLUDES := \
- hardware/qcom/audio/hal \
+ $(call project-path-for,qcom-audio)/hal \
$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include \
external/tinyalsa/include \
$(call include-path-for, audio-effects) \
$(call include-path-for, audio-route) \
- hardware/qcom/audio/hal/audio_extn \
+ $(call project-path-for,qcom-audio)/hal/audio_extn \
external/tinycompress/include
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/techpack/audio/include
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
+LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
include $(BUILD_SHARED_LIBRARY)
diff --git a/post_proc/volume_listener.c b/post_proc/volume_listener.c
index a8c2c530..ff66d1a2 100644
--- a/post_proc/volume_listener.c
+++ b/post_proc/volume_listener.c
@@ -826,7 +826,14 @@ static int vol_prc_lib_get_descriptor(const effect_uuid_t *uuid,
effect_descriptor_t *descriptor)
{
int i = 0;
+
+ if (property_get_bool("vendor.audio.vol_based_mbdrc.enabled", 0)) {
+ ALOGW("Volume based MBDRC not enabled ... bailingout");
+ return -EINVAL;
+ }
+
ALOGV("%s Called ", __func__);
+
if (lib_init() != 0) {
return init_status;
}
diff --git a/qahw_api/Android.mk b/qahw_api/Android.mk
index ee06a30f..ce63f355 100644
--- a/qahw_api/Android.mk
+++ b/qahw_api/Android.mk
@@ -39,5 +39,5 @@ LOCAL_PRELINK_MODULE := false
include $(BUILD_SHARED_LIBRARY)
#test app compilation
-include $(LOCAL_PATH)/test/Android.mk
+#include $(LOCAL_PATH)/test/Android.mk
endif