summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/managerdefault
diff options
context:
space:
mode:
authorRavi Kumar Alamanda <ralama@codeaurora.org>2015-04-03 12:13:21 -0700
committerAndy Hung <hunga@google.com>2015-06-11 15:46:26 -0700
commit439e4ed408c21bd65711d279bd5251cef7e83440 (patch)
tree80c8eae9475b4e597f633251fdbac3f0c11eca17 /services/audiopolicy/managerdefault
parentca097142ba4664858bc29bb538bcfcf5ea03ebe7 (diff)
downloadframeworks_av-439e4ed408c21bd65711d279bd5251cef7e83440.zip
frameworks_av-439e4ed408c21bd65711d279bd5251cef7e83440.tar.gz
frameworks_av-439e4ed408c21bd65711d279bd5251cef7e83440.tar.bz2
audiopolicy: use deep buffer output by default for music streams
Default disabled. This is enabled by adb shell setprop audio.deep_buffer.media 1 Applications that use AudioTrack java interface for audio rendering defaults to primary output as flags indicated as FLAG_NONE. If the primary output is low latency output, it results higher power consumption than deep-buffer path if used. Make the deep buffer output as default option for music streams if flags are not specified. It may also be used for testing audio glitches from heavy CPU or DRM which may cause issues with the FastMixer. Bug: 21198655 Bug: 21785618 Change-Id: I909c296ddcf4484b9a877ef1c0230ea58537e06a
Diffstat (limited to 'services/audiopolicy/managerdefault')
-rw-r--r--services/audiopolicy/managerdefault/AudioPolicyManager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 0adaac9..6befb8d 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -789,6 +789,11 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
// only allow deep buffering for music stream type
if (stream != AUDIO_STREAM_MUSIC) {
flags = (audio_output_flags_t)(flags &~AUDIO_OUTPUT_FLAG_DEEP_BUFFER);
+ } else if (/* stream == AUDIO_STREAM_MUSIC && */
+ flags == AUDIO_OUTPUT_FLAG_NONE &&
+ property_get_bool("audio.deep_buffer.media", false /* default_value */)) {
+ // use DEEP_BUFFER as default output for music stream type
+ flags = (audio_output_flags_t)AUDIO_OUTPUT_FLAG_DEEP_BUFFER;
}
if (stream == AUDIO_STREAM_TTS) {
flags = AUDIO_OUTPUT_FLAG_TTS;