From 9ab338ba90915af2dfb849500c257d43a0324c7c Mon Sep 17 00:00:00 2001 From: codeworkx Date: Thu, 2 Aug 2012 11:27:15 +0200 Subject: audio: cleanup, finetuning, +30db boost for mics Change-Id: I642b0b118293a679700ffc04fc8803aeb7b67952 --- audio/audio_hw.c | 29 +++++++---------------- audio/audio_hw.h | 21 +++++++++++------ configs/tiny_hw.xml | 68 ++++++++++++++++++++++++++--------------------------- 3 files changed, 55 insertions(+), 63 deletions(-) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 55f497e..842fb1d 100755 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -70,18 +70,6 @@ struct pcm_config pcm_config_vx = { #define MIN(x, y) ((x) > (y) ? (y) : (x)) -struct mixer_ctls -{ - struct mixer_ctl *aif2dacl_source; - struct mixer_ctl *aif2dacr_source; - struct mixer_ctl *aif2_mode; - struct mixer_ctl *dac1l_mixer_aif1_switch; - struct mixer_ctl *dac1r_mixer_aif1_switch; - struct mixer_ctl *dac1l_mixer_aif2_switch; - struct mixer_ctl *dac1r_mixer_aif2_switch; - struct mixer_ctl *aif2dac_mux; -}; - struct m0_audio_device { struct audio_hw_device hw_device; @@ -371,6 +359,10 @@ static void end_call(struct m0_audio_device *adev) adev->pcm_modem_dl = NULL; adev->pcm_modem_ul = NULL; LOGD("%s: X", __func__); + + /* re-enable +30db boost on mics */ + mixer_ctl_set_value(adev->mixer_ctls.mixinl_in1l_volume, 0, 1); + mixer_ctl_set_value(adev->mixer_ctls.mixinl_in2l_volume, 0, 1); } static void set_eq_filter(struct m0_audio_device *adev) @@ -613,7 +605,7 @@ static void select_output_device(struct m0_audio_device *adev) LOGD("%s: set voicecall route: bt_output", __func__); set_bigroute_by_array(adev->mixer, bt_output, 1); } else { - ALOGD("%s: set voicecall route: bt_disable", __func__); + LOGD("%s: set voicecall route: bt_disable", __func__); set_bigroute_by_array(adev->mixer, bt_disable, 1); } @@ -2349,14 +2341,9 @@ static int adev_open(const hw_module_t* module, const char* name, return -EINVAL; } - adev->mixer_ctls.aif2dacl_source = mixer_get_ctl_by_name(adev->mixer, "AIF2DACL Source"); - adev->mixer_ctls.aif2dacr_source = mixer_get_ctl_by_name(adev->mixer, "AIF2DACR Source"); - adev->mixer_ctls.aif2_mode = mixer_get_ctl_by_name(adev->mixer, "AIF2 Mode"); - adev->mixer_ctls.dac1l_mixer_aif1_switch = mixer_get_ctl_by_name(adev->mixer, "DAC1L Mixer AIF1.1 Switch"); - adev->mixer_ctls.dac1r_mixer_aif1_switch = mixer_get_ctl_by_name(adev->mixer, "DAC1R Mixer AIF1.1 Switch"); - adev->mixer_ctls.dac1l_mixer_aif2_switch = mixer_get_ctl_by_name(adev->mixer, "DAC1L Mixer AIF2 Switch"); - adev->mixer_ctls.dac1r_mixer_aif2_switch = mixer_get_ctl_by_name(adev->mixer, "DAC1R Mixer AIF2 Switch"); - adev->mixer_ctls.aif2dac_mux = mixer_get_ctl_by_name(adev->mixer, "AIF2DAC Mux"); + /* +30db boost for mics */ + adev->mixer_ctls.mixinl_in1l_volume = mixer_get_ctl_by_name(adev->mixer, "MIXINL IN1L Volume"); + adev->mixer_ctls.mixinl_in2l_volume = mixer_get_ctl_by_name(adev->mixer, "MIXINL IN2L Volume"); ret = adev_config_parse(adev); if (ret != 0) diff --git a/audio/audio_hw.h b/audio/audio_hw.h index 0947bd5..d1b1433 100644 --- a/audio/audio_hw.h +++ b/audio/audio_hw.h @@ -56,6 +56,12 @@ enum tty_modes { TTY_MODE_FULL }; +struct mixer_ctls +{ + struct mixer_ctl *mixinl_in1l_volume; + struct mixer_ctl *mixinl_in2l_volume; +}; + struct route_setting { char *ctl_name; @@ -91,7 +97,9 @@ struct route_setting voicecall_default_disable[] = { struct route_setting default_input[] = { { .ctl_name = "Main Mic Switch", .intval = 1, }, + { .ctl_name = "IN1L Volume", .intval = 30, }, { .ctl_name = "MIXINL IN1L Switch", .intval = 1, }, + { .ctl_name = "MIXINL IN1L Volume", .intval = 0, }, { .ctl_name = "AIF1ADC1 HPF Mode", .intval = 0, }, { .ctl_name = "AIF1ADC1 HPF Switch", .intval = 1, }, { .ctl_name = NULL, }, @@ -99,8 +107,8 @@ struct route_setting default_input[] = { struct route_setting default_input_disable[] = { { .ctl_name = "Main Mic Switch", .intval = 0, }, + { .ctl_name = "IN1L Volume", .intval = 22, }, { .ctl_name = "MIXINL IN1L Switch", .intval = 0, }, - { .ctl_name = "AIF1ADC1 HPF Mode", .intval = 0, }, { .ctl_name = "AIF1ADC1 HPF Switch", .intval = 0, }, { .ctl_name = NULL, }, }; @@ -109,15 +117,15 @@ struct route_setting headset_input[] = { { .ctl_name = "MIXINL IN1L Switch", .intval = 0, }, { .ctl_name = "MIXINR IN1R Switch", .intval = 0, }, { .ctl_name = "Headset Mic Switch", .intval = 1, }, - { .ctl_name = "AIF1ADCL Source", .intval = 0, }, - { .ctl_name = "AIF1ADCR Source", .intval = 0, }, - { .ctl_name = "AIF2ADCL Source", .intval = 0, }, + { .ctl_name = "IN2L Volume", .intval = 18, }, { .ctl_name = "MIXINL IN2L Switch", .intval = 1, }, + { .ctl_name = "MIXINL IN2L Volume", .intval = 0, }, { .ctl_name = "AIF1ADC1 HPF Mode", .intval = 1, }, { .ctl_name = "AIF1ADC1 HPF Switch", .intval = 1, }, - { .ctl_name = "IN2L Volume", .intval = 18, }, - { .ctl_name = "MIXINL IN2L Volume", .intval = 0, }, { .ctl_name = "AIF1ADC1 Volume", .intval = 96, }, + { .ctl_name = "AIF1ADCL Source", .intval = 0, }, + { .ctl_name = "AIF1ADCR Source", .intval = 0, }, + { .ctl_name = "AIF2ADCL Source", .intval = 0, }, { .ctl_name = NULL, }, }; @@ -139,7 +147,6 @@ struct route_setting bt_output[] = { { .ctl_name = "DAC2 Volume", .intval = 96, }, { .ctl_name = "AIF2ADC Volume", .intval = 96, }, { .ctl_name = "Speaker Mixer Volume", .intval = 1, }, - { .ctl_name = "Speaker Volume", .intval = 0, }, { .ctl_name = "MIXINL IN2L Volume", .intval = 1, }, { .ctl_name = "IN1L Volume", .intval = 25, }, { .ctl_name = "IN1R Volume", .intval = 25, }, diff --git a/configs/tiny_hw.xml b/configs/tiny_hw.xml index c3fd418..7948164 100644 --- a/configs/tiny_hw.xml +++ b/configs/tiny_hw.xml @@ -125,8 +125,14 @@ We are able to have most of our routing static so do that - - + + + + + + + + @@ -136,8 +142,9 @@ We are able to have most of our routing static so do that - + + @@ -151,7 +158,6 @@ We are able to have most of our routing static so do that - @@ -167,21 +173,23 @@ We are able to have most of our routing static so do that + - + + + + + + - - - - - + @@ -195,13 +203,11 @@ We are able to have most of our routing static so do that - - @@ -249,52 +255,44 @@ We are able to have most of our routing static so do that - + + + - - - - - - - + + + + - - - - - - - - + @@ -302,23 +300,23 @@ We are able to have most of our routing static so do that - - - + + - - + + + + + - - -- cgit v1.1