Hello Guest

Streaming not working? Maybe this is the cause:

  • 4 Replies
  • 7876 Views
*

Offline princec

  • *****
  • 1932
    • Puppygames
Streaming not working? Maybe this is the cause:
« on: March 04, 2008, 15:05:41 »
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 :)

*

Offline princec

  • *****
  • 1932
    • Puppygames
Re: Streaming not working? Maybe this is the cause:
« Reply #1 on: March 06, 2008, 15:23:50 »
...and replying to myself: how does one actually find out how many hardware voices there are?

Cas :)

*

Offline Matzon

  • *****
  • 2242
Re: Streaming not working? Maybe this is the cause:
« Reply #2 on: March 06, 2008, 15:31:04 »
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.

Re: Streaming not working? Maybe this is the cause:
« Reply #3 on: March 06, 2008, 17:03:38 »
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

*

Offline princec

  • *****
  • 1932
    • Puppygames
Re: Streaming not working? Maybe this is the cause:
« Reply #4 on: March 07, 2008, 12:00:28 »
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 :)