Lowered bufferCount in OpenSL ES implementation from 8 to 4 because the base case latency of playing a single sound was terrible/worse than the Audiotrack version (which already contained my latency tweaks from the Martins Mozelko branch).

Lowering this value may negatively affect the mixing throughput for lots of sources. But this is a balancing act to not make the latency worse than the Audiotrack backend.

I tested on Kindle Fire (2.3), Nexus 7 (4.1), Motorola Xoom (3.?), Galaxy SII (2.3.4). In all cases, the latency seems to be about on par with the Audiotrack backend. Somewhat more subjective, the OpenSL ES backend with this change sounded a little cleaner to me.

I picked 4 somewhat arbitrarily. Being burned by non-power-of-two things before, I liked going from 4 to 8 and the latency improved to where I wanted it.

The latency is not really noticable on the Nexus 7 running 4.1 regardless of this change. This suggests a future fix dynamically change this constant back to 8 if running on 4.1+ if the Apportable values were well picked/tested to begin with.
master
Eric Wing 2012-11-01 17:10:56 -07:00 committed by Marc Salem
parent 5d0763b364
commit c5984e2280
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ static long timespecdiff(struct timespec *starttime, struct timespec *finishtime
// thread to mix and enqueue data
#define bufferSize (1024*4)
#define bufferCount 8
#define bufferCount 4
typedef enum {
OUTPUT_BUFFER_STATE_UNKNOWN,