summaryrefslogtreecommitdiffstats
path: root/hal
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-05-04 10:53:03 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2014-05-04 10:53:03 -0700
commit619fd2bf17e556392bfca13e2c12c6e81565b50c (patch)
tree73bdb04204f4f3a23a31dcf08bab8172356b3552 /hal
parentdb7a77055a96dc36133e4dce79ea790df5a423e0 (diff)
parent4980fa1f8f79f4882384ec19772ad6291a9d22f0 (diff)
downloadandroid_hardware_qcom_audio-619fd2bf17e556392bfca13e2c12c6e81565b50c.tar.gz
android_hardware_qcom_audio-619fd2bf17e556392bfca13e2c12c6e81565b50c.tar.bz2
android_hardware_qcom_audio-619fd2bf17e556392bfca13e2c12c6e81565b50c.zip
Merge "hal: Set echo reference from mixer file"
Diffstat (limited to 'hal')
-rw-r--r--hal/msm8960/platform.c22
-rw-r--r--hal/msm8974/platform.c30
2 files changed, 20 insertions, 32 deletions
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index ed1a7818..70e0b9e7 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -193,20 +193,14 @@ static const int acdb_device_table[SND_DEVICE_MAX] = {
#define DEEP_BUFFER_PLATFORM_DELAY (29*1000LL)
#define LOW_LATENCY_PLATFORM_DELAY (13*1000LL)
-static int set_echo_reference(struct mixer *mixer, const char* ec_ref)
+static void set_echo_reference(struct audio_device *adev, bool enable)
{
- struct mixer_ctl *ctl;
- const char *mixer_ctl_name = "EC_REF_RX";
+ if (enable)
+ audio_route_apply_and_update_path(adev->audio_route, "echo-reference");
+ else
+ audio_route_reset_and_update_path(adev->audio_route, "echo-reference");
- ctl = mixer_get_ctl_by_name(mixer, mixer_ctl_name);
- if (!ctl) {
- ALOGE("%s: Could not get ctl for mixer cmd - %s",
- __func__, mixer_ctl_name);
- return -EINVAL;
- }
- ALOGV("Setting EC Reference: %s", ec_ref);
- mixer_ctl_set_enum_by_string(ctl, ec_ref);
- return 0;
+ ALOGV("Setting EC Reference: %d", enable);
}
void *platform_init(struct audio_device *adev)
@@ -748,9 +742,9 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
} else if (in_device & AUDIO_DEVICE_IN_WIRED_HEADSET) {
snd_device = SND_DEVICE_IN_HEADSET_MIC_AEC;
}
- set_echo_reference(adev->mixer, "SLIM_RX");
+ set_echo_reference(adev, true);
} else
- set_echo_reference(adev->mixer, "NONE");
+ set_echo_reference(adev, false);
}
} else if (source == AUDIO_SOURCE_DEFAULT) {
goto exit;
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 8daba8b8..923a0852 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -436,20 +436,14 @@ struct snd_device_index snd_device_name_index[SND_DEVICE_MAX] = {
#define DEEP_BUFFER_PLATFORM_DELAY (29*1000LL)
#define LOW_LATENCY_PLATFORM_DELAY (13*1000LL)
-static int set_echo_reference(struct mixer *mixer, const char* ec_ref)
+static void set_echo_reference(struct audio_device *adev, bool enable)
{
- struct mixer_ctl *ctl;
- const char *mixer_ctl_name = "EC_REF_RX";
+ if (enable)
+ audio_route_apply_and_update_path(adev->audio_route, "echo-reference");
+ else
+ audio_route_reset_and_update_path(adev->audio_route, "echo-reference");
- ctl = mixer_get_ctl_by_name(mixer, mixer_ctl_name);
- if (!ctl) {
- ALOGE("%s: Could not get ctl for mixer cmd - %s",
- __func__, mixer_ctl_name);
- return -EINVAL;
- }
- ALOGV("Setting EC Reference: %s", ec_ref);
- mixer_ctl_set_enum_by_string(ctl, ec_ref);
- return 0;
+ ALOGV("Setting EC Reference: %d", enable);
}
static struct csd_data *open_csd_client(bool i2s_ext_modem)
@@ -1444,7 +1438,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
} else if (my_data->fluence_type == FLUENCE_NONE ||
my_data->fluence_in_voice_call == false) {
snd_device = SND_DEVICE_IN_HANDSET_MIC;
- set_echo_reference(adev->mixer, EC_REF_RX);
+ set_echo_reference(adev, true);
} else {
snd_device = SND_DEVICE_IN_VOICE_DMIC;
adev->acdb_settings |= DMIC_FLAG;
@@ -1521,7 +1515,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
} else if (in_device & AUDIO_DEVICE_IN_WIRED_HEADSET) {
snd_device = SND_DEVICE_IN_HEADSET_MIC_FLUENCE;
}
- set_echo_reference(adev->mixer, EC_REF_RX);
+ set_echo_reference(adev, true);
} else if (adev->active_input->enable_aec) {
if (in_device & AUDIO_DEVICE_IN_BACK_MIC) {
if (my_data->fluence_type & FLUENCE_DUAL_MIC &&
@@ -1542,7 +1536,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
} else if (in_device & AUDIO_DEVICE_IN_WIRED_HEADSET) {
snd_device = SND_DEVICE_IN_HEADSET_MIC_FLUENCE;
}
- set_echo_reference(adev->mixer, EC_REF_RX);
+ set_echo_reference(adev, true);
} else if (adev->active_input->enable_ns) {
if (in_device & AUDIO_DEVICE_IN_BACK_MIC) {
if (my_data->fluence_type & FLUENCE_DUAL_MIC &&
@@ -1563,9 +1557,9 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
} else if (in_device & AUDIO_DEVICE_IN_WIRED_HEADSET) {
snd_device = SND_DEVICE_IN_HEADSET_MIC_FLUENCE;
}
- set_echo_reference(adev->mixer, "NONE");
+ set_echo_reference(adev, false);
} else
- set_echo_reference(adev->mixer, "NONE");
+ set_echo_reference(adev, false);
}
} else if (source == AUDIO_SOURCE_MIC) {
if (in_device & AUDIO_DEVICE_IN_BUILTIN_MIC &&
@@ -1573,7 +1567,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
if(my_data->fluence_type & FLUENCE_DUAL_MIC &&
my_data->fluence_in_audio_rec) {
snd_device = SND_DEVICE_IN_HANDSET_DMIC;
- set_echo_reference(adev->mixer, EC_REF_RX);
+ set_echo_reference(adev, true);
}
}
} else if (source == AUDIO_SOURCE_FM_RX ||