summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-02-09 13:35:02 -0800
committerEric Laurent <elaurent@google.com>2011-02-09 13:35:02 -0800
commit8189075377aedb5d879b4f44657bc4b27173de11 (patch)
treea0e93f2d0092f699c88471332d7ae8ffab380f93
parent35cccd55785b27b83fc14faa1afa871c0e422155 (diff)
downloaddevice_samsung_crespo-8189075377aedb5d879b4f44657bc4b27173de11.zip
device_samsung_crespo-8189075377aedb5d879b4f44657bc4b27173de11.tar.gz
device_samsung_crespo-8189075377aedb5d879b4f44657bc4b27173de11.tar.bz2
Fix issue 3436738.
The problem is that the AudioPolicyManager refreshes the device attached to the hardware output stream every time another output stops (in this case A2DP output). As there is no active stream on the HW output, the selected device is 0. As the shutter sound is short and there is some additional delay to setup the A2DP output, the sound is not yet out of the AudioFlinger mixer when the device is set to 0. On Crespo, device 0 is a valid audio path (means audio off) which is not the case on other platforms and therefore the output is disabled while the shutter sound is actually playing. The fix consists in ignoring requests to set the output device to 0 in the audio HAL. Change-Id: I7366e359a7d3a0f8207e7a5c879ced9078224002
-rw-r--r--libaudio/AudioHardware.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp
index 99c38fa..45f0a2d 100644
--- a/libaudio/AudioHardware.cpp
+++ b/libaudio/AudioHardware.cpp
@@ -1241,16 +1241,18 @@ status_t AudioHardware::AudioStreamOutALSA::setParameters(const String8& keyValu
if (param.getInt(String8(AudioParameter::keyRouting), device) == NO_ERROR)
{
- AutoMutex hwLock(mHardware->lock());
+ if (device != 0) {
+ AutoMutex hwLock(mHardware->lock());
- if (mDevices != (uint32_t)device) {
- mDevices = (uint32_t)device;
- if (mHardware->mode() != AudioSystem::MODE_IN_CALL) {
- doStandby_l();
+ if (mDevices != (uint32_t)device) {
+ mDevices = (uint32_t)device;
+ if (mHardware->mode() != AudioSystem::MODE_IN_CALL) {
+ doStandby_l();
+ }
+ }
+ if (mHardware->mode() == AudioSystem::MODE_IN_CALL) {
+ mHardware->setIncallPath_l(device);
}
- }
- if (mHardware->mode() == AudioSystem::MODE_IN_CALL) {
- mHardware->setIncallPath_l(device);
}
param.remove(String8(AudioParameter::keyRouting));
}