Merge "policy: add channelmask when selecting output"
diff --git a/configs/qssi/qssi.mk b/configs/qssi/qssi.mk
index 768e2b5..629293d 100644
--- a/configs/qssi/qssi.mk
+++ b/configs/qssi/qssi.mk
@@ -27,9 +27,7 @@
AUDIO_FEATURE_ENABLED_AAC_ADTS_OFFLOAD := true
AUDIO_FEATURE_ENABLED_PROXY_DEVICE := true
AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
-ifeq ($(filter R% r%,$(TARGET_PLATFORM_VERSION)),)
AUDIO_FEATURE_ENABLED_3D_AUDIO := true
-endif
AUDIO_FEATURE_ENABLED_AHAL_EXT := false
DOLBY_ENABLE := false
endif
@@ -178,3 +176,4 @@
PRODUCT_PACKAGES_DEBUG += \
AudioSettings
+PRODUCT_PACKAGES += libnbaio
diff --git a/policy_hal/APMConfigHelper.cpp b/policy_hal/APMConfigHelper.cpp
index 1815e77..5b17096 100644
--- a/policy_hal/APMConfigHelper.cpp
+++ b/policy_hal/APMConfigHelper.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -37,6 +37,36 @@
namespace android {
+void APMConfigHelper::dump(String8 *dst) const
+{
+ // apmconfig struct dump
+ dst->appendFormat("\nAudioPolicyManagerCustom Dump: %p\n", this);
+ dst->appendFormat("audio_offload_video: %d \n", mConfigs.audio_offload_video);
+ dst->appendFormat("audio_offload_disable: %d \n", mConfigs.audio_offload_disable);
+ dst->appendFormat("audio_deepbuffer_media: %d \n", mConfigs.audio_deepbuffer_media);
+ dst->appendFormat("audio_av_streaming_offload_enable: %d \n", mConfigs.audio_av_streaming_offload_enable);
+ dst->appendFormat("audio_offload_track_enable: %d \n", mConfigs.audio_offload_track_enable);
+ dst->appendFormat("audio_offload_multiple_enabled: %d \n", mConfigs.audio_offload_multiple_enabled);
+ dst->appendFormat("voice_dsd_playback_conc_disabled: %d \n", mConfigs.voice_dsd_playback_conc_disabled);
+ dst->appendFormat("audio_sva_conc_enabled: %d \n", mConfigs.audio_sva_conc_enabled);
+ dst->appendFormat("audio_va_concurrency_enabled: %d \n", mConfigs.audio_va_concurrency_enabled);
+ dst->appendFormat("audio_rec_playback_conc_disabled: %d \n", mConfigs.audio_rec_playback_conc_disabled);
+ dst->appendFormat("voice_path_for_pcm_voip: %d \n", mConfigs.voice_path_for_pcm_voip);
+ dst->appendFormat("voice_playback_conc_disabled: %d \n", mConfigs.voice_playback_conc_disabled);
+ dst->appendFormat("voice_record_conc_disabled: %d \n", mConfigs.voice_record_conc_disabled);
+ dst->appendFormat("voice_voip_conc_disabled: %d \n", mConfigs.voice_voip_conc_disabled);
+ dst->appendFormat("audio_offload_min_duration_secs: %u \n", mConfigs.audio_offload_min_duration_secs);
+ dst->appendFormat("voice_conc_fallbackpath: %s \n", mConfigs.voice_conc_fallbackpath.c_str());
+ dst->appendFormat("audio_extn_hdmi_spk_enabled: %d \n", mConfigs.audio_extn_hdmi_spk_enabled);
+ dst->appendFormat("audio_extn_formats_enabled: %d \n", mConfigs.audio_extn_formats_enabled);
+ dst->appendFormat("audio_extn_afe_proxy_enabled: %d \n", mConfigs.audio_extn_afe_proxy_enabled);
+ dst->appendFormat("compress_voip_enabled: %d \n", mConfigs.compress_voip_enabled);
+ dst->appendFormat("fm_power_opt: %d \n", mConfigs.fm_power_opt);
+ dst->appendFormat("voice_concurrency: %d \n", mConfigs.voice_concurrency);
+ dst->appendFormat("record_play_concurrency: %d \n", mConfigs.record_play_concurrency);
+ dst->appendFormat("use_xml_audio_policy_conf: %d \n", mConfigs.use_xml_audio_policy_conf);
+}
+
void APMConfigHelper::retrieveConfigs()
{
#ifdef AHAL_EXT_ENABLED
diff --git a/policy_hal/APMConfigHelper.h b/policy_hal/APMConfigHelper.h
index 137f2d7..e92fcaa 100644
--- a/policy_hal/APMConfigHelper.h
+++ b/policy_hal/APMConfigHelper.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -31,6 +31,7 @@
#define _APM_CONFIG_HELPER_H_
#include <string>
+#include <utils/String8.h>
#include <media/stagefright/foundation/ABase.h>
#include <utils/RefBase.h>
@@ -109,7 +110,7 @@
bool isVoiceConcEnabled();
bool isRecPlayConcEnabled();
bool useXMLAudioPolicyConf();
-
+ void dump(String8 *dst) const;
private:
inline void retrieveConfigs();
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index 8f371f0..2dd6a3c 100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -1008,7 +1008,8 @@
for (size_t i = mOutputs.size(); i > 0; i--) {
sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueAt(i-1);
DeviceVector newDevices = getNewOutputDevices(outputDesc, true /*fromCache*/);
- if ((mEngine->getPhoneState() != AUDIO_MODE_IN_CALL) || (outputDesc != mPrimaryOutput)) {
+ if (outputDesc->isActive() && ((mEngine->getPhoneState() != AUDIO_MODE_IN_CALL) ||
+ (outputDesc != mPrimaryOutput))) {
waitMs = setOutputDevices(outputDesc, newDevices, !newDevices.isEmpty(),
delayMs);
@@ -2170,4 +2171,13 @@
mFallBackflag = getFallBackPath();
}
+status_t AudioPolicyManagerCustom::dump(int fd)
+{
+ AudioPolicyManager::dump(fd);
+ String8 result;
+ mApmConfigs->dump(&result);
+ write(fd, result.string(), result.size());
+ return NO_ERROR;
+}
+
}
diff --git a/policy_hal/AudioPolicyManager.h b/policy_hal/AudioPolicyManager.h
index 0ad9c33..494f354 100644
--- a/policy_hal/AudioPolicyManager.h
+++ b/policy_hal/AudioPolicyManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
* Not a contribution.
*
* Copyright (C) 2009 The Android Open Source Project
@@ -112,6 +112,7 @@
// indicates to the audio policy manager that the input stops being used.
virtual status_t stopInput(audio_port_handle_t portId);
+ status_t dump(int fd) override;
static sp<APMConfigHelper> mApmConfigs;
protected: