[openal] A 5.1 32-bit source kills a stereo 16-bit one on OpenAL Soft
lg at inequation.org
Fri Oct 3 11:22:18 EDT 2014
I'm experiencing a bug in OpenAL Soft 1.13 on Linux where with two sources
playing, only one can be heard. The exact use case is as follows:
a) gameplay audio → custom software audio mixer → OpenAL AL_FORMAT_STEREO16
44100Hz streamed (queued buffers) source,
b) video clips → OpenAL AL_FORMAT_51CHN32 44100Hz streamed source.
The symptom is that gameplay audio does not play when video clips are
playing as well. However, if I "cherry-pick" video clip channels to stereo
like this and play it as AL_FORMAT_STEREO32 instead:
float tmp[ audio->frames * sizeof( *audio->samples ) * 2 ];
for( int i = 0; i < audio->frames; ++i )
int L = i * audio->channels + ( 0 % audio->channels );
int R = i * audio->channels + ( 1 % audio->channels );
tmp[ i * 2 + 0 ] = audio->samples[ L ];
tmp[ i * 2 + 1 ] = audio->samples[ R ];
alBufferData( buffer, getFormatForChannelCount( 2 ), tmp, audio->frames
* sizeof( *audio->samples ) * 2, audio->freq );
Then gameplay audio can be heard all right.
There are no other sources playing. Both sources have been put at (0,0,0)
with AL_SOURCE_RELATIVE set to AL_TRUE, with AL_MAX_DISTANCE and
AL_MIN_GAIN at 1.f. Preliminary debugging within OpenAL Soft shows that
both sources are active (I've put breakpoints in aluMixData() and inspected
Am I hitting a known caveat? Or is there anything else I can do to quickly
diagnose the problem?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the openal