summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMingming Yin <mingming@codeaurora.org>2015-10-06 14:08:56 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-12 22:49:40 -0700
commitcbd30414a123997a694d486a4b3cb5b3fc06e38f (patch)
tree79fe1fd2f19a4bf85ec07a5c24f532fe0da51fb0
parent5e022cb144f28c851b9587c79c9507bbb52092d2 (diff)
downloadhardware_qcom_audio-cbd30414a123997a694d486a4b3cb5b3fc06e38f.tar.gz
hardware_qcom_audio-cbd30414a123997a694d486a4b3cb5b3fc06e38f.tar.bz2
hardware_qcom_audio-cbd30414a123997a694d486a4b3cb5b3fc06e38f.zip
audio: remove 5.1 channel mask if SSR is not supported
- remove 5.1 input channel mask if it cannot be supported on a chipset variant. Change-Id: Ifd5254da910e392a270067c36c31c5cfaa75f9fc
-rw-r--r--[-rwxr-xr-x]policy_hal/AudioPolicyManager.cpp56
1 files changed, 43 insertions, 13 deletions
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index cbea368a..6cd8548b 100755..100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -1815,19 +1815,6 @@ status_t AudioPolicyManagerCustom::stopInput(audio_io_handle_t input,
return status;
}
-AudioPolicyManagerCustom::AudioPolicyManagerCustom(AudioPolicyClientInterface *clientInterface)
- : AudioPolicyManager(clientInterface)
-{
-#ifdef RECORD_PLAY_CONCURRENCY
- mIsInputRequestOnProgress = false;
-#endif
-
-
-#ifdef VOICE_CONCURRENCY
- mFallBackflag = getFallBackPath();
-#endif
-}
-
audio_devices_t AudioPolicyManagerCustom::getDeviceForStrategy(routing_strategy strategy, bool fromCache)
{
audio_devices_t availableOutputDeviceTypes = mAvailableOutputDevices.types();
@@ -1854,4 +1841,47 @@ audio_devices_t AudioPolicyManagerCustom::getDeviceForStrategy(routing_strategy
device = AudioPolicyManager::getDeviceForStrategy(strategy, fromCache);
return device;
}
+AudioPolicyManagerCustom::AudioPolicyManagerCustom(AudioPolicyClientInterface *clientInterface)
+ : AudioPolicyManager(clientInterface)
+{
+ char ssr_enabled[PROPERTY_VALUE_MAX] = {0};
+ bool prop_ssr_enabled = false;
+
+ if (property_get("ro.qc.sdk.audio.ssr", ssr_enabled, NULL)) {
+ prop_ssr_enabled = atoi(ssr_enabled) || !strncmp("true", ssr_enabled, 4);
+ }
+
+ for (size_t i = 0; i < mHwModules.size(); i++) {
+ ALOGV("Hw module %d", i);
+ for (size_t j = 0; j < mHwModules[i]->mInputProfiles.size(); j++) {
+ const sp<IOProfile> inProfile = mHwModules[i]->mInputProfiles[j];
+ ALOGV("Input profile ", j);
+ for (size_t k = 0; k < inProfile->mChannelMasks.size(); k++) {
+ audio_channel_mask_t channelMask =
+ inProfile->mChannelMasks.itemAt(k);
+ ALOGV("Channel Mask %x size %d", channelMask,
+ inProfile->mChannelMasks.size());
+ if (AUDIO_CHANNEL_IN_5POINT1 == channelMask) {
+ if (!prop_ssr_enabled) {
+ ALOGI("removing AUDIO_CHANNEL_IN_5POINT1 from"
+ " input profile as SSR(surround sound record)"
+ " is not supported on this chipset variant");
+ inProfile->mChannelMasks.removeItemsAt(k, 1);
+ ALOGV("Channel Mask size now %d",
+ inProfile->mChannelMasks.size());
+ }
+ }
+ }
+ }
+ }
+
+#ifdef RECORD_PLAY_CONCURRENCY
+ mIsInputRequestOnProgress = false;
+#endif
+
+
+#ifdef VOICE_CONCURRENCY
+ mFallBackflag = getFallBackPath();
+#endif
+}
}