Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

alsa_sound: fix for output device routing during video chat

Bug: 7163358

- Output device for MODE_IN_COMMUNICATION could be earpiece
  or speaker, do not update output device in switchDevice()
  if input device is BUILTIN_MIC

Change-Id: I2a97a63f4cb57ef114695d3fd917282612b7a346
Signed-off-by: Iliyan Malchev <malchev@google.com>
  • Loading branch information...
commit c669c27ef9c5663692c3dd8818bb6e7fcdc39b7a 1 parent 925596f
SathishKumar Mani authored Iliyan Malchev committed
Showing with 11 additions and 7 deletions.
  1. +11 −7 alsa_sound/alsa_default.cpp
View
18 alsa_sound/alsa_default.cpp
@@ -376,10 +376,12 @@ void switchDevice(alsa_handle_t *handle, uint32_t devices, uint32_t mode)
} else if (devices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE) {
devices = devices | (AudioSystem::DEVICE_OUT_WIRED_HEADPHONE |
AudioSystem::DEVICE_IN_BUILTIN_MIC);
- } else if ((devices & AudioSystem::DEVICE_OUT_EARPIECE) ||
- (devices & AudioSystem::DEVICE_IN_BUILTIN_MIC)) {
- devices = devices | (AudioSystem::DEVICE_IN_BUILTIN_MIC |
- AudioSystem::DEVICE_OUT_EARPIECE);
+ } else if (devices & AudioSystem::DEVICE_IN_BUILTIN_MIC) {
+ if (mode == AudioSystem::MODE_IN_CALL) {
+ devices |= AudioSystem::DEVICE_OUT_EARPIECE;
+ }
+ } else if (devices & AudioSystem::DEVICE_OUT_EARPIECE) {
+ devices = devices | AudioSystem::DEVICE_IN_BUILTIN_MIC;
} else if (devices & AudioSystem::DEVICE_OUT_SPEAKER) {
devices = devices | (AudioSystem::DEVICE_IN_BACK_MIC |
AudioSystem::DEVICE_OUT_SPEAKER);
@@ -423,12 +425,14 @@ void switchDevice(alsa_handle_t *handle, uint32_t devices, uint32_t mode)
if ((rxDevice != NULL) && (txDevice != NULL)) {
if (((strncmp(rxDevice, curRxUCMDevice, MAX_STR_LEN)) ||
- (strncmp(txDevice, curTxUCMDevice, MAX_STR_LEN))) && (mode == AudioSystem::MODE_IN_CALL))
+ (strncmp(txDevice, curTxUCMDevice, MAX_STR_LEN))) &&
+ ((mode == AudioSystem::MODE_IN_CALL) ||
+ (mode == AudioSystem::MODE_IN_COMMUNICATION)))
inCallDevSwitch = true;
}
#ifdef QCOM_CSDCLIENT_ENABLED
- if (mode == AudioSystem::MODE_IN_CALL && platform_is_Fusion3() && (inCallDevSwitch == true)) {
+ if (platform_is_Fusion3() && (inCallDevSwitch == true)) {
if (csd_disable_device == NULL) {
ALOGE("dlsym:Error:%s Loading csd_client_disable_device", dlerror());
} else {
@@ -528,7 +532,7 @@ void switchDevice(alsa_handle_t *handle, uint32_t devices, uint32_t mode)
}
ALOGD("switchDevice: curTxUCMDevivce %s curRxDevDevice %s", curTxUCMDevice, curRxUCMDevice);
- if (mode == AudioSystem::MODE_IN_CALL && platform_is_Fusion3() && (inCallDevSwitch == true)) {
+ if (platform_is_Fusion3() && (inCallDevSwitch == true)) {
/* get tx acdb id */
memset(&ident,0,sizeof(ident));
strlcpy(ident, "ACDBID/", sizeof(ident));

0 comments on commit c669c27

Please sign in to comment.
Something went wrong with that request. Please try again.