[Openal] Re: OpenAL Soft performance question

Chris Robinson chris.kcat at gmail.com
Wed Oct 7 09:26:52 PDT 2009


On Wednesday 07 October 2009 7:56:02 am Jason Daly wrote:
> Not sure if this means anything or not, but...
> 
> 6 (hours) * 3600 (sec/hour) * 48000 (samples/sec) * 2 (channels) =
> 2073600000
> 
> which is fairly close to 2^31 or the max for a signed 32-bit integer.
> Could there be an overflow happening somewhere?

And 2073600000 * 2 (bytes/sample) = 4147200000  which is pretty close to the 
unsigned 32-bit int max. Interesting possibility. There's nothing in OpenAL 
Soft's mixer or its ALSA backend that would have this problem, though. If I 
had to guess, perhaps ALSA overflows an internal count of the total number of 
bytes written, and starts believing there's no available space to write to. 
That causes the device to underrun, which it takes a moment to realize, then 
OpenAL Soft refills the buffer and restarts playback. The internals counters, 
though, aren't reset so it keeps thinking no space is freeing up, and does it 
again.

That's pure conjecture, though. I don't really see why ALSA would keep track 
of the total written bytes any more than OpenAL would. Or that, even if it 
does, it couldn't handle an inevitable overflow or use a 64-bit integer on 
capable systems.


More information about the Openal mailing list