summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2009-10-30 11:09:39 -0700
committerEric Laurent <elaurent@google.com>2009-11-02 00:13:56 -0800
commit0bca68cfff161abbc992fec82dc7c88079dd1a36 (patch)
treecd25d6d4e1e1b1b0471849b2f47c744358955c38 /libs
parent9efd523c4611c0cf10e712453a699c083a01064c (diff)
downloadframeworks_base-0bca68cfff161abbc992fec82dc7c88079dd1a36.zip
frameworks_base-0bca68cfff161abbc992fec82dc7c88079dd1a36.tar.gz
frameworks_base-0bca68cfff161abbc992fec82dc7c88079dd1a36.tar.bz2
Fix issue 197683: English IME key-press latency is noticeably higher on passion than sholes. Part 2.
Reduce sleep time in AudioFlinger mixer thread when no data has been written to output to speed up startup time when exiting standby. The rest of the modifications for this issues is in kernel driver: commit 0dbb0ee136ed8de757df1ae26d84556c1751deae for buffer size modification from 8192 to 4800 bytes. Another kernel improvement that is not submitted yes will reduce delay when audio output is exiting standby.
Diffstat (limited to 'libs')
-rw-r--r--libs/audioflinger/AudioFlinger.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index 0960c81..9c0c850 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -1162,7 +1162,7 @@ AudioFlinger::MixerThread::~MixerThread()
bool AudioFlinger::MixerThread::threadLoop()
{
- uint32_t sleepTime = 0;
+ uint32_t sleepTime = 1000;
uint32_t maxBufferRecoveryInUsecs = getMaxBufferRecoveryInUsecs();
int16_t* curBuf = mMixBuffer;
Vector< sp<Track> > tracksToRemove;
@@ -1224,6 +1224,7 @@ bool AudioFlinger::MixerThread::threadLoop()
}
standbyTime = systemTime() + kStandbyTimeInNsecs;
+ sleepTime = 1000;
continue;
}
}
@@ -1591,7 +1592,7 @@ AudioFlinger::DirectOutputThread::~DirectOutputThread()
bool AudioFlinger::DirectOutputThread::threadLoop()
{
- uint32_t sleepTime = 0;
+ uint32_t sleepTime = 1000;
uint32_t maxBufferRecoveryInUsecs = getMaxBufferRecoveryInUsecs();
sp<Track> trackToRemove;
sp<Track> activeTrack;
@@ -1643,6 +1644,7 @@ bool AudioFlinger::DirectOutputThread::threadLoop()
}
standbyTime = systemTime() + kStandbyTimeInNsecs;
+ sleepTime = 1000;
continue;
}
}
@@ -1879,7 +1881,7 @@ AudioFlinger::DuplicatingThread::~DuplicatingThread()
bool AudioFlinger::DuplicatingThread::threadLoop()
{
- uint32_t sleepTime = 0;
+ uint32_t sleepTime = 1000;
uint32_t maxBufferRecoveryInUsecs = getMaxBufferRecoveryInUsecs();
int16_t* curBuf = mMixBuffer;
Vector< sp<Track> > tracksToRemove;
@@ -1940,6 +1942,7 @@ bool AudioFlinger::DuplicatingThread::threadLoop()
}
standbyTime = systemTime() + kStandbyTimeInNsecs;
+ sleepTime = 1000;
continue;
}
}