From 02317798dec329868318e75a83c7c654cf5200b3 Mon Sep 17 00:00:00 2001 From: Ravi Kumar Alamanda Date: Mon, 4 Mar 2013 20:56:50 -0800 Subject: [PATCH] qcom/audio/hal: Do not enable Fluence in speaker mode by default - Speaker volume is low during voice call. - Fluence is enabled by default even in speaker mode during voice call. Mako does not meet the spec for Fluence due to mics placement issue. - Fix the issue by not enabling Fluence in speaker mode. - If the device supports it, set the property to enable fluence. Bug: 8272345 Change-Id: I9c4726409c4eb8d39dfbbb2f47e3075a6f6d5cc3 --- hal/audio_hw.c | 10 ++++++++-- hal/audio_hw.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hal/audio_hw.c b/hal/audio_hw.c index b0afb0c5..1c1adb2d 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -530,10 +530,10 @@ static snd_device_t get_input_snd_device(struct audio_device *adev) } 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 (adev->fluence_in_voice_call && + if (adev->fluence_in_voice_call && adev->fluence_in_spkr_mode && adev->dualmic_config == DUALMIC_CONFIG_ENDFIRE) { snd_device = SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF; - } else if (adev->fluence_in_voice_call && + } else if (adev->fluence_in_voice_call && adev->fluence_in_spkr_mode && adev->dualmic_config == DUALMIC_CONFIG_BROADSIDE) { snd_device = SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS; } else { @@ -1959,6 +1959,7 @@ static void init_platform_data(struct audio_device *adev) char value[PROPERTY_VALUE_MAX]; adev->dualmic_config = DUALMIC_CONFIG_NONE; + adev->fluence_in_spkr_mode = false; adev->fluence_in_voice_call = false; adev->fluence_in_voice_rec = false; adev->mic_type_analog = false; @@ -1986,6 +1987,11 @@ static void init_platform_data(struct audio_device *adev) if (!strncmp("true", value, 4)) { adev->fluence_in_voice_rec = true; } + + property_get("persist.audio.fluence.speaker",value,""); + if (!strncmp("true", value, 4)) { + adev->fluence_in_spkr_mode = true; + } } adev->acdb_handle = dlopen(LIB_ACDB_LOADER, RTLD_NOW); diff --git a/hal/audio_hw.h b/hal/audio_hw.h index 0c4f5263..9a47389f 100644 --- a/hal/audio_hw.h +++ b/hal/audio_hw.h @@ -226,6 +226,7 @@ struct audio_device { int acdb_settings; bool mic_type_analog; + bool fluence_in_spkr_mode; bool fluence_in_voice_call; bool fluence_in_voice_rec; int dualmic_config;