summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-10-18 15:42:27 -0700
committerEric Laurent <elaurent@google.com>2011-10-18 15:42:27 -0700
commit5c4e818c39ac2d2739675fe907904a874f7623c5 (patch)
treeff76b413d5dad76388cd4afb267c3ee80c5f77b0 /services
parent3c57859f03ce9257128e3b2cd29a906b8f9a6aa5 (diff)
downloadframeworks_av-5c4e818c39ac2d2739675fe907904a874f7623c5.zip
frameworks_av-5c4e818c39ac2d2739675fe907904a874f7623c5.tar.gz
frameworks_av-5c4e818c39ac2d2739675fe907904a874f7623c5.tar.bz2
Limit AudioFlinger log.
AudioFlinger logs a warning when a write to the audio HAL takes too long to return. The threshold for this warning is a rule of thumb based on the assumption that the audio HAL will consume buffers at a regular pace. The introduction of low power audio mode with larger buffers and writes occuring in bursts makes that this threshold is often exceeded resulting in excessive and misleading warnings. The threshold is raised to remove unwanted warnings but we should reconsider the usefulness of this warning altogether. Change-Id: I5ef6898ea28d879cede3e47da542a64092a3cca4
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index ab49f93..3e0304f 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1832,7 +1832,9 @@ bool AudioFlinger::MixerThread::threadLoop()
size_t mixBufferSize = mFrameCount * mFrameSize;
// FIXME: Relaxed timing because of a certain device that can't meet latency
// Should be reduced to 2x after the vendor fixes the driver issue
- nsecs_t maxPeriod = seconds(mFrameCount) / mSampleRate * 3;
+ // increase threshold again due to low power audio mode. The way this warning threshold is
+ // calculated and its usefulness should be reconsidered anyway.
+ nsecs_t maxPeriod = seconds(mFrameCount) / mSampleRate * 15;
nsecs_t lastWarning = 0;
bool longStandbyExit = false;
uint32_t activeSleepTime = activeSleepTimeUs();
@@ -1886,7 +1888,9 @@ bool AudioFlinger::MixerThread::threadLoop()
mixBufferSize = mFrameCount * mFrameSize;
// FIXME: Relaxed timing because of a certain device that can't meet latency
// Should be reduced to 2x after the vendor fixes the driver issue
- maxPeriod = seconds(mFrameCount) / mSampleRate * 3;
+ // increase threshold again due to low power audio mode. The way this warning
+ // threshold is calculated and its usefulness should be reconsidered anyway.
+ maxPeriod = seconds(mFrameCount) / mSampleRate * 15;
activeSleepTime = activeSleepTimeUs();
idleSleepTime = idleSleepTimeUs();
}
@@ -1983,7 +1987,7 @@ bool AudioFlinger::MixerThread::threadLoop()
mInWrite = false;
nsecs_t now = systemTime();
nsecs_t delta = now - mLastWriteTime;
- if (delta > maxPeriod) {
+ if (!mStandby && delta > maxPeriod) {
mNumDelayedWrites++;
if ((now - lastWarning) > kWarningThrottle) {
LOGW("write blocked for %llu msecs, %d delayed writes, thread %p",