From 229bb7f982908feea6bf0d13eede5918f6377eb7 Mon Sep 17 00:00:00 2001 From: Arne Coucheron Date: Thu, 5 Sep 2013 00:18:55 +0200 Subject: libstagefright: Add support for custom LPA buffer size * On msm8930, during playback over A2DP with DSP Manager effects enabled, there's a lot of stuttering with the default buffer size. Stock kernel used a buffer size of 32, but that caused no audio at all in CM because of mismatch in buffer size between kernel and user space. So up until now I've been using a buffer size of 256 to get audio working at all, but unfortunately it causes stuttering as mentioned. Hence add support for a custom buffer size so we can revert to stock value used in kernel, and enjoy no stuttering. Change-Id: Id4d090bc6cf90782c24f3832a35ddeca43bd72fc --- media/libstagefright/LPAPlayerALSA.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/libstagefright/LPAPlayerALSA.cpp b/media/libstagefright/LPAPlayerALSA.cpp index e2f30ed..531064c 100644 --- a/media/libstagefright/LPAPlayerALSA.cpp +++ b/media/libstagefright/LPAPlayerALSA.cpp @@ -52,7 +52,10 @@ static const char mName[] = "LPAPlayer"; #define MEM_METADATA_SIZE 64 -#define MEM_BUFFER_SIZE ((256*1024) - MEM_METADATA_SIZE) +#ifndef LPA_DEFAULT_BUFFER_SIZE +#define LPA_DEFAULT_BUFFER_SIZE 256 +#endif +#define MEM_BUFFER_SIZE ((LPA_DEFAULT_BUFFER_SIZE*1024) - MEM_METADATA_SIZE) #define MEM_BUFFER_COUNT 4 #define PCM_FORMAT 2 #define NUM_FDS 2 -- cgit v1.1