summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJungshik Jang <jayjang@google.com>2014-07-15 19:38:42 +0900
committerJungshik Jang <jayjang@google.com>2014-07-17 09:27:23 +0900
commit7b24ee381e806dcb53308c1cafc8a45f4e2d8300 (patch)
tree47cb17d1d16a65915d71056c7f588c46b5d4eea7 /services
parent5f881c631d3a8e2c0801cdfbbe465c355816f1e3 (diff)
downloadframeworks_av-7b24ee381e806dcb53308c1cafc8a45f4e2d8300.zip
frameworks_av-7b24ee381e806dcb53308c1cafc8a45f4e2d8300.tar.gz
frameworks_av-7b24ee381e806dcb53308c1cafc8a45f4e2d8300.tar.bz2
Revisit HDMI-CEC system audio mode in AudioService.
From recent feedback on HDMI-CEC system audio mode, it would be unnecessary to enforce output from AudioService. Instead, it would follow audio policy according to status of HDMI-CEC system audio mode. For that removed two params of setHdmiSystemAudioModeSupported api of AudioManager. In terms of speaker mute, it will be handled by removing speaker from audio ouput instead of changing gain control. For that added new force usage type, FOR_HDMI_SYSTEM_AUDIO_MODE and new force config type, FORCE_HDMI_SYSTEM_AUDIO_ENFORCED. This is used to notify change of system audio mode to audio policy manager. Bug: 16305986 Bug: 16002150 Change-Id: I702e0f9ce7c7887d5f5dd02b06a40d20e4c950df
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/AudioPolicyManager.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index 1b4796b..f2320de 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -560,6 +560,13 @@ void AudioPolicyManager::setForceUse(audio_policy_force_use_t usage,
forceVolumeReeval = true;
mForceUse[usage] = config;
break;
+ case AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO:
+ if (config != AUDIO_POLICY_FORCE_NONE &&
+ config != AUDIO_POLICY_FORCE_HDMI_SYSTEM_AUDIO_ENFORCED) {
+ ALOGW("setForceUse() invalid config %d forHDMI_SYSTEM_AUDIO", config);
+ }
+ mForceUse[usage] = config;
+ break;
default:
ALOGW("setForceUse() invalid usage %d", usage);
break;
@@ -1529,6 +1536,9 @@ status_t AudioPolicyManager::dump(int fd)
result.append(buffer);
snprintf(buffer, SIZE, " Force use for system %d\n", mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM]);
result.append(buffer);
+ snprintf(buffer, SIZE, " Force use for hdmi system audio %d\n",
+ mForceUse[AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO]);
+ result.append(buffer);
snprintf(buffer, SIZE, " Available output devices:\n");
result.append(buffer);
@@ -3554,10 +3564,10 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
}
int device3 = AUDIO_DEVICE_NONE;
if (strategy == STRATEGY_MEDIA) {
- // ARC, SPDIF and LINE can co-exist with others.
+ // ARC, SPDIF and AUX_LINE can co-exist with others.
device3 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_HDMI_ARC;
device3 |= (availableOutputDeviceTypes & AUDIO_DEVICE_OUT_SPDIF);
- device3 |= (availableOutputDeviceTypes & AUDIO_DEVICE_OUT_LINE);
+ device3 |= (availableOutputDeviceTypes & AUDIO_DEVICE_OUT_AUX_LINE);
}
device2 |= device3;
@@ -3565,6 +3575,13 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
// STRATEGY_ENFORCED_AUDIBLE, AUDIO_DEVICE_NONE otherwise
device |= device2;
+ // If hdmi system audio mode is on, remove speaker out of output list.
+ if ((strategy == STRATEGY_MEDIA) &&
+ (mForceUse[AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO] ==
+ AUDIO_POLICY_FORCE_HDMI_SYSTEM_AUDIO_ENFORCED)) {
+ device &= ~AUDIO_DEVICE_OUT_SPEAKER;
+ }
+
if (device) break;
device = mDefaultOutputDevice->mDeviceType;
if (device == AUDIO_DEVICE_NONE) {