summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUtkarsh Gupta <utkarsh.eminem@gmail.com>2014-05-15 17:21:20 +0530
committertilaksidduram <tilaksidduram@gmail.com>2014-10-30 10:32:58 +0530
commit1270d0cdbeb01e6c43ca2927718f54336676b11c (patch)
tree9bd063170959cfa1addb551220aecce2aec33fa3
parentba2fcc722d9c9acb5d5bd4931e126eee4277015d (diff)
downloaddevice_samsung_n7100-1270d0cdbeb01e6c43ca2927718f54336676b11c.zip
device_samsung_n7100-1270d0cdbeb01e6c43ca2927718f54336676b11c.tar.gz
device_samsung_n7100-1270d0cdbeb01e6c43ca2927718f54336676b11c.tar.bz2
Audio HAL updates
Change-Id: Ie41cade3494dc9d3f8ba886ae1f4977e25b97423 Conflicts: configs/tiny_hw.xml
-rw-r--r--audio/audio_hw.c131
-rw-r--r--configs/tiny_hw.xml16
2 files changed, 79 insertions, 68 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 31aecad..b54ea35 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -587,6 +587,18 @@ static void select_mode(struct m0_audio_device *adev)
adev->in_call = 0;
ril_set_call_clock_sync(&adev->ril, SOUND_CLOCK_STOP);
end_call(adev);
+ //Force Input Standby
+ adev->in_device = AUDIO_DEVICE_NONE;
+
+ ALOGD("%s: set voicecall route: voicecall_default_disable", __func__);
+ set_bigroute_by_array(adev->mixer, voicecall_default_disable, 1);
+ ALOGD("%s: set voicecall route: default_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, default_input_disable, 1);
+ ALOGD("%s: set voicecall route: headset_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, headset_input_disable, 1);
+ ALOGD("%s: set voicecall route: bt_disable", __func__);
+ set_bigroute_by_array(adev->mixer, bt_disable, 1);
+
force_all_standby(adev);
ALOGD("%s: set voicecall route: voicecall_default_disable", __func__);
@@ -2795,86 +2807,85 @@ static void adev_config_start(void *data, const XML_Char *elem,
unsigned int i, j;
for (i = 0; attr[i]; i += 2) {
- if (strcmp(attr[i], "name") == 0)
- name = attr[i + 1];
+ if (strcmp(attr[i], "name") == 0)
+ name = attr[i + 1];
- if (strcmp(attr[i], "val") == 0)
- val = attr[i + 1];
+ if (strcmp(attr[i], "val") == 0)
+ val = attr[i + 1];
}
if (strcmp(elem, "device") == 0) {
- if (!name) {
- ALOGE("Unnamed device\n");
- return;
- }
-
- for (i = 0; i < sizeof(dev_names) / sizeof(dev_names[0]); i++) {
- if (strcmp(dev_names[i].name, name) == 0) {
- ALOGI("Allocating device %s\n", name);
- dev_cfg = realloc(s->adev->dev_cfgs,
- (s->adev->num_dev_cfgs + 1)
- * sizeof(*dev_cfg));
- if (!dev_cfg) {
- ALOGE("Unable to allocate dev_cfg\n");
+ if (!name) {
+ ALOGE("Unnamed device\n");
return;
}
- s->dev = &dev_cfg[s->adev->num_dev_cfgs];
- memset(s->dev, 0, sizeof(*s->dev));
- s->dev->mask = dev_names[i].mask;
+ for (i = 0; i < sizeof(dev_names) / sizeof(dev_names[0]); i++) {
+ if (strcmp(dev_names[i].name, name) == 0) {
+ ALOGI("Allocating device %s\n", name);
+ dev_cfg = realloc(s->adev->dev_cfgs,
+ (s->adev->num_dev_cfgs + 1)
+ * sizeof(*dev_cfg));
+ if (!dev_cfg) {
+ ALOGE("Unable to allocate dev_cfg\n");
+ return;
+ }
- s->adev->dev_cfgs = dev_cfg;
- s->adev->num_dev_cfgs++;
- }
- }
+ s->dev = &dev_cfg[s->adev->num_dev_cfgs];
+ memset(s->dev, 0, sizeof(*s->dev));
+ s->dev->mask = dev_names[i].mask;
+ s->adev->dev_cfgs = dev_cfg;
+ s->adev->num_dev_cfgs++;
+ }
+ }
} else if (strcmp(elem, "path") == 0) {
- if (s->path_len)
- ALOGW("Nested paths\n");
-
- /* If this a path for a device it must have a role */
- if (s->dev) {
- /* Need to refactor a bit... */
- if (strcmp(name, "on") == 0) {
- s->on = true;
- } else if (strcmp(name, "off") == 0) {
- s->on = false;
- } else {
- ALOGW("Unknown path name %s\n", name);
+ if (s->path_len)
+ ALOGW("Nested paths\n");
+
+ /* If this a path for a device it must have a role */
+ if (s->dev) {
+ /* Need to refactor a bit... */
+ if (strcmp(name, "on") == 0) {
+ s->on = true;
+ } else if (strcmp(name, "off") == 0) {
+ s->on = false;
+ } else {
+ ALOGW("Unknown path name %s\n", name);
+ }
}
- }
} else if (strcmp(elem, "ctl") == 0) {
- struct route_setting *r;
+ struct route_setting *r;
- if (!name) {
- ALOGE("Unnamed control\n");
- return;
- }
+ if (!name) {
+ ALOGE("Unnamed control\n");
+ return;
+ }
- if (!val) {
- ALOGE("No value specified for %s\n", name);
- return;
- }
+ if (!val) {
+ ALOGE("No value specified for %s\n", name);
+ return;
+ }
- ALOGV("Parsing control %s => %s\n", name, val);
+ ALOGV("Parsing control %s => %s\n", name, val);
- r = realloc(s->path, sizeof(*r) * (s->path_len + 1));
- if (!r) {
- ALOGE("Out of memory handling %s => %s\n", name, val);
- return;
- }
+ r = realloc(s->path, sizeof(*r) * (s->path_len + 1));
+ if (!r) {
+ ALOGE("Out of memory handling %s => %s\n", name, val);
+ return;
+ }
- r[s->path_len].ctl_name = strdup(name);
- r[s->path_len].strval = NULL;
+ r[s->path_len].ctl_name = strdup(name);
+ r[s->path_len].strval = NULL;
- /* This can be fooled but it'll do */
- r[s->path_len].intval = atoi(val);
- if (!r[s->path_len].intval && strcmp(val, "0") != 0)
- r[s->path_len].strval = strdup(val);
+ /* This can be fooled but it'll do */
+ r[s->path_len].intval = atoi(val);
+ if (!r[s->path_len].intval && strcmp(val, "0") != 0)
+ r[s->path_len].strval = strdup(val);
- s->path = r;
- s->path_len++;
+ s->path = r;
+ s->path_len++;
}
}
diff --git a/configs/tiny_hw.xml b/configs/tiny_hw.xml
index 924005d..c693c0d 100644
--- a/configs/tiny_hw.xml
+++ b/configs/tiny_hw.xml
@@ -140,7 +140,7 @@ 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 Boost Volume" val="6"/>
<ctl name="Speaker Volume" val="57"/>
</path>
<path name="off">
@@ -163,7 +163,7 @@ We are able to have most of our routing static so do that
<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="Output Volume" val="60"/>
+ <ctl name="Output Volume" val="57"/>
<ctl name="Earpiece Volume" val="1"/>
</path>
<path name="off">
@@ -261,16 +261,16 @@ We are able to have most of our routing static so do that
<path name="on">
<ctl name="Main Mic Switch" val="1"/>
<ctl name="MainMicBias Mode" val="1"/>
- <ctl name="IN2L Volume" val="20"/>
+ <ctl name="IN2L Volume" val="26"/>
<ctl name="MIXINL IN2L Switch" val="1"/>
- <ctl name="MIXINL IN2L Volume" val="1"/>
+ <ctl name="MIXINL IN2L Volume" val="0"/>
<ctl name="AIF1ADCL Source" val="Left"/>
<ctl name="AIF1ADCR Source" val="Left"/>
<ctl name="AIF1ADC2L Mixer ADC/DMIC Switch" val="1"/>
<ctl name="AIF1ADC1R Mixer ADC/DMIC Switch" val="1"/>
<ctl name="AIF1ADC1 HPF Mode" val="0"/>
<ctl name="AIF1ADC1 HPF Switch" val="1"/>
- <ctl name="AIF1ADC1 Volume" val="88"/>
+ <ctl name="AIF1ADC1 Volume" val="96"/>
</path>
<path name="off">
<ctl name="Main Mic Switch" val="0"/>
@@ -282,13 +282,13 @@ We are able to have most of our routing static so do that
<path name="on">
<ctl name="Sub Mic Switch" val="1"/>
<ctl name="SubMicBias Mode" val="1"/>
- <ctl name="IN1R Volume" val="20"/>
+ <ctl name="IN1R Volume" val="28"/>
<ctl name="MIXINR IN1R Switch" val="1"/>
<ctl name="MIXINR IN1R Volume" val="1"/>
<ctl name="AIF1ADCR Source" val="1"/>
- <ctl name="AIF1ADC1 HPF Mode" val="0"/>
+ <ctl name="AIF1ADC1 HPF Mode" val="1"/>
<ctl name="AIF1ADC1 HPF Switch" val="1"/>
- <ctl name="AIF1ADC1 Volume" val="88"/>
+ <ctl name="AIF1ADC1 Volume" val="96"/>
</path>
<path name="off">
<ctl name="Sub Mic Switch" val="0"/>