audiopolicy: remove soundcard status check from isOffloadSupported()
- Attempt to get sound card status from isOffloadSupported() can
cause cross deadlock if audio flinger calls other audio policy
APIs concurrently to update effect status with AudioFlinger's
mLock already acquired.
- Also fetching sound card status from the context of
isOffloadSupported() is not necessary as even though offload is
marked supported here, error from request to open audio output
would always make player fallback to non offload path.
CRs-Fixed: 1048043
Change-Id: I95cd3310da130deb1e6b3847bd6af79f15dd7415
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index b89c82c..122ac14 100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -563,16 +563,7 @@
if (mEffects.isNonOffloadableEffectEnabled()) {
return false;
}
- // Check for soundcard status
- String8 valueStr = mpClientInterface->getParameters((audio_io_handle_t)0,
- String8("SND_CARD_STATUS"));
- AudioParameter result = AudioParameter(valueStr);
- int isonline = 0;
- if ((result.getInt(String8("SND_CARD_STATUS"), isonline) == NO_ERROR)
- && !isonline) {
- ALOGD("copl: soundcard is offline rejecting offload request");
- return false;
- }
+
// See if there is a profile to support this.
// AUDIO_DEVICE_NONE
sp<IOProfile> profile = getProfileForDirectOutput(AUDIO_DEVICE_NONE /*ignore device */,