there are 2 of these structures defined in hardware/alsa_sound/AudioHardwareALSA.cpp. Look for
static StreamDefaults _defaults one is for playback, and one for record. You are interested in the one for playback. There are 2 things that are meaningful for this issue in this structure: latency and bufferSize. The interface will first try to get buffer space equivalent for the defined latency. The default now is 1/4 of a second. If for some reason it cannot, then it will attempt to grab a buffer by bufferSize. That default is about 1/3rd of a second. Your 2048 sample buffer is very unreasonable. That equates to about 1/21th of a second of audio play. It will cause extreme overhead in the system and I doubt you will be able to play audio very well. Especially with all the overhead of decoding. You should fix your ALSA driver to allow for a larger buffer. xro wrote: > hi. > > I have a bug on my platform and i need to set the buffer... > > Android would like a buffer of 16384 and i have one of 2048... So i > have to hack a test and the sound is really bad... > > someone know where is the buffersize set? > > thanks > > > --~--~---------~--~----~------------~-------~--~----~ unsubscribe: [email protected] website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---
