summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-10-20 09:17:04 -0700
committerEric Laurent <elaurent@google.com>2011-10-20 09:17:04 -0700
commit497fb4566204c88bd247aafc2412ddef8f85e480 (patch)
tree8365d556474b5dca23947c0a6750b2f8c243965b /audio
parente43c5c4ca4477a6b384711552c3e990609039d93 (diff)
downloadhardware_libhardware_legacy-497fb4566204c88bd247aafc2412ddef8f85e480.zip
hardware_libhardware_legacy-497fb4566204c88bd247aafc2412ddef8f85e480.tar.gz
hardware_libhardware_legacy-497fb4566204c88bd247aafc2412ddef8f85e480.tar.bz2
Fix music heard in speaker before notifications.
Increase the delay after muting music when switching audio path to both speaker and headset for notifications and ringtones. This is required to avoid a residual of music to be output to speaker now that the max latency has been increased in low power playback mode. This is a temporary workaround that will be removed when low power mode is controlled policy manager. Change-Id: If08e7f46e499be362badb2a24a79d1723ebfc00a
Diffstat (limited to 'audio')
-rw-r--r--audio/AudioPolicyManagerBase.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp
index 191ba9d..e299db8 100644
--- a/audio/AudioPolicyManagerBase.cpp
+++ b/audio/AudioPolicyManagerBase.cpp
@@ -1803,7 +1803,9 @@ void AudioPolicyManagerBase::setOutputDevice(audio_io_handle_t output, uint32_t
if (output == mHardwareOutput && AudioSystem::popCount(device) == 2) {
setStrategyMute(STRATEGY_MEDIA, true, output);
// wait for the PCM output buffers to empty before proceeding with the rest of the command
- usleep(outputDesc->mLatency*2*1000);
+ // FIXME: increased delay due to larger buffers used for low power audio mode.
+ // remove when low power audio is controlled by policy manager.
+ usleep(outputDesc->mLatency*8*1000);
}
// do the routing