summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Coucheron <arco68@gmail.com>2013-09-05 00:18:55 +0200
committerArne Coucheron <arco68@gmail.com>2013-09-05 00:20:50 +0200
commit229bb7f982908feea6bf0d13eede5918f6377eb7 (patch)
tree289271c45a2c577c73df8c8dd17cd45f924264ae
parentc6d665d6d09eeb46bb428c6dad8023c6c6e83a9b (diff)
downloadframeworks_av-229bb7f982908feea6bf0d13eede5918f6377eb7.zip
frameworks_av-229bb7f982908feea6bf0d13eede5918f6377eb7.tar.gz
frameworks_av-229bb7f982908feea6bf0d13eede5918f6377eb7.tar.bz2
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
-rw-r--r--media/libstagefright/LPAPlayerALSA.cpp5
1 files changed, 4 insertions, 1 deletions
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