diff ALmixer.h @ 51:e2687188aea5

The evil Apple iOS 5.0 OpenAL regression bug strikes again. A user managed to encounter a case where the OpenAL buffer never unqueues and the workaround gets stuck in an infinite loop which results in the app getting killed by watch dog (crashing). I've added a timeout that will abort the unqueue attempt after 200 milliseconds. But if the buffers could be unqueued but the timeout we picked is too short, then we will regress back to the original problem. All iOS 5 audio users need to test this to make sure their apps don't break again. Please remember to file your Apple bug report if you haven't (bug:10145018), test with iOS 5.1 beta to check for new problems, and report results as necessary. I've also constrained the iOS 5.0 workaround to not run on 5.1 so users can test to see if Apple has fixed the problem. I've also changed the default buffer size to 8k and all the other values accordingly (still targeting about 100k per stream). I encountered some bugs on Mac with 4k buffers. Also running under the memory profile, it appeared that the internal Apple overhead starts to flatten out around 8k which suggests 8k is a better value.
author Eric Wing <ewing@anscamobile.com>
date Wed, 18 Jan 2012 12:17:42 -0800
parents 56855942fdc6
children 36644b1b940b
line wrap: on
line diff
--- a/ALmixer.h	Fri Oct 21 17:14:19 2011 -0700
+++ b/ALmixer.h	Wed Jan 18 12:17:42 2012 -0800
@@ -499,7 +499,7 @@
 #define ALMIXER_DEFAULT_BUFFERSIZE 32768
 #define ALMIXER_DEFAULT_BUFFERSIZE 16384 
 */
-#define ALMIXER_DEFAULT_BUFFERSIZE 4096
+#define ALMIXER_DEFAULT_BUFFERSIZE 8192
 
 /* You probably never need to use these macros directly. */
 #ifndef ALMIXER_DISABLE_PREDECODED_PRECOMPUTE_BUFFER_SIZE_OPTIMIZATION
@@ -520,15 +520,15 @@
 /*
 #define ALMIXER_DEFAULT_QUEUE_BUFFERS 5
 */
-#define ALMIXER_DEFAULT_QUEUE_BUFFERS 25
+#define ALMIXER_DEFAULT_QUEUE_BUFFERS 12
 /**
  * Specifies the number of queue buffers initially filled when first loading a stream.
  * Default startup buffers should be at least 1. */
-#define ALMIXER_DEFAULT_STARTUP_BUFFERS 8
+#define ALMIXER_DEFAULT_STARTUP_BUFFERS 4
 /*
 #define ALMIXER_DEFAULT_STARTUP_BUFFERS 2 
 */
-#define ALMIXER_DEFAULT_BUFFERS_TO_QUEUE_PER_UPDATE_PASS 4
+#define ALMIXER_DEFAULT_BUFFERS_TO_QUEUE_PER_UPDATE_PASS 2
 
 /*
 #define ALMIXER_DECODE_STREAM 	0