diff options
| author | Mingming Yin <mingming@codeaurora.org> | 2013-07-10 14:59:40 -0700 |
|---|---|---|
| committer | Steve Kondik <shade@chemlab.org> | 2013-07-27 03:09:49 -0700 |
| commit | 835e32988648b21cfb426bd4439663a3f7875b99 (patch) | |
| tree | 58c71fe8bf45f58b0b2d76c6de1d189b4822f662 | |
| parent | c35aa49b9eed20ed5e2e94139a116f1215e2d6c0 (diff) | |
| download | frameworks_av-next-rb.tar.gz frameworks_av-next-rb.tar.bz2 frameworks_av-next-rb.zip | |
Frameworks/av: Fix to prevent deadlock in AudioEffectsnext-rb
-Write is blocked waiting for effect chain lock and this causes
decoder thread to wait indefintely.
-Sometimes it is observed that effectschain is locked before
mLPAEffectChain is initialized and but unlocking is skipped if
mLPAEffectChain is initialized in between.Due to this LPA
silence and framework reboot issues are observed as
applyEffectsOn() cannot acquire lock to progress further.
-Use flag to check if all effects have been locked and unlock
accordingly to prevent the deadlock scenario.
(cherry picked from commit 011db22abf565dfbe7f9d0a5c7af7564587b3b48)
CRs-Fixed: 435661, 435664, 435680, 430309
Change-Id: I9e3e0a77ea64ef8c5afbe5a18ee583803a96c99d
| -rw-r--r-- | services/audioflinger/Threads.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 05190271c6..842a3983ec 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -891,7 +891,8 @@ void AudioFlinger::ThreadBase::lockEffectChains_l( { effectChains = mEffectChains; for (size_t i = 0; i < mEffectChains.size(); i++) { - mEffectChains[i]->lock(); + if (mEffectChains[i] != mAudioFlinger->mLPAEffectChain) + mEffectChains[i]->lock(); } } @@ -899,7 +900,8 @@ void AudioFlinger::ThreadBase::unlockEffectChains( const Vector< sp<AudioFlinger::EffectChain> >& effectChains) { for (size_t i = 0; i < effectChains.size(); i++) { - effectChains[i]->unlock(); + if (mEffectChains[i] != mAudioFlinger->mLPAEffectChain) + effectChains[i]->unlock(); } } |
