summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-11-25 12:35:01 -0800
committerEric Laurent <elaurent@google.com>2014-11-25 12:48:26 -0800
commit066ceecf4c6ed5ce26c5ddf00d7d9097d560b7a2 (patch)
treeb68469123118b1f6a66ef44d3fb4a5fcfe637cc5 /services
parente83b55dc29ca16092ba02f36f55fa6e0e37fd78c (diff)
downloadframeworks_av-066ceecf4c6ed5ce26c5ddf00d7d9097d560b7a2.zip
frameworks_av-066ceecf4c6ed5ce26c5ddf00d7d9097d560b7a2.tar.gz
frameworks_av-066ceecf4c6ed5ce26c5ddf00d7d9097d560b7a2.tar.bz2
audio policy: do not route accessibility prompts to compressed output
When a digital output (HDMI or S/PDIF) is configured with a non linear PCM audio format it is likely that the audio HAL or HW will not be able to mix other sounds with the main media stream being played. In this case, do not condider HDMI or S/PDIF as a valid route for accessibilty strategy so that accessibility prompts are always audible. Bug: 18067208. Change-Id: If20603a1dc1dc470f206f841308bed2b87daf21c
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/AudioPolicyManager.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index 8ca0b96..cd8df2f 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -4355,6 +4355,21 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
// FIXME: STRATEGY_ACCESSIBILITY and STRATEGY_REROUTING follow STRATEGY_MEDIA for now
case STRATEGY_ACCESSIBILITY:
+ if (strategy == STRATEGY_ACCESSIBILITY) {
+ // do not route accessibility prompts to a digital output currently configured with a
+ // compressed format as they would likely not be mixed and dropped.
+ for (size_t i = 0; i < mOutputs.size(); i++) {
+ sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
+ audio_devices_t devices = desc->device() &
+ (AUDIO_DEVICE_OUT_HDMI | AUDIO_DEVICE_OUT_SPDIF | AUDIO_DEVICE_OUT_HDMI_ARC);
+ if (desc->isActive() && !audio_is_linear_pcm(desc->mFormat) &&
+ devices != AUDIO_DEVICE_NONE) {
+ availableOutputDeviceTypes = availableOutputDeviceTypes & ~devices;
+ }
+ }
+ }
+ // FALL THROUGH
+
case STRATEGY_REROUTING:
case STRATEGY_MEDIA: {
uint32_t device2 = AUDIO_DEVICE_NONE;