Streaming not working? Maybe this is the cause:

Started by princec, March 04, 2008, 15:05:41

Previous topic - Next topic

princec

From dpeacock at creativelabs.com  Mon Feb 12 18:10:48 2007:

Quote
AL_INVALID_OPERATION can occur for a few reasons ...

a) Trying to alSourceQueue one or more Buffers on a Source that already has
a Buffer attached to it using alSourcei AL_BUFFER.    (If you are streaming
data to a Source you should always call 'alSourceQueue' to add Buffers to
the Source.)

b) Trying to alSourceQueue one or more Buffers on a Source that have
different Formats or Frequencies.  (All Buffers in a single Source Queue
should have the same Format and Frequency).

c) Running out of voices.    This is possibly the most likely issue -
because it is dependent on the soundcard you have installed.   (If you are
playing a mixture of Stereo and Mono Buffers then you need to be careful
with your Source management because a Source playing a Stereo Buffer
requires two hardware voices instead of one for a Mono Buffer.    If you
know how many Stereo samples you need to play simultaneously then you can
provide that information as a Context Creation 'hint' so that the AL device
reduces the number of Sources that can be generated accordingly.

Cas :)

princec

...and replying to myself: how does one actually find out how many hardware voices there are?

Cas :)

Matzon

you create N sources and on failure you have the current number of available sources. This of course changes 2 seconds later when someone fires up another program which uses a source or 10.

elias4444

I do what Matzon said, except that I first discover how many voices there are, reinitialize the sound system, and only use X number of available voices to take into account streaming background sounds and applications that may be running on the system. The possibility still exists though that someone could eat up too many remaining voices. Ho hum.  :-\
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

princec

Bah, so basically it's a bit useless then if you can't reserve them  >:(

The other problem as highlighted btw, is that sources != voices: stereo sounds take twice as many voices.

Cas :)