summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xaudio/audio_hw.c17
-rw-r--r--audio/audio_hw.h10
-rw-r--r--configs/tiny_hw.xml48
3 files changed, 46 insertions, 29 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index a8bedf2..b17ff1f 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -88,8 +88,9 @@ struct m0_audio_device {
struct m0_dev_cfg *dev_cfgs;
int num_dev_cfgs;
struct mixer *mixer;
+ struct mixer_ctls mixer_ctls;
audio_mode_t mode;
- int active_devices;
+ int active_devices;
int devices;
struct pcm *pcm_modem_dl;
struct pcm *pcm_modem_ul;
@@ -378,13 +379,15 @@ err_open_dl:
static void end_call(struct m0_audio_device *adev)
{
ALOGE("Closing modem PCMs");
-
pcm_stop(adev->pcm_modem_dl);
pcm_stop(adev->pcm_modem_ul);
pcm_close(adev->pcm_modem_dl);
pcm_close(adev->pcm_modem_ul);
adev->pcm_modem_dl = NULL;
adev->pcm_modem_ul = NULL;
+
+ /* re-enable +30db boost on mic */
+ mixer_ctl_set_value(adev->mixer_ctls.mixinl_in1l_volume, 0, 1);
}
static void set_eq_filter(struct m0_audio_device *adev)
@@ -564,7 +567,7 @@ static void select_output_device(struct m0_audio_device *adev)
select_devices(adev);
- set_eq_filter(adev);
+ set_eq_filter(adev);
if (adev->mode == AUDIO_MODE_IN_CALL) {
if (!bt_on) {
@@ -2979,9 +2982,11 @@ static int adev_open(const hw_module_t* module, const char* name,
return -EINVAL;
}
- ret = adev_config_parse(adev);
- if (ret != 0)
- goto err_mixer;
+ adev->mixer_ctls.mixinl_in1l_volume = mixer_get_ctl_by_name(adev->mixer, "MIXINL IN1L Volume");
+
+ ret = adev_config_parse(adev);
+ if (ret != 0)
+ goto err_mixer;
/* Set the default route before the PCM stream is opened */
pthread_mutex_lock(&adev->lock);
diff --git a/audio/audio_hw.h b/audio/audio_hw.h
index c395d9f..213d850 100644
--- a/audio/audio_hw.h
+++ b/audio/audio_hw.h
@@ -104,6 +104,11 @@ enum tty_modes {
TTY_MODE_FULL
};
+struct mixer_ctls
+{
+ struct mixer_ctl *mixinl_in1l_volume;
+};
+
struct route_setting
{
char *ctl_name;
@@ -139,7 +144,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, },
@@ -147,8 +154,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, },
};
@@ -187,7 +194,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 fc1783b..be138b9 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
<ctl name="SPKL DAC1 Volume" val="1"/>
<ctl name="SPKR DAC1 Volume" val="1"/>
<ctl name="Speaker Mixer Volume" val="3"/>
- <ctl name="Speaker Boost Volume" val="4"/>
- <ctl name="Speaker Volume" val="57"/>
+ <ctl name="Speaker Boost Volume" val="5"/>
+ <ctl name="Speaker Volume" val="60"/>
+ <ctl name="AIF1DAC1 EQ Switch" val="1"/>
+ <ctl name="AIF1DAC1 EQ1 Volume" val="9"/>
+ <ctl name="AIF1DAC1 EQ2 Volume" val="7"/>
+ <ctl name="AIF1DAC1 EQ3 Volume" val="10"/>
+ <ctl name="AIF1DAC1 EQ4 Volume" val="13"/>
+ <ctl name="AIF1DAC1 EQ5 Volume" val="12"/>
</path>
<path name="off">
<ctl name="SPK Switch" val="0"/>
@@ -136,8 +142,9 @@ We are able to have most of our routing static so do that
<ctl name="SPKL DAC1 Volume" val="1"/>
<ctl name="SPKR DAC1 Volume" val="1"/>
<ctl name="Speaker Mixer Volume" val="0"/>
- <ctl name="Speaker Volume" val="57"/>
+ <ctl name="Speaker Volume" val="0"/>
<ctl name="Speaker Boost Volume" val="0"/>
+ <ctl name="AIF1DAC1 EQ Switch" val="0"/>
</path>
</device>
<device name="earpiece">
@@ -151,7 +158,6 @@ We are able to have most of our routing static so do that
<ctl name="Output Volume" val="57"/>
<ctl name="Earpiece Volume" val="1"/>
<ctl name="Speaker Mixer Volume" val="1"/>
- <ctl name="Speaker Volume" val="0"/>
</path>
<path name="off">
<ctl name="RCV Switch" val="0"/>
@@ -167,21 +173,23 @@ We are able to have most of our routing static so do that
<device name="headphone">
<path name="on">
<ctl name="HP Switch" val="1"/>
+ <ctl name="Headphone Volume" val="50"/>
<ctl name="Headphone ZC Switch" val="0"/>
<ctl name="AIF1DAC1 Volume" val="96"/>
<ctl name="AIF1 Boost Volume" val="0"/>
<ctl name="DAC1 Volume" val="96"/>
<ctl name="Left Output Mixer DAC Volume" val="7"/>
<ctl name="Right Output Mixer DAC Volume" val="7"/>
- <ctl name="Headphone Volume" val="50"/>
+ <ctl name="AIF1DAC1 EQ Switch" val="1"/>
+ <ctl name="AIF1DAC1 EQ1 Volume" val="16"/>
+ <ctl name="AIF1DAC1 EQ2 Volume" val="14"/>
+ <ctl name="AIF1DAC1 EQ3 Volume" val="12"/>
+ <ctl name="AIF1DAC1 EQ4 Volume" val="14"/>
+ <ctl name="AIF1DAC1 EQ5 Volume" val="16"/>
</path>
<path name="off">
<ctl name="HP Switch" val="0"/>
- <ctl name="Headphone ZC Switch" val="0"/>
- <ctl name="AIF1DAC1 Volume" val="96"/>
- <ctl name="AIF1 Boost Volume" val="0"/>
- <ctl name="DAC1 Volume" val="96"/>
- <ctl name="Headphone Volume" val="50"/>
+ <ctl name="AIF1DAC1 EQ Switch" val="0"/>
</path>
</device>
<device name="sco-out">
@@ -195,13 +203,11 @@ We are able to have most of our routing static so do that
<ctl name="DAC2 Volume" val="96"/>
<ctl name="AIF2ADC Volume" val="96"/>
<ctl name="Speaker Mixer Volume" val="1"/>
- <ctl name="Speaker Volume" val="0"/>
</path>
<path name="off">
<ctl name="AIF2DAC2L Mixer AIF1.1 Switch" val="0"/>
<ctl name="AIF2DAC2R Mixer AIF1.1 Switch" val="0"/>
<ctl name="Speaker Mixer Volume" val="1"/>
- <ctl name="Speaker Volume" val="0"/>
</path>
</device>
<device name="analog-dock">
@@ -249,44 +255,44 @@ We are able to have most of our routing static so do that
<ctl name="SPKL DAC1 Volume" val="1"/>
<ctl name="SPKR DAC1 Volume" val="1"/>
<ctl name="Speaker Mixer Volume" val="0"/>
- <ctl name="Speaker Volume" val="57"/>
<ctl name="Speaker Boost Volume" val="0"/>
</path>
</device>
<device name="builtin-mic">
<path name="on">
<ctl name="Main Mic Switch" val="1"/>
+ <ctl name="IN1L Volume" val="22"/>
+ <ctl name="MIXINL IN1L Switch" val="1"/>
+ <ctl name="MIXINL IN1L Volume" val="1"/>
<ctl name="AIF1ADCL Source" val="0"/>
<ctl name="AIF2ADCL Source" val="0"/>
- <ctl name="MIXINL IN1L Switch" val="1"/>
<ctl name="AIF1ADC1 HPF Mode" val="0"/>
<ctl name="AIF1ADC1 HPF Switch" val="1"/>
- <ctl name="IN1L Volume" val="30"/>
- <ctl name="MIXINL IN1L Volume" val="0"/>
<ctl name="AIF1ADC1 Volume" val="96"/>
</path>
<path name="off">
<ctl name="Main Mic Switch" val="0"/>
<ctl name="MIXINL IN1L Switch" val="0"/>
- <ctl name="IN1L Volume" val="4"/>
+ <ctl name="MIXINL IN1L Volume" val="0"/>
+ <ctl name="IN1L Volume" val="10"/>
</path>
</device>
<device name="back-mic">
<path name="on">
<ctl name="Sub Mic Switch" val="1"/>
+ <ctl name="IN1R Volume" val="22"/>
+ <ctl name="MIXINR IN1R Switch" val="1"/>
+ <ctl name="MIXINR IN1R Volume" val="1"/>
<ctl name="AIF1ADCR Source" val="1"/>
<ctl name="AIF2ADCR Source" val="1"/>
- <ctl name="MIXINR IN1R Switch" val="1"/>
<ctl name="AIF1ADC1 HPF Mode" val="1"/>
<ctl name="AIF1ADC1 HPF Switch" val="1"/>
- <ctl name="IN1R Volume" val="30"/>
- <ctl name="MIXINR IN1R Volume" val="0"/>
<ctl name="AIF1ADC1 Volume" val="96"/>
</path>
<path name="off">
<ctl name="Sub Mic Switch" val="0"/>
<ctl name="MIXINR IN1R Switch" val="0"/>
- <ctl name="IN1R Volume" val="11"/>
+ <ctl name="IN1R Volume" val="10"/>
</path>
</device>
<device name="headset-in">