Merge "audio: audio encoder/decoder enhancement"
diff --git a/Android.mk b/Android.mk
index c3d6aae..ea7ec2d 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,4 +1,4 @@
-ifneq ($(filter msm8960 msm8226 msm8x26 msm8974 msm8x74,$(TARGET_BOARD_PLATFORM)),)
+ifneq ($(filter msm8960 msm8226 msm8x26 msm8610 msm8974 msm8x74,$(TARGET_BOARD_PLATFORM)),)
MY_LOCAL_PATH := $(call my-dir)
diff --git a/hal/Android.mk b/hal/Android.mk
index 7c71b97..71e6d5a 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -7,9 +7,12 @@
LOCAL_ARM_MODE := arm
AUDIO_PLATFORM := $(TARGET_BOARD_PLATFORM)
-ifneq ($(filter msm8974 msm8226,$(TARGET_BOARD_PLATFORM)),)
+ifneq ($(filter msm8974 msm8226 msm8610,$(TARGET_BOARD_PLATFORM)),)
# B-family platform uses msm8974 code base
AUDIO_PLATFORM = msm8974
+ifneq ($(filter msm8610,$(TARGET_BOARD_PLATFORM)),)
+ LOCAL_CFLAGS := -DPLATFORM_MSM8610
+endif
endif
LOCAL_SRC_FILES := \
@@ -30,7 +33,7 @@
$(call include-path-for, audio-effects) \
$(LOCAL_PATH)/$(AUDIO_PLATFORM)
-LOCAL_MODULE := audio.primary.$(AUDIO_PLATFORM)
+LOCAL_MODULE := audio.primary.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 5702f37..ecb6245 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -26,6 +26,7 @@
/* Flags used to initialize acdb_settings variable that goes to ACDB library */
#define DMIC_FLAG 0x00000002
+#define QMIC_FLAG 0x00000004
#define TTY_MODE_OFF 0x00000010
#define TTY_MODE_FULL 0x00000020
#define TTY_MODE_VCO 0x00000040
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index e533f33..a24ca83 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -29,10 +29,6 @@
#define LIB_ACDB_LOADER "libacdbloader.so"
#define LIB_CSD_CLIENT "libcsd-client.so"
-#define DUALMIC_CONFIG_NONE 0 /* Target does not contain 2 mics */
-#define DUALMIC_CONFIG_ENDFIRE 1
-#define DUALMIC_CONFIG_BROADSIDE 2
-
/*
* This is the sysfs path for the HDMI audio data block
*/
@@ -80,6 +76,7 @@
bool fluence_in_spkr_mode;
bool fluence_in_voice_call;
bool fluence_in_voice_rec;
+ int fluence_type;
int dualmic_config;
void *acdb_handle;
@@ -140,19 +137,15 @@
[SND_DEVICE_IN_HDMI_MIC] = "hdmi-mic",
[SND_DEVICE_IN_BT_SCO_MIC] = "bt-sco-mic",
[SND_DEVICE_IN_CAMCORDER_MIC] = "camcorder-mic",
- [SND_DEVICE_IN_VOICE_DMIC_EF] = "voice-dmic-ef",
- [SND_DEVICE_IN_VOICE_DMIC_BS] = "voice-dmic-bs",
- [SND_DEVICE_IN_VOICE_DMIC_EF_TMUS] = "voice-dmic-ef-tmus",
- [SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF] = "voice-speaker-dmic-ef",
- [SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS] = "voice-speaker-dmic-bs",
+ [SND_DEVICE_IN_VOICE_DMIC] = "voice-dmic-ef",
+ [SND_DEVICE_IN_VOICE_DMIC_TMUS] = "voice-dmic-ef-tmus",
+ [SND_DEVICE_IN_VOICE_SPEAKER_DMIC] = "voice-speaker-dmic-ef",
[SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC] = "voice-tty-full-headset-mic",
[SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC] = "voice-tty-vco-handset-mic",
[SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC] = "voice-tty-hco-headset-mic",
[SND_DEVICE_IN_VOICE_REC_MIC] = "voice-rec-mic",
- [SND_DEVICE_IN_VOICE_REC_DMIC_EF] = "voice-rec-dmic-ef",
- [SND_DEVICE_IN_VOICE_REC_DMIC_BS] = "voice-rec-dmic-bs",
- [SND_DEVICE_IN_VOICE_REC_DMIC_EF_FLUENCE] = "voice-rec-dmic-ef-fluence",
- [SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE] = "voice-rec-dmic-bs-fluence",
+ [SND_DEVICE_IN_VOICE_REC_DMIC] = "voice-rec-dmic-ef",
+ [SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE] = "voice-rec-dmic-ef-fluence",
};
/* ACDB IDs (audio DSP path configuration IDs) for each sound device */
@@ -184,20 +177,16 @@
[SND_DEVICE_IN_HDMI_MIC] = 4,
[SND_DEVICE_IN_BT_SCO_MIC] = 21,
[SND_DEVICE_IN_CAMCORDER_MIC] = 61,
- [SND_DEVICE_IN_VOICE_DMIC_EF] = 6,
- [SND_DEVICE_IN_VOICE_DMIC_BS] = 5,
- [SND_DEVICE_IN_VOICE_DMIC_EF_TMUS] = 91,
- [SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF] = 13,
- [SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS] = 12,
+ [SND_DEVICE_IN_VOICE_DMIC] = 6,
+ [SND_DEVICE_IN_VOICE_DMIC_TMUS] = 91,
+ [SND_DEVICE_IN_VOICE_SPEAKER_DMIC] = 13,
[SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC] = 16,
[SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC] = 36,
[SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC] = 16,
[SND_DEVICE_IN_VOICE_REC_MIC] = 62,
/* TODO: Update with proper acdb ids */
- [SND_DEVICE_IN_VOICE_REC_DMIC_EF] = 62,
- [SND_DEVICE_IN_VOICE_REC_DMIC_BS] = 62,
- [SND_DEVICE_IN_VOICE_REC_DMIC_EF_FLUENCE] = 6,
- [SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE] = 5,
+ [SND_DEVICE_IN_VOICE_REC_DMIC] = 62,
+ [SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE] = 6,
};
static pthread_once_t check_op_once_ctl = PTHREAD_ONCE_INIT;
@@ -265,33 +254,33 @@
my_data = calloc(1, sizeof(struct platform_data));
my_data->adev = adev;
- my_data->dualmic_config = DUALMIC_CONFIG_NONE;
my_data->fluence_in_spkr_mode = false;
my_data->fluence_in_voice_call = false;
my_data->fluence_in_voice_rec = false;
+ my_data->fluence_type = FLUENCE_NONE;
- property_get("persist.audio.dualmic.config",value,"");
- if (!strcmp("broadside", value)) {
- my_data->dualmic_config = DUALMIC_CONFIG_BROADSIDE;
- adev->acdb_settings |= DMIC_FLAG;
- } else if (!strcmp("endfire", value)) {
- my_data->dualmic_config = DUALMIC_CONFIG_ENDFIRE;
- adev->acdb_settings |= DMIC_FLAG;
+ property_get("ro.qc.sdk.audio.fluencetype", value, "");
+ if (!strncmp("fluencepro", value, sizeof("fluencepro"))) {
+ my_data->fluence_type = FLUENCE_QUAD_MIC;
+ } else if (!strncmp("fluence", value, sizeof("fluence"))) {
+ my_data->fluence_type = FLUENCE_DUAL_MIC;
+ } else {
+ my_data->fluence_type = FLUENCE_NONE;
}
- if (my_data->dualmic_config != DUALMIC_CONFIG_NONE) {
+ if (my_data->fluence_type != FLUENCE_NONE) {
property_get("persist.audio.fluence.voicecall",value,"");
- if (!strcmp("true", value)) {
+ if (!strncmp("true", value, sizeof("true"))) {
my_data->fluence_in_voice_call = true;
}
property_get("persist.audio.fluence.voicerec",value,"");
- if (!strcmp("true", value)) {
+ if (!strncmp("true", value, sizeof("true"))) {
my_data->fluence_in_voice_rec = true;
}
property_get("persist.audio.fluence.speaker",value,"");
- if (!strcmp("true", value)) {
+ if (!strncmp("true", value, sizeof("true"))) {
my_data->fluence_in_spkr_mode = true;
}
}
@@ -683,30 +672,31 @@
}
if (out_device & AUDIO_DEVICE_OUT_EARPIECE ||
out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) {
- if (my_data->fluence_in_voice_call == false) {
+ if (my_data->fluence_type == FLUENCE_NONE ||
+ my_data->fluence_in_voice_call == false) {
snd_device = SND_DEVICE_IN_HANDSET_MIC;
} else {
- if (my_data->dualmic_config == DUALMIC_CONFIG_ENDFIRE) {
- if (is_operator_tmus())
- snd_device = SND_DEVICE_IN_VOICE_DMIC_EF_TMUS;
- else
- snd_device = SND_DEVICE_IN_VOICE_DMIC_EF;
- } else if(my_data->dualmic_config == DUALMIC_CONFIG_BROADSIDE)
- snd_device = SND_DEVICE_IN_VOICE_DMIC_BS;
+ if (is_operator_tmus())
+ snd_device = SND_DEVICE_IN_VOICE_DMIC_TMUS;
else
- snd_device = SND_DEVICE_IN_HANDSET_MIC;
+ snd_device = SND_DEVICE_IN_VOICE_DMIC;
+ adev->acdb_settings |= DMIC_FLAG;
}
} else if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET) {
snd_device = SND_DEVICE_IN_VOICE_HEADSET_MIC;
} else if (out_device & AUDIO_DEVICE_OUT_ALL_SCO) {
snd_device = SND_DEVICE_IN_BT_SCO_MIC ;
} else if (out_device & AUDIO_DEVICE_OUT_SPEAKER) {
- if (my_data->fluence_in_voice_call && my_data->fluence_in_spkr_mode &&
- my_data->dualmic_config == DUALMIC_CONFIG_ENDFIRE) {
- snd_device = SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF;
- } else if (my_data->fluence_in_voice_call && my_data->fluence_in_spkr_mode &&
- my_data->dualmic_config == DUALMIC_CONFIG_BROADSIDE) {
- snd_device = SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS;
+ if (my_data->fluence_type != FLUENCE_NONE &&
+ my_data->fluence_in_voice_call &&
+ my_data->fluence_in_spkr_mode) {
+ if(my_data->fluence_type == FLUENCE_DUAL_MIC) {
+ adev->acdb_settings |= DMIC_FLAG;
+ snd_device = SND_DEVICE_IN_VOICE_SPEAKER_DMIC;
+ } else {
+ adev->acdb_settings |= QMIC_FLAG;
+ snd_device = SND_DEVICE_IN_VOICE_SPEAKER_QMIC;
+ }
} else {
snd_device = SND_DEVICE_IN_VOICE_SPEAKER_MIC;
}
@@ -718,21 +708,15 @@
}
} else if (source == AUDIO_SOURCE_VOICE_RECOGNITION) {
if (in_device & AUDIO_DEVICE_IN_BUILTIN_MIC) {
- if (my_data->dualmic_config == DUALMIC_CONFIG_ENDFIRE) {
- if (channel_mask == AUDIO_CHANNEL_IN_FRONT_BACK)
- snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_EF;
- else if (my_data->fluence_in_voice_rec)
- snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_EF_FLUENCE;
- } else if (my_data->dualmic_config == DUALMIC_CONFIG_BROADSIDE) {
- if (channel_mask == AUDIO_CHANNEL_IN_FRONT_BACK)
- snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_BS;
- else if (my_data->fluence_in_voice_rec)
- snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE;
- }
+ if (channel_mask == AUDIO_CHANNEL_IN_FRONT_BACK)
+ snd_device = SND_DEVICE_IN_VOICE_REC_DMIC;
+ else if (my_data->fluence_in_voice_rec)
+ snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE;
- if (snd_device == SND_DEVICE_NONE) {
+ if (snd_device == SND_DEVICE_NONE)
snd_device = SND_DEVICE_IN_VOICE_REC_MIC;
- }
+ else
+ adev->acdb_settings |= DMIC_FLAG;
}
} else if (source == AUDIO_SOURCE_VOICE_COMMUNICATION) {
if (out_device & AUDIO_DEVICE_OUT_SPEAKER)
diff --git a/hal/msm8960/platform.h b/hal/msm8960/platform.h
index 4bc5003..f09b9b1 100644
--- a/hal/msm8960/platform.h
+++ b/hal/msm8960/platform.h
@@ -17,6 +17,12 @@
#ifndef QCOM_AUDIO_PLATFORM_H
#define QCOM_AUDIO_PLATFORM_H
+enum {
+ FLUENCE_NONE,
+ FLUENCE_DUAL_MIC,
+ FLUENCE_QUAD_MIC
+};
+
/*
* Below are the devices for which is back end is same, SLIMBUS_0_RX.
* All these devices are handled by the internal HW codec. We can
@@ -69,19 +75,16 @@
SND_DEVICE_IN_HDMI_MIC,
SND_DEVICE_IN_BT_SCO_MIC,
SND_DEVICE_IN_CAMCORDER_MIC,
- SND_DEVICE_IN_VOICE_DMIC_EF,
- SND_DEVICE_IN_VOICE_DMIC_BS,
- SND_DEVICE_IN_VOICE_DMIC_EF_TMUS,
- SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF,
- SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS,
+ SND_DEVICE_IN_VOICE_DMIC,
+ SND_DEVICE_IN_VOICE_DMIC_TMUS,
+ SND_DEVICE_IN_VOICE_SPEAKER_DMIC,
+ SND_DEVICE_IN_VOICE_SPEAKER_QMIC,
SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC,
SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC,
SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC,
SND_DEVICE_IN_VOICE_REC_MIC,
- SND_DEVICE_IN_VOICE_REC_DMIC_EF,
- SND_DEVICE_IN_VOICE_REC_DMIC_BS,
- SND_DEVICE_IN_VOICE_REC_DMIC_EF_FLUENCE,
- SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE,
+ SND_DEVICE_IN_VOICE_REC_DMIC,
+ SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE,
SND_DEVICE_IN_END,
SND_DEVICE_MAX = SND_DEVICE_IN_END,
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 8560f9d..3d13c7d 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -30,10 +30,6 @@
#define LIB_ACDB_LOADER "libacdbloader.so"
#define AUDIO_DATA_BLOCK_MIXER_CTL "HDMI EDID"
-#define DUALMIC_CONFIG_NONE 0 /* Target does not contain 2 mics */
-#define DUALMIC_CONFIG_ENDFIRE 1
-#define DUALMIC_CONFIG_BROADSIDE 2
-
/*
* This file will have a maximum of 38 bytes:
*
@@ -73,7 +69,7 @@
bool fluence_in_spkr_mode;
bool fluence_in_voice_call;
bool fluence_in_voice_rec;
- int dualmic_config;
+ int fluence_type;
void *acdb_handle;
acdb_init_t acdb_init;
@@ -83,12 +79,16 @@
};
static const int pcm_device_table[AUDIO_USECASE_MAX][2] = {
- [USECASE_AUDIO_PLAYBACK_DEEP_BUFFER] = {0, 0},
- [USECASE_AUDIO_PLAYBACK_LOW_LATENCY] = {15, 15},
- [USECASE_AUDIO_PLAYBACK_MULTI_CH] = {1, 1},
- [USECASE_AUDIO_RECORD] = {0, 0},
- [USECASE_AUDIO_RECORD_LOW_LATENCY] = {15, 15},
- [USECASE_VOICE_CALL] = {2, 2},
+ [USECASE_AUDIO_PLAYBACK_DEEP_BUFFER] = {DEEP_BUFFER_PCM_DEVICE,
+ DEEP_BUFFER_PCM_DEVICE},
+ [USECASE_AUDIO_PLAYBACK_LOW_LATENCY] = {LOWLATENCY_PCM_DEVICE,
+ LOWLATENCY_PCM_DEVICE},
+ [USECASE_AUDIO_PLAYBACK_MULTI_CH] = {MULTI_CHANNEL_PCM_DEVICE,
+ MULTI_CHANNEL_PCM_DEVICE},
+ [USECASE_AUDIO_RECORD] = {DEEP_BUFFER_PCM_DEVICE, DEEP_BUFFER_PCM_DEVICE},
+ [USECASE_AUDIO_RECORD_LOW_LATENCY] = {LOWLATENCY_PCM_DEVICE,
+ LOWLATENCY_PCM_DEVICE},
+ [USECASE_VOICE_CALL] = {VOICE_CALL_PCM_DEVICE, VOICE_CALL_PCM_DEVICE},
};
/* Array to store sound devices */
@@ -123,19 +123,15 @@
[SND_DEVICE_IN_HDMI_MIC] = "hdmi-mic",
[SND_DEVICE_IN_BT_SCO_MIC] = "bt-sco-mic",
[SND_DEVICE_IN_CAMCORDER_MIC] = "camcorder-mic",
- [SND_DEVICE_IN_VOICE_DMIC_EF] = "voice-dmic-ef",
- [SND_DEVICE_IN_VOICE_DMIC_BS] = "voice-dmic-bs",
- [SND_DEVICE_IN_VOICE_DMIC_EF_TMUS] = "voice-dmic-ef-tmus",
- [SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF] = "voice-speaker-dmic-ef",
- [SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS] = "voice-speaker-dmic-bs",
+ [SND_DEVICE_IN_VOICE_DMIC] = "voice-dmic-ef",
+ [SND_DEVICE_IN_VOICE_DMIC_TMUS] = "voice-dmic-ef-tmus",
+ [SND_DEVICE_IN_VOICE_SPEAKER_DMIC] = "voice-speaker-dmic-ef",
[SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC] = "voice-tty-full-headset-mic",
[SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC] = "voice-tty-vco-handset-mic",
[SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC] = "voice-tty-hco-headset-mic",
[SND_DEVICE_IN_VOICE_REC_MIC] = "voice-rec-mic",
- [SND_DEVICE_IN_VOICE_REC_DMIC_EF] = "voice-rec-dmic-ef",
- [SND_DEVICE_IN_VOICE_REC_DMIC_BS] = "voice-rec-dmic-bs",
- [SND_DEVICE_IN_VOICE_REC_DMIC_EF_FLUENCE] = "voice-rec-dmic-ef-fluence",
- [SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE] = "voice-rec-dmic-bs-fluence",
+ [SND_DEVICE_IN_VOICE_REC_DMIC] = "voice-rec-dmic-ef",
+ [SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE] = "voice-rec-dmic-ef-fluence",
};
/* ACDB IDs (audio DSP path configuration IDs) for each sound device */
@@ -168,20 +164,16 @@
[SND_DEVICE_IN_HDMI_MIC] = 4,
[SND_DEVICE_IN_BT_SCO_MIC] = 21,
[SND_DEVICE_IN_CAMCORDER_MIC] = 61,
- [SND_DEVICE_IN_VOICE_DMIC_EF] = 41,
- [SND_DEVICE_IN_VOICE_DMIC_BS] = 5,
- [SND_DEVICE_IN_VOICE_DMIC_EF_TMUS] = 89,
- [SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF] = 43,
- [SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS] = 12,
+ [SND_DEVICE_IN_VOICE_DMIC] = 41,
+ [SND_DEVICE_IN_VOICE_DMIC_TMUS] = 89,
+ [SND_DEVICE_IN_VOICE_SPEAKER_DMIC] = 43,
[SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC] = 16,
[SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC] = 36,
[SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC] = 16,
[SND_DEVICE_IN_VOICE_REC_MIC] = 62,
/* TODO: Update with proper acdb ids */
- [SND_DEVICE_IN_VOICE_REC_DMIC_EF] = 62,
- [SND_DEVICE_IN_VOICE_REC_DMIC_BS] = 62,
- [SND_DEVICE_IN_VOICE_REC_DMIC_EF_FLUENCE] = 6,
- [SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE] = 5,
+ [SND_DEVICE_IN_VOICE_REC_DMIC] = 62,
+ [SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE] = 6,
};
static pthread_once_t check_op_once_ctl = PTHREAD_ONCE_INIT;
@@ -272,33 +264,33 @@
my_data = calloc(1, sizeof(struct platform_data));
my_data->adev = adev;
- my_data->dualmic_config = DUALMIC_CONFIG_NONE;
my_data->fluence_in_spkr_mode = false;
my_data->fluence_in_voice_call = false;
my_data->fluence_in_voice_rec = false;
+ my_data->fluence_type = FLUENCE_NONE;
- property_get("persist.audio.dualmic.config",value,"");
- if (!strcmp("broadside", value)) {
- my_data->dualmic_config = DUALMIC_CONFIG_BROADSIDE;
- adev->acdb_settings |= DMIC_FLAG;
- } else if (!strcmp("endfire", value)) {
- my_data->dualmic_config = DUALMIC_CONFIG_ENDFIRE;
- adev->acdb_settings |= DMIC_FLAG;
+ property_get("ro.qc.sdk.audio.fluencetype", value, "");
+ if (!strncmp("fluencepro", value, sizeof("fluencepro"))) {
+ my_data->fluence_type = FLUENCE_QUAD_MIC;
+ } else if (!strncmp("fluence", value, sizeof("fluence"))) {
+ my_data->fluence_type = FLUENCE_DUAL_MIC;
+ } else {
+ my_data->fluence_type = FLUENCE_NONE;
}
- if (my_data->dualmic_config != DUALMIC_CONFIG_NONE) {
+ if (my_data->fluence_type != FLUENCE_NONE) {
property_get("persist.audio.fluence.voicecall",value,"");
- if (!strcmp("true", value)) {
+ if (!strncmp("true", value, sizeof("true"))) {
my_data->fluence_in_voice_call = true;
}
property_get("persist.audio.fluence.voicerec",value,"");
- if (!strcmp("true", value)) {
+ if (!strncmp("true", value, sizeof("true"))) {
my_data->fluence_in_voice_rec = true;
}
property_get("persist.audio.fluence.speaker",value,"");
- if (!strcmp("true", value)) {
+ if (!strncmp("true", value, sizeof("true"))) {
my_data->fluence_in_spkr_mode = true;
}
}
@@ -524,7 +516,7 @@
if (is_operator_tmus())
snd_device = SND_DEVICE_OUT_VOICE_HANDSET_TMUS;
else
- snd_device = SND_DEVICE_OUT_HANDSET;
+ snd_device = SND_DEVICE_OUT_VOICE_HANDSET;
}
if (snd_device != SND_DEVICE_NONE) {
goto exit;
@@ -620,30 +612,31 @@
}
if (out_device & AUDIO_DEVICE_OUT_EARPIECE ||
out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) {
- if (my_data->fluence_in_voice_call == false) {
+ if (my_data->fluence_type == FLUENCE_NONE ||
+ my_data->fluence_in_voice_call == false) {
snd_device = SND_DEVICE_IN_HANDSET_MIC;
} else {
- if (my_data->dualmic_config == DUALMIC_CONFIG_ENDFIRE) {
- if (is_operator_tmus())
- snd_device = SND_DEVICE_IN_VOICE_DMIC_EF_TMUS;
- else
- snd_device = SND_DEVICE_IN_VOICE_DMIC_EF;
- } else if(my_data->dualmic_config == DUALMIC_CONFIG_BROADSIDE)
- snd_device = SND_DEVICE_IN_VOICE_DMIC_BS;
+ if (is_operator_tmus())
+ snd_device = SND_DEVICE_IN_VOICE_DMIC_TMUS;
else
- snd_device = SND_DEVICE_IN_HANDSET_MIC;
+ snd_device = SND_DEVICE_IN_VOICE_DMIC;
+ adev->acdb_settings |= DMIC_FLAG;
}
} else if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET) {
snd_device = SND_DEVICE_IN_VOICE_HEADSET_MIC;
} else if (out_device & AUDIO_DEVICE_OUT_ALL_SCO) {
snd_device = SND_DEVICE_IN_BT_SCO_MIC ;
} else if (out_device & AUDIO_DEVICE_OUT_SPEAKER) {
- if (my_data->fluence_in_voice_call && my_data->fluence_in_spkr_mode &&
- my_data->dualmic_config == DUALMIC_CONFIG_ENDFIRE) {
- snd_device = SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF;
- } else if (my_data->fluence_in_voice_call && my_data->fluence_in_spkr_mode &&
- my_data->dualmic_config == DUALMIC_CONFIG_BROADSIDE) {
- snd_device = SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS;
+ if (my_data->fluence_type != FLUENCE_NONE &&
+ my_data->fluence_in_voice_call &&
+ my_data->fluence_in_spkr_mode) {
+ if(my_data->fluence_type == FLUENCE_DUAL_MIC) {
+ adev->acdb_settings |= DMIC_FLAG;
+ snd_device = SND_DEVICE_IN_VOICE_SPEAKER_DMIC;
+ } else {
+ adev->acdb_settings |= QMIC_FLAG;
+ snd_device = SND_DEVICE_IN_VOICE_SPEAKER_QMIC;
+ }
} else {
snd_device = SND_DEVICE_IN_VOICE_SPEAKER_MIC;
}
@@ -655,21 +648,15 @@
}
} else if (source == AUDIO_SOURCE_VOICE_RECOGNITION) {
if (in_device & AUDIO_DEVICE_IN_BUILTIN_MIC) {
- if (my_data->dualmic_config == DUALMIC_CONFIG_ENDFIRE) {
- if (channel_mask == AUDIO_CHANNEL_IN_FRONT_BACK)
- snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_EF;
- else if (my_data->fluence_in_voice_rec)
- snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_EF_FLUENCE;
- } else if (my_data->dualmic_config == DUALMIC_CONFIG_BROADSIDE) {
- if (channel_mask == AUDIO_CHANNEL_IN_FRONT_BACK)
- snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_BS;
- else if (my_data->fluence_in_voice_rec)
- snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE;
- }
+ if (channel_mask == AUDIO_CHANNEL_IN_FRONT_BACK)
+ snd_device = SND_DEVICE_IN_VOICE_REC_DMIC;
+ else if (my_data->fluence_in_voice_rec)
+ snd_device = SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE;
- if (snd_device == SND_DEVICE_NONE) {
+ if (snd_device == SND_DEVICE_NONE)
snd_device = SND_DEVICE_IN_VOICE_REC_MIC;
- }
+ else
+ adev->acdb_settings |= DMIC_FLAG;
}
} else if (source == AUDIO_SOURCE_VOICE_COMMUNICATION) {
if (out_device & AUDIO_DEVICE_OUT_SPEAKER)
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index a6b3c31..26d4a9f 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -17,6 +17,12 @@
#ifndef QCOM_AUDIO_PLATFORM_H
#define QCOM_AUDIO_PLATFORM_H
+enum {
+ FLUENCE_NONE,
+ FLUENCE_DUAL_MIC,
+ FLUENCE_QUAD_MIC
+};
+
/*
* Below are the devices for which is back end is same, SLIMBUS_0_RX.
* All these devices are handled by the internal HW codec. We can
@@ -70,19 +76,16 @@
SND_DEVICE_IN_HDMI_MIC,
SND_DEVICE_IN_BT_SCO_MIC,
SND_DEVICE_IN_CAMCORDER_MIC,
- SND_DEVICE_IN_VOICE_DMIC_EF,
- SND_DEVICE_IN_VOICE_DMIC_BS,
- SND_DEVICE_IN_VOICE_DMIC_EF_TMUS,
- SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF,
- SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS,
+ SND_DEVICE_IN_VOICE_DMIC,
+ SND_DEVICE_IN_VOICE_DMIC_TMUS,
+ SND_DEVICE_IN_VOICE_SPEAKER_DMIC,
+ SND_DEVICE_IN_VOICE_SPEAKER_QMIC,
SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC,
SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC,
SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC,
SND_DEVICE_IN_VOICE_REC_MIC,
- SND_DEVICE_IN_VOICE_REC_DMIC_EF,
- SND_DEVICE_IN_VOICE_REC_DMIC_BS,
- SND_DEVICE_IN_VOICE_REC_DMIC_EF_FLUENCE,
- SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE,
+ SND_DEVICE_IN_VOICE_REC_DMIC,
+ SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE,
SND_DEVICE_IN_END,
SND_DEVICE_MAX = SND_DEVICE_IN_END,
@@ -122,4 +125,14 @@
#define AUDIO_CAPTURE_PERIOD_DURATION_MSEC 20
#define AUDIO_CAPTURE_PERIOD_COUNT 2
+#define DEEP_BUFFER_PCM_DEVICE 0
+#define MULTI_CHANNEL_PCM_DEVICE 1
+#define VOICE_CALL_PCM_DEVICE 2
+
+#ifdef PLATFORM_MSM8610
+#define LOWLATENCY_PCM_DEVICE 12
+#else
+#define LOWLATENCY_PCM_DEVICE 15
+#endif
+
#endif // QCOM_AUDIO_PLATFORM_H