From 3cc70e7d66b4f1015f1639faab8acc21afd48841 Mon Sep 17 00:00:00 2001 From: Pavan Chikkala Date: Wed, 21 Jan 2015 14:36:15 +0530 Subject: audio: Fixed Audio Source in Voice Call setPhoneState calls getDeviceForInputSource to check if voice_tx device is available as part of Primary Audio Module. getDeviceForInputSource always returns DEVICE_IN_COMMUNICATION for SOURCE_VOICE_COMMUNICATION on A Family and this is not added to Available devices This is leading to creation of txPatch when it is not needed Fix is to use AUDIO_SOURCE_VOICE_CALL instead of AUDIO_SOURCE_VOICE_COMMUNICATION Change-Id: I9aa7dd2139b8374ec7f06676d06ef5addea4b2a9 --- services/audiopolicy/enginedefault/src/Engine.cpp | 4 ++++ services/audiopolicy/managerdefault/AudioPolicyManager.cpp | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'services/audiopolicy') diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cpp index 4a42a47..71f6b51 100755 --- a/services/audiopolicy/enginedefault/src/Engine.cpp +++ b/services/audiopolicy/enginedefault/src/Engine.cpp @@ -355,7 +355,11 @@ audio_devices_t Engine::getDeviceForStrategy(routing_strategy strategy) const // - cannot route from voice call RX OR // - audio HAL version is < 3.0 and TX device is on the primary HW module if (getPhoneState() == AUDIO_MODE_IN_CALL) { +#ifdef LEGACY_ALSA_AUDIO + audio_devices_t txDevice = getDeviceForInputSource(AUDIO_SOURCE_VOICE_CALL); +#else audio_devices_t txDevice = getDeviceForInputSource(AUDIO_SOURCE_VOICE_COMMUNICATION); +#endif sp primaryOutput = outputs.getPrimaryOutput(); audio_devices_t availPrimaryInputDevices = availableInputDevices.getDevicesFromHwModule(primaryOutput->getModuleHandle()); diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index 7419297..3739b60 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp @@ -321,7 +321,11 @@ void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs if(!hasPrimaryOutput()) { return; } +#ifdef LEGACY_ALSA_AUDIO + audio_devices_t txDevice = getDeviceAndMixForInputSource(AUDIO_SOURCE_VOICE_CALL); +#else audio_devices_t txDevice = getDeviceAndMixForInputSource(AUDIO_SOURCE_VOICE_COMMUNICATION); +#endif ALOGV("updateCallRouting device rxDevice %08x txDevice %08x", rxDevice, txDevice); // release existing RX patch if any -- cgit v1.1