summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-06-11 14:38:48 -0700
committerEric Laurent <elaurent@google.com>2013-06-11 14:57:08 -0700
commitd0107bcd44fe608b0c00a8843d19fb6356c4cb69 (patch)
treeed820c80ced11b73b1ed88899c182b83b186429f /services
parentba696bbff88d5627beaa0be95be78ba30138983d (diff)
downloadframeworks_av-d0107bcd44fe608b0c00a8843d19fb6356c4cb69.zip
frameworks_av-d0107bcd44fe608b0c00a8843d19fb6356c4cb69.tar.gz
frameworks_av-d0107bcd44fe608b0c00a8843d19fb6356c4cb69.tar.bz2
audioflinger: fix effects on direct output threads
PlaybackThread::addTrack_l() uses the assumption that effects are attached to a track only if the track accumulation buffer is different from the mixer thread output buffer. This is not true for direct output threads where only one track is active an only one buffer is needed. This assumption is an optimization to avoid checking for effect chains with the same session ID each time a track is processed. The optimization is not key if only one track is attached to the thread which is the case for direct outputs. Current code fails to increment the active track count in the effect chain on direct output threads when a track is started thus making the effect framework clear the mix buffer and produce silence each time the mixer runs. The fix consists in removing the optimization described above. Bug: 9324989. Change-Id: Id7a6337450ed90d326299c2ce9fc02f4b9e2fa6f
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/Threads.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 6422b23..97f66f4 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -1330,13 +1330,11 @@ status_t AudioFlinger::PlaybackThread::addTrack_l(const sp<Track>& track)
track->mResetDone = false;
track->mPresentationCompleteFrames = 0;
mActiveTracks.add(track);
- if (track->mainBuffer() != mMixBuffer) {
- sp<EffectChain> chain = getEffectChain_l(track->sessionId());
- if (chain != 0) {
- ALOGV("addTrack_l() starting track on chain %p for session %d", chain.get(),
- track->sessionId());
- chain->incActiveTrackCnt();
- }
+ sp<EffectChain> chain = getEffectChain_l(track->sessionId());
+ if (chain != 0) {
+ ALOGV("addTrack_l() starting track on chain %p for session %d", chain.get(),
+ track->sessionId());
+ chain->incActiveTrackCnt();
}
status = NO_ERROR;