Parent: 089c397d7aabc63cca82fd56f579bf2537ea73f6
Author: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Committer: Szymon Janc <szymon.janc@tieto.com>
Date: 2014-01-24 11:29:04
Tree: e0c432fe6b8ed1b1dae2f085bdde946f54b3ac1e
android/hal-audio: Workaround AudioFlinger issues Audio HAL code calculates accurate input stream buffer size which allows to fill media packets with as much data as possible. However, in most cases calculated buffer size does not work well with Android audio code which causes glitches when playing simultaneously to different audio output (like notification) or crashes mediaserver when disconnecting with headset. This patch changes input buffer size to fixed magic value 20*512 which is used in Bluedroid Audio HAL. Such change requires that we need to drop assumption that each input buffer can be used to fill exactly one media packet and need to use it to fill multiple media packets. To avoid buffering in Audio HAL, we allow that last media packet can be filled in non-optimal way, i.e. has less data that can fit.
Diffstat
| M | android/hal-audio.c | | | 86 | ++++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1 files changed, 56 insertions(+), 30 deletions(-)