From fb65fc8a29c7eb9e3ede46168df60c55943821b5 Mon Sep 17 00:00:00 2001 From: Ajay Dudani Date: Mon, 20 Aug 2012 18:48:13 -0700 Subject: [PATCH 1/2] hardware/alsa_sound: Change the device disable sequence Before tearing down codec, disable the MDM device first so that slimbus channel is disconnected from MDM to avoid overflow on codec slimbus interface Change-Id: I20ef6fe97b3e72b6fe17243a55e4e20ed30df93c --- alsa_sound/alsa_default.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/alsa_sound/alsa_default.cpp b/alsa_sound/alsa_default.cpp index d589f5c1..ff065d54 100644 --- a/alsa_sound/alsa_default.cpp +++ b/alsa_sound/alsa_default.cpp @@ -431,6 +431,17 @@ void switchDevice(alsa_handle_t *handle, uint32_t devices, uint32_t mode) (strncmp(txDevice, curTxUCMDevice, MAX_STR_LEN))) && (mode == AudioSystem::MODE_IN_CALL)) inCallDevSwitch = true; } + +#ifdef QCOM_CSDCLIENT_ENABLED + if (mode == AudioSystem::MODE_IN_CALL && platform_is_Fusion3() && (inCallDevSwitch == true)) { + err = csd_client_disable_device(); + if (err < 0) + { + ALOGE("csd_client_disable_device, failed, error %d", err); + } + } +#endif + snd_use_case_get(handle->ucMgr, "_verb", (const char **)&use_case); mods_size = snd_use_case_get_list(handle->ucMgr, "_enamods", &mods_list); if (rxDevice != NULL) { @@ -488,15 +499,6 @@ void switchDevice(alsa_handle_t *handle, uint32_t devices, uint32_t mode) } } ALOGV("%s,rxDev:%s, txDev:%s, curRxDev:%s, curTxDev:%s\n", __FUNCTION__, rxDevice, txDevice, curRxUCMDevice, curTxUCMDevice); -#ifdef QCOM_CSDCLIENT_ENABLED - if (mode == AudioSystem::MODE_IN_CALL && platform_is_Fusion3() && (inCallDevSwitch == true)) { - err = csd_client_disable_device(); - if (err < 0) - { - ALOGE("csd_client_disable_device, failed, error %d", err); - } - } -#endif if (rxDevice != NULL) { snd_use_case_set(handle->ucMgr, "_enadev", rxDevice); From 15defbaaf797973200e6156a0d00982aa039da4e Mon Sep 17 00:00:00 2001 From: "ehgrace.kim" Date: Sun, 12 Aug 2012 20:40:32 -0700 Subject: [PATCH 2/2] audio: add the headset tx Change-Id: If15ef8362dd2800c41fb945b96488844db29e5db --- alsa_sound/alsa_default.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/alsa_sound/alsa_default.cpp b/alsa_sound/alsa_default.cpp index ff065d54..41aae711 100644 --- a/alsa_sound/alsa_default.cpp +++ b/alsa_sound/alsa_default.cpp @@ -1409,10 +1409,11 @@ char *getUCMDevice(uint32_t devices, int input, char *rxDevice) } else if (devices & AudioSystem::DEVICE_IN_AUX_DIGITAL) { return strdup(SND_USE_CASE_DEV_HDMI_TX); /* HDMI TX */ #ifdef QCOM_ANC_HEADSET_ENABLED - } else if ((devices & AudioSystem::DEVICE_IN_WIRED_HEADSET) || - (devices & AudioSystem::DEVICE_IN_ANC_HEADSET)) { + } else if (devices & AudioSystem::DEVICE_IN_ANC_HEADSET) { return strdup(SND_USE_CASE_DEV_HEADSET); /* HEADSET TX */ #endif + } else if (devices & AudioSystem::DEVICE_IN_WIRED_HEADSET) { + return strdup(SND_USE_CASE_DEV_HEADSET); /* HEADSET TX */ } else if (devices & AudioSystem::DEVICE_IN_BLUETOOTH_SCO_HEADSET) { if (btsco_samplerate == BTSCO_RATE_16KHZ) return strdup(SND_USE_CASE_DEV_BTSCO_WB_TX); /* BTSCO TX*/