replicant-frameworks_native/libs/audioflinger
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
..
A2dpAudioInterface.cpp Fix issue 2174002: After rejecting Call when device ringtone is mute and playing music, audio is not transfered to BT device. 2009-10-08 12:03:51 -07:00
A2dpAudioInterface.h Fix issue 2174002: After rejecting Call when device ringtone is mute and playing music, audio is not transfered to BT device. 2009-10-08 12:03:51 -07:00
Android.mk Fix firestone build 2009-07-29 09:47:23 -07:00
AudioBufferProvider.h Add virtual destructor. 2009-07-07 11:03:13 -07:00
AudioDumpInterface.cpp Improved unit test code for Audioflinger. 2009-08-07 09:32:06 -07:00
AudioDumpInterface.h Improved unit test code for Audioflinger. 2009-08-07 09:32:06 -07:00
AudioFlinger.cpp 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
AudioFlinger.h Issue 2265163: Audio still reported routed through earpiece on sholes 2009-11-19 23:57:45 -08:00
AudioHardwareGeneric.cpp Fix issue 1795088 Improve audio routing code 2009-07-23 06:03:39 -07:00
AudioHardwareGeneric.h Fix issue 1795088 Improve audio routing code 2009-07-23 06:03:39 -07:00
AudioHardwareInterface.cpp Fix getParameters() default implementation. 2009-08-04 06:17:43 -07:00
AudioHardwareStub.cpp Fix getParameters() default implementation. 2009-08-04 06:17:43 -07:00
AudioHardwareStub.h Fix getParameters() default implementation. 2009-08-04 06:17:43 -07:00
AudioMixer.cpp Fix issue 1795088 Improve audio routing code 2009-07-23 06:03:39 -07:00
AudioMixer.h Fix issue 1795088 Improve audio routing code 2009-07-23 06:03:39 -07:00
AudioPolicyManagerGeneric.cpp Log for issue 2203561. 2009-11-03 09:33:35 -08:00
AudioPolicyManagerGeneric.h Log for issue 2203561. 2009-11-03 09:33:35 -08:00
AudioPolicyService.cpp More log for issue 2242381. 2009-11-07 01:18:20 -08:00
AudioPolicyService.h More log for issue 2242381. 2009-11-07 01:18:20 -08:00
AudioResampler.cpp
AudioResampler.h
AudioResamplerCubic.cpp
AudioResamplerCubic.h
AudioResamplerSinc.cpp
AudioResamplerSinc.h