summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/FastMixer.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-05-11 15:19:24 -0700
committerGlenn Kasten <gkasten@google.com>2012-05-11 15:21:26 -0700
commite58ccce45598bcf4b4874b0e87cd1eb8d05ba9a9 (patch)
tree03b73370e77533c245dddacdcfe91bcbf5760700 /services/audioflinger/FastMixer.cpp
parentc20f467d54f921730aa0b2fd087ad83496aeaf4b (diff)
downloadframeworks_av-e58ccce45598bcf4b4874b0e87cd1eb8d05ba9a9.zip
frameworks_av-e58ccce45598bcf4b4874b0e87cd1eb8d05ba9a9.tar.gz
frameworks_av-e58ccce45598bcf4b4874b0e87cd1eb8d05ba9a9.tar.bz2
Fix 2 bugs in fast mixer statistics
Was losing the upper half of the bounds, and MHz was off. Change-Id: I61c98027b35ce7c3578ea6f3acf05aa5c48a5831
Diffstat (limited to 'services/audioflinger/FastMixer.cpp')
-rw-r--r--services/audioflinger/FastMixer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp
index 1492a36..04d0f65 100644
--- a/services/audioflinger/FastMixer.cpp
+++ b/services/audioflinger/FastMixer.cpp
@@ -467,7 +467,7 @@ bool FastMixer::threadLoop()
#ifdef FAST_MIXER_STATISTICS
// advance the FIFO queue bounds
size_t i = bounds & (FastMixerDumpState::kSamplingN - 1);
- bounds = (bounds + 1) & 0xFFFF;
+ bounds = (bounds & 0xFFFF0000) | ((bounds + 1) & 0xFFFF);
if (full) {
bounds += 0x10000;
} else if (!(bounds & (FastMixerDumpState::kSamplingN - 1))) {
@@ -621,7 +621,7 @@ void FastMixerDumpState::dump(int fd)
loadNs.sample(sampleLoadNs);
kHz.sample(sampleCpukHz & ~0xF);
if (sampleCpukHz == previousCpukHz) {
- double megacycles = (double) sampleLoadNs * (double) sampleCpukHz;
+ double megacycles = (double) sampleLoadNs * (double) sampleCpukHz * 1e-12;
double adjMHz = megacycles / mixPeriodSec; // _not_ wallNs * 1e9
loadMHz.sample(adjMHz);
}