diff options
author | Satya Krishna Pindiproli <satyak@codeaurora.org> | 2015-11-03 17:30:46 +0530 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-12-19 02:46:24 -0500 |
commit | 53c13f5281032650995e1bab9ab4232c932ae654 (patch) | |
tree | 546cf3afdb1faf6e34c47e231c6ac584174f6042 /services | |
parent | a58a4799f230632d3df4d98a3082c12c0f9fe8b0 (diff) | |
download | frameworks_av-53c13f5281032650995e1bab9ab4232c932ae654.zip frameworks_av-53c13f5281032650995e1bab9ab4232c932ae654.tar.gz frameworks_av-53c13f5281032650995e1bab9ab4232c932ae654.tar.bz2 |
audioflinger: update multiplier logic to calculate frameCount
If the value of the multiplier used in calculating
mNormalFrameCount is odd, it is rounded off to a higher even value.
This results in an increase of mNormalFrameCount and thereby
the latency which is not expected.
Do not prefer an even multiplier and let the value remain as is
even if it is odd.
CRs-Fixed: 931454
Change-Id: Ia60d87d01caef6f45998bffeafc3d6a24f7c7fb4
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/Threads.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 71673c3..8c59282 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -2185,6 +2185,7 @@ void AudioFlinger::PlaybackThread::readOutputParameters_l() kUseFastMixer == FastMixer_Dynamic)) { size_t minNormalFrameCount = (kMinNormalSinkBufferSizeMs * mSampleRate) / 1000; size_t maxNormalFrameCount = (kMaxNormalSinkBufferSizeMs * mSampleRate) / 1000; + // round up minimum and round down maximum to nearest 16 frames to satisfy AudioMixer minNormalFrameCount = (minNormalFrameCount + 15) & ~15; maxNormalFrameCount = maxNormalFrameCount & ~15; @@ -2200,19 +2201,6 @@ void AudioFlinger::PlaybackThread::readOutputParameters_l() } else { multiplier = (double) maxNormalFrameCount / (double) mFrameCount; } - } else { - // prefer an even multiplier, for compatibility with doubling of fast tracks due to HAL - // SRC (it would be unusual for the normal sink buffer size to not be a multiple of fast - // track, but we sometimes have to do this to satisfy the maximum frame count - // constraint) - // FIXME this rounding up should not be done if no HAL SRC - uint32_t truncMult = (uint32_t) multiplier; - if ((truncMult & 1)) { - if ((truncMult + 1) * mFrameCount <= maxNormalFrameCount) { - ++truncMult; - } - } - multiplier = (double) truncMult; } } mNormalFrameCount = multiplier * mFrameCount; |