summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngela Stegmaier2014-01-23 17:37:45 -0600
committerGerrit Code Review2014-02-02 21:26:49 -0600
commit76b680d6dcf3a08c0e4701729ff8c9e641054353 (patch)
treeec8e07b111cc07c911d92ab1ff75ec5487751886 /audio/multizone/AudioHw.cpp
parent2cb7de7d5c48c3ada7208a9eaef7e9d6aa873677 (diff)
downloaddevice-ti-jacinto6evm-76b680d6dcf3a08c0e4701729ff8c9e641054353.tar.gz
device-ti-jacinto6evm-76b680d6dcf3a08c0e4701729ff8c9e641054353.tar.xz
device-ti-jacinto6evm-76b680d6dcf3a08c0e4701729ff8c9e641054353.zip
audio: Multizone: Don't Round to 16 Input Buffer Size
The input buffer size returned from AudioStreamIn::getBufferSize() and AudioHwDevice::getInputBufferSize() was being rounded to a multiple of 16 with a note that it is required by AudioFlinger, but AudioFlinger has no such requirement for input buffer size (only output buffer size). Rounding to 16 caused an issue for the multizone audio when certain sample rates were used. So, the rounding is removed as it is not needed. Change-Id: I8d5010f5bab7eb780868b47899ea0115fa8c1c4b Signed-off-by: Angela Stegmaier <a0866189@ti.com>
Diffstat (limited to 'audio/multizone/AudioHw.cpp')
-rw-r--r--audio/multizone/AudioHw.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/audio/multizone/AudioHw.cpp b/audio/multizone/AudioHw.cpp
index f25bb43..a532abd 100644
--- a/audio/multizone/AudioHw.cpp
+++ b/audio/multizone/AudioHw.cpp
@@ -393,10 +393,9 @@ size_t AudioStreamIn::getBufferSize() const
393{ 393{
394 size_t size; 394 size_t size;
395 395
396 /* Take resampling ratio into account and align to the nearest 396 /* Take resampling ratio into account */
397 * 16 frames as required by the AudioFlinger */
398 size = (mParams.frameCount * mParams.sampleRate) / mReader->getParams().sampleRate; 397 size = (mParams.frameCount * mParams.sampleRate) / mReader->getParams().sampleRate;
399 size = ((size + 15) & ~15) * mParams.frameSize(); 398 size = size * mParams.frameSize();
400 399
401 ALOGVV("AudioStreamIn: getBufferSize() %u bytes", size); 400 ALOGVV("AudioStreamIn: getBufferSize() %u bytes", size);
402 401
@@ -1032,14 +1031,13 @@ size_t AudioHwDevice::getInputBufferSize(const struct audio_config *config) cons
1032 AutoMutex lock(mLock); 1031 AutoMutex lock(mLock);
1033 size_t size; 1032 size_t size;
1034 1033
1035 /* Take resampling ratio into account and align to the nearest 1034 /* Take resampling ratio into account */
1036 * 16 frames as required by the AudioFlinger */
1037 /* Use port 0 for the calculation, since values for both ports are the same */ 1035 /* Use port 0 for the calculation, since values for both ports are the same */
1038 uint32_t frames = mReaders[kCPUPortId]->getParams().frameCount; 1036 uint32_t frames = mReaders[kCPUPortId]->getParams().frameCount;
1039 uint32_t rate = mReaders[kCPUPortId]->getParams().sampleRate; 1037 uint32_t rate = mReaders[kCPUPortId]->getParams().sampleRate;
1040 1038
1041 size = (frames * config->sample_rate) / rate; 1039 size = (frames * config->sample_rate) / rate;
1042 size = ((size + 15) & ~15) * mReaders[kCPUPortId]->getParams().frameSize(); 1040 size = size * mReaders[kCPUPortId]->getParams().frameSize();
1043 1041
1044 ALOGV("AudioHwDevice: getInputBufferSize() %d bytes", size); 1042 ALOGV("AudioHwDevice: getInputBufferSize() %d bytes", size);
1045 1043