From 1270d0cdbeb01e6c43ca2927718f54336676b11c Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Thu, 15 May 2014 17:21:20 +0530 Subject: Audio HAL updates Change-Id: Ie41cade3494dc9d3f8ba886ae1f4977e25b97423 Conflicts: configs/tiny_hw.xml --- audio/audio_hw.c | 131 ++++++++++++++++++++++++++++------------------------ configs/tiny_hw.xml | 16 +++---- 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 - + @@ -163,7 +163,7 @@ We are able to have most of our routing static so do that - + @@ -261,16 +261,16 @@ We are able to have most of our routing static so do that - + - + - + @@ -282,13 +282,13 @@ We are able to have most of our routing static so do that - + - + - + -- cgit v1.1