[OpenAL]You can't start multiple sources at the same time?!

This topic is 4498 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

	for(i=0;i<5/;++i)
{
//Sleep(100);
}

After struggling for some time I've figured out what's wrong with my AL implementation, and it is very suprising. In the code above, add_sound_object loads samples for the specified sound type (if required) and queues them against the first unused source in a list. The code shown will result in errors in alGenBuffer and alQueueSource - however if I uncomment the Sleep call it works fine! I'm not using any threads so nothing in my code will be affected by this change - I can only assume that trying to queue/load too many things at the same instant knackers AL's internal threads or something... can anyone corroborate?

Share on other sites
Don't the errors give you any further details?

Share on other sites
I get the error "Invalid Name" from alGenBuffer. This is just plain wierd...

Share on other sites
When you say it works when Sleep() is called, does that mean the errors go away or the sound plays or both? I have not had any problems loading and playing multiple buffers.

What are the size and count of your buffers and how many sources play at once? I don't know what your computer specs are but if it is really slow((less)400Mhz) that may be a problem.

It's very strange that alGenBuffer() would generate an INVALID_NAME error. Make sure you log the value of alGetError() after every OpenAL call.

Oh, and from your other OpenAL thread, playing 7-8 source at once shouldn't be a problem for a reasonable computer.

Share on other sites
The source is quite complex...

I'm playing maybe 5 sources at the same instant, each being queued with 2/3 buffers. With Sleep() enabled, there are no errors and the sounds play. Without it, some of the sources get errors (not all).
The PC is 750MHz.

Do I need to use a Mutex/Ctitical Section with AL if my app is single-threaded - the original source did this but it seems un-needed.

Share on other sites
I don't think you need any of those things. You must be working with some pretty wierd platform/source:) I'll share my audio code. It streams .oggs and play wave files. Maybe it'll help somehow.
openal_audio.zip
Good Luck

1. 1
Rutin
26
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 10
• 10
• 9
• 9
• 10
• Forum Statistics

• Total Topics
631752
• Total Posts
3002091
×