Remove confusing A2DP check for fast mixer
From a dumpsys of audioflinger, it seems that bluetooth a2dp is using
fast mixer. However, from inspecting the code, it seems like this is
not the case. After adding log statements, I noticed that outDeviceTypes()
always returns nothing in this block. It seems that the statement is
not fully ready by the time that this block is called. Later on,
outDeviceTypes() seems to work fine but not here.
The BT audio HAL should no longer be bursty because of two changes
1. In the Qualcomm and newer HALs, the offload path has been added so
the DSP can encode the data instead. This path is not bursty.
2. When offloading is not implemented, the Bluetooth a2dp hal is used.
In system/bt, audio_a2dp_hw has been replaced by audio_bluetooth_hw
and this HAL is not bursty.
This means that using FastMixer for BT is good and the only "fix" needed
here is to remove this confusing code. I will do a sweep for other
instances of outDeviceTypes() in a future cl.
Bug: 195790812
Test: Tested on Bramble with various headsets and offloading turned
on/off
Change-Id: I773028ba3b79fa6f7fc4244177b24751d373d38d
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 9665424..d5394d9 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -4569,12 +4569,7 @@
break;
case FastMixer_Static:
case FastMixer_Dynamic:
- // FastMixer was designed to operate with a HAL that pulls at a regular rate,
- // where the period is less than an experimentally determined threshold that can be
- // scheduled reliably with CFS. However, the BT A2DP HAL is
- // bursty (does not pull at a regular rate) and so cannot operate with FastMixer.
- initFastMixer = mFrameCount < mNormalFrameCount
- && Intersection(outDeviceTypes(), getAudioDeviceOutAllA2dpSet()).empty();
+ initFastMixer = mFrameCount < mNormalFrameCount;
break;
}
ALOGW_IF(initFastMixer == false && mFrameCount < mNormalFrameCount,