summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkunleiz <kunleiz@codeaurora.org>2017-11-15 16:28:55 +0800
committerArne Coucheron <arco68@gmail.com>2019-09-28 00:23:56 +0200
commit5bd98d30bdb9cd3713f9fc02fbf5aaf5b141ed9c (patch)
tree442ae36e77babf4e986d12d7105630538833603c
parent2a7ce7570baea6621377b7d501cdd23b74cbdeb9 (diff)
downloadhardware_qcom_audio-5bd98d30bdb9cd3713f9fc02fbf5aaf5b141ed9c.tar.gz
hardware_qcom_audio-5bd98d30bdb9cd3713f9fc02fbf5aaf5b141ed9c.tar.bz2
hardware_qcom_audio-5bd98d30bdb9cd3713f9fc02fbf5aaf5b141ed9c.zip
hal: Fix no audio during voice call with voip in background
- First, ringtone uses audio combo device "speaker-and-headphones". Then IN_CALL mode is set, voice call useacase starts and selects device based on primary output. But at this moment APM hasn't routed output to headset. Voice call usecase starts and audio device still uses "speaker-and-headphones" combo device. This would causes no audio issue due to no backends enabled. And in APM, voice call usecase is not allowed to route to combo device. - Add combo device check before voice set up. It forces voice stop when voice start with combo device. CRs-Fixed: 2113931 Change-Id: I3f0b6286a2ab473c83e0caa59917de81d56b7df5
-rw-r--r--hal/voice.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hal/voice.c b/hal/voice.c
index b8a4609f..8df338cc 100644
--- a/hal/voice.c
+++ b/hal/voice.c
@@ -134,6 +134,14 @@ int voice_start_usecase(struct audio_device *adev, audio_usecase_t usecase_id)
uc_info->type = VOICE_CALL;
uc_info->stream.out = adev->current_call_output;
uc_info->devices = adev->current_call_output->devices;
+
+ if (popcount(uc_info->devices) == 2) {
+ ALOGE("%s: Invalid combo device(%#x) for voice call", __func__,
+ uc_info->devices);
+ ret = -EIO;
+ goto error_start_voice;
+ }
+
uc_info->in_snd_device = SND_DEVICE_NONE;
uc_info->out_snd_device = SND_DEVICE_NONE;