summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/FastMixer.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-03-02 00:04:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-03-02 00:04:35 +0000
commitbf04b5860182d8f4130dcb5d6d88ee68a58c99cd (patch)
treeb68876a589e063ce86f7e24f6e5aff918995f6e2 /services/audioflinger/FastMixer.cpp
parentea2839f133b989b770cc5f093aca4754e5523599 (diff)
parentab7d72f0804fbb7e91ad9d2a16f826d97e20e5d0 (diff)
downloadframeworks_av-bf04b5860182d8f4130dcb5d6d88ee68a58c99cd.zip
frameworks_av-bf04b5860182d8f4130dcb5d6d88ee68a58c99cd.tar.gz
frameworks_av-bf04b5860182d8f4130dcb5d6d88ee68a58c99cd.tar.bz2
Merge "media.log cleanup" into jb-mr2-dev
Diffstat (limited to 'services/audioflinger/FastMixer.cpp')
-rw-r--r--services/audioflinger/FastMixer.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp
index 80e37ca..2832e96 100644
--- a/services/audioflinger/FastMixer.cpp
+++ b/services/audioflinger/FastMixer.cpp
@@ -120,12 +120,13 @@ bool FastMixer::threadLoop()
FastMixerState::Command command = next->mCommand;
if (next != current) {
- logWriter->log("next != current");
-
// As soon as possible of learning of a new dump area, start using it
dumpState = next->mDumpState != NULL ? next->mDumpState : &dummyDumpState;
teeSink = next->mTeeSink;
logWriter = next->mNBLogWriter != NULL ? next->mNBLogWriter : &dummyLogWriter;
+ if (mixer != NULL) {
+ mixer->setLog(logWriter);
+ }
// We want to always have a valid reference to the previous (non-idle) state.
// However, the state queue only guarantees access to current and previous states.
@@ -167,7 +168,6 @@ bool FastMixer::threadLoop()
ALOG_ASSERT(coldFutexAddr != NULL);
int32_t old = android_atomic_dec(coldFutexAddr);
if (old <= 0) {
- logWriter->log("wait");
__futex_syscall4(coldFutexAddr, FUTEX_WAIT_PRIVATE, old - 1, NULL);
}
// This may be overly conservative; there could be times that the normal mixer
@@ -186,7 +186,6 @@ bool FastMixer::threadLoop()
}
continue;
case FastMixerState::EXIT:
- logWriter->log("exit");
delete mixer;
delete[] mixBuffer;
return false;
@@ -264,15 +263,11 @@ bool FastMixer::threadLoop()
unsigned currentTrackMask = current->mTrackMask;
dumpState->mTrackMask = currentTrackMask;
if (current->mFastTracksGen != fastTracksGen) {
- logWriter->logf("gen %d", current->mFastTracksGen);
ALOG_ASSERT(mixBuffer != NULL);
int name;
// process removed tracks first to avoid running out of track names
unsigned removedTracks = previousTrackMask & ~currentTrackMask;
- if (removedTracks) {
- logWriter->logf("removed %#x", removedTracks);
- }
while (removedTracks != 0) {
i = __builtin_ctz(removedTracks);
removedTracks &= ~(1 << i);
@@ -292,9 +287,6 @@ bool FastMixer::threadLoop()
// now process added tracks
unsigned addedTracks = currentTrackMask & ~previousTrackMask;
- if (addedTracks) {
- logWriter->logf("added %#x", addedTracks);
- }
while (addedTracks != 0) {
i = __builtin_ctz(addedTracks);
addedTracks &= ~(1 << i);
@@ -322,17 +314,15 @@ bool FastMixer::threadLoop()
generations[i] = fastTrack->mGeneration;
}
- // finally process modified tracks; these use the same slot
+ // finally process (potentially) modified tracks; these use the same slot
// but may have a different buffer provider or volume provider
unsigned modifiedTracks = currentTrackMask & previousTrackMask;
- if (modifiedTracks) {
- logWriter->logf("modified %#x", modifiedTracks);
- }
while (modifiedTracks != 0) {
i = __builtin_ctz(modifiedTracks);
modifiedTracks &= ~(1 << i);
const FastTrack* fastTrack = &current->mFastTracks[i];
if (fastTrack->mGeneration != generations[i]) {
+ // this track was actually modified
AudioBufferProvider *bufferProvider = fastTrack->mBufferProvider;
ALOG_ASSERT(bufferProvider != NULL);
if (mixer != NULL) {
@@ -453,7 +443,7 @@ bool FastMixer::threadLoop()
ATRACE_END();
dumpState->mWriteSequence++;
if (framesWritten >= 0) {
- ALOG_ASSERT(framesWritten <= frameCount);
+ ALOG_ASSERT((size_t) framesWritten <= frameCount);
dumpState->mFramesWritten += framesWritten;
//if ((size_t) framesWritten == frameCount) {
// didFullWrite = true;
@@ -471,7 +461,7 @@ bool FastMixer::threadLoop()
struct timespec newTs;
int rc = clock_gettime(CLOCK_MONOTONIC, &newTs);
if (rc == 0) {
- logWriter->logTimestamp(newTs);
+ //logWriter->logTimestamp(newTs);
if (oldTsValid) {
time_t sec = newTs.tv_sec - oldTs.tv_sec;
long nsec = newTs.tv_nsec - oldTs.tv_nsec;