I'm gettinga delay of .5+ seconds on all audio output.
This really messes with my perception of game synchronization.
The current fragment size is a fixed uint. Here's what you need to make
it work on the fly.
Calculation loop is:
<rate> - sample rate
<byte> - bytes per sample
<secdelay> - 1/x second delay
/*
* calculate < 1/<secdelay> second delay for the fragment size
* assuming 2 bytes per sample
*/
fragment_size = 0;
uint tempSamp = (<rate> * <byte>) / <secdelay>;
while ( tempSamp > 0 ) {
++fragment_size;
tempSamp >>= 1;
}
I've done a 1/30 delay but it seems too short with the buffer values I have.
I get choppy audio in some places, but at least where it works the audio looks like
it's happening with the video I'm seeing.
I'm only manipulating the OSS driver code for now because the ALSA code is
failing to initialize (I think it's a configuration issue on my system).