From a2ab4505c807f42afe34809409c4e85d91618a8c Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Wed, 9 Sep 2015 12:25:51 -0700 Subject: audio flinger: force audio path start from normal mixer The audio HAL wakes up and configures the audio path when receiving the first write() in standby state. This causes a certain amount of process to take place in the mixer threads which is problematic for fast mixer running at FIFO priority. We now force a fake write() of 0 bytes from normal mixer to trigger the audio path configuration before starting the fast mixer. Bug: 23791972. Change-Id: I54311b337fda956444846f5d2f53a3263d54e04b --- services/audioflinger/Threads.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'services/audioflinger/Threads.cpp') diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 0a7d4a2..5bd9149 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -3479,6 +3479,12 @@ ssize_t AudioFlinger::MixerThread::threadLoop_write() if (state->mCommand != FastMixerState::MIX_WRITE && (kUseFastMixer != FastMixer_Dynamic || state->mTrackMask > 1)) { if (state->mCommand == FastMixerState::COLD_IDLE) { + + // FIXME workaround for first HAL write being CPU bound on some devices + ATRACE_BEGIN("write"); + mOutput->write((char *)mSinkBuffer, 0); + ATRACE_END(); + int32_t old = android_atomic_inc(&mFastMixerFutex); if (old == -1) { (void) syscall(__NR_futex, &mFastMixerFutex, FUTEX_WAKE_PRIVATE, 1); -- cgit v1.1 From f99498ee4de7123e2fd71778c6877be44fbd1506 Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Fri, 25 Sep 2015 16:52:55 -0700 Subject: CameraService: Use SCHED_FIFO for request queue thread in HFR - Move SchedulingPolicyService from audioservice to mediautils - When starting up a high speed stream config, set request queue thread to SCHED_FIFO using SchedulingPolicyService Bug: 24227252 Change-Id: I224b59142bd111caf563779f55cddd62385b9bac --- services/audioflinger/Threads.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/audioflinger/Threads.cpp') diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 5bd9149..f586291 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -60,7 +60,7 @@ #include "FastMixer.h" #include "FastCapture.h" #include "ServiceUtilities.h" -#include "SchedulingPolicyService.h" +#include "mediautils/SchedulingPolicyService.h" #ifdef ADD_BATTERY_DATA #include -- cgit v1.1