exynos: audiohal: Ensure AUDIO_INPUT_FLAG_FAST is set when using low latency capture samplerate during calls
Change-Id: Ie19acd2c752b4dfa9bd846037b339346c19834b2
diff --git a/libaudio/audiohal/audio_hw.c b/libaudio/audiohal/audio_hw.c
index 6309324..c5cfb4b 100644
--- a/libaudio/audiohal/audio_hw.c
+++ b/libaudio/audiohal/audio_hw.c
@@ -3952,8 +3952,11 @@
in->common.stream_type = ASTREAM_NONE;
in->common.stream_usage = AUSAGE_NONE;
- if ((flags & AUDIO_INPUT_FLAG_FAST) != 0) {
- if (isCallMode(adev) && config->sample_rate != LOW_LATENCY_CAPTURE_SAMPLE_RATE) {
+ if (isCallMode(adev)) {
+ if ((config->sample_rate == LOW_LATENCY_CAPTURE_SAMPLE_RATE) && ((flags & AUDIO_INPUT_FLAG_VOIP_TX) != 0)) {
+ flags = AUDIO_INPUT_FLAG_FAST;
+ ALOGD("device-%s: Low latency capture samplerate used without AUDIO_INPUT_FLAG_FAST during call mode. flags changed(%#x)", __func__, flags);
+ } else if ((config->sample_rate != LOW_LATENCY_CAPTURE_SAMPLE_RATE) && ((flags & AUDIO_INPUT_FLAG_FAST) != 0)) {
flags &= ~AUDIO_INPUT_FLAG_FAST;
flags |= AUDIO_INPUT_FLAG_VOIP_TX;
ALOGD("device-%s: Denied to open Low Latency input. flags changed(%#x)", __func__, flags);