Go to file
Eric Laurent d3fc8ac6c5 Fix issue 2292062: Audio freezes for three seconds when choosing ringtones with a headset connected and music playing.
The problem comes from a deadlock with AudioPolicyService mutex: When the second ringtone starts,
this mutex is locked by AudioPolicyService::startOutput() which in turn calls setParameters() to change the output device.
Audioflinger::ThreadBase::setParameters() signals the parameter change to the AudioFlinger mixer thread and waits for a condition
indicating that the parameter change has been processed.
At the same time, the mixer thread detects that the audio track corresponding to the first ring tone has been killed and calls its destructor.
This calls AudioPolicyService::releaseOutput() which tries to lock the AudioPolicyService mutex.
If this happens before the mixer thread can process the setParameters() command we are deadlocked.
The deadlock ends because setParameters() uses a timeout when waiting for the condition.

This regression was introduced by change 33736 fixing issue 2265163.

The fix consists in calling AudioPolicyService::releaseOutput() from Track::destroy() instead of from Track destructor: as detroy() is never called from the mixer thread loop (as opposed to the destructor) the deadlock described above cannot occur.
2009-12-01 02:17:41 -08:00
awt Removed system/framework/android.awt.jar. 2009-07-02 14:11:33 -05:00
camera/libcameraservice Fix issue 2192673: Music Pausing Even when notifications are set to silent. 2009-11-27 05:07:55 -08:00
cmds keystore: remove old implementation and test. 2009-09-24 13:35:26 +08:00
include fix some aspects of [2258746] native crash in launcher2 2009-11-13 15:26:29 -08:00
libs Fix issue 2292062: Audio freezes for three seconds when choosing ringtones with a headset connected and music playing. 2009-12-01 02:17:41 -08:00
opengl fix [2069023] STOPSHIP: disable DEBUG_COPYBIT 2009-11-30 12:10:53 -08:00
vpn/java/android/net/vpn Remove deprecated VpnType.getDescription(). 2009-09-30 18:39:48 +08:00
MODULE_LICENSE_APACHE2
NOTICE