[Openal] sampling rate bug?
martin at domig.net
Mon Oct 10 12:40:44 PDT 2005
I am using the beta openAL SDK 1.1 on windows and have a weird problem
with sampling rates, which I believe is a bug in openAL (Apples show the
same issue, didnt test on Linux yet).
It is pretty easy to reproduce (I cant produce a patch file here, sorry
for the inconvenience):
In the OpenAL demo program that comes with the SDK, change the sampling
rate in line 2795 to 8000:
lFrequency = 8000;
Then, somewhere around line 2900, add these 4 lines right after the
"When we have enough..." comment line:
if ((lSamplesAvailable > (QUEUEBUFFERSIZE / lBlockAlignment)) &&
printf("%i samples available but no free buffer!\r\n", lSamplesAvailable);
If everything is all right, that printf should never execute (in fact,
when I leave the frequency at 22050 on my system, it doesnt).
Compile the program, start the capture+playback test (I), and wait a
couple of seconds. You will notice nothing, at first, but over time the
delay between recording and playback starts to increase, and sooner or
later you'll see the "samples available but no free buffer" thing that
was just added.
This has been giving me some headaches the last days. It is not the same
on all systems, it seems to depend on the audio hardware and/or audio
drivers. On some system, the audio seems to play back at half speed,
others seem to record faster than I want. But it is there, almost
everywhere (and almost with any sampling rates).
Is this a known issue, a bug in openAL or am I seeing things?
More information about the Openal