[SOLVED] OpenAL won't update

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
jpleveille
Posts: 1
Joined: Wed Mar 04, 2009 4:36 pm
Location: Montreal, Canada
Contact:

[SOLVED] OpenAL won't update

Post by jpleveille »

Hi, I'm working on a game which uses Irrlicht engine for 3D and OpenAL for sound. Device is instantiated like this:

Code: Select all

IrrlichtDevice *device = createDevice(video::EDT_OPENGL, dimension2d<s32>(480, 320), 16, false, false, false, 0);
Then I do some really simple initializations (such as setting window caption) and then I get to the main loop:

Code: Select all

while(device->run())
{
	app->Update();
}
where the Update() method basically updates game objects and draw the 3D scene.

However my issue is with OpenAL. No matter what I do, PCM data I push using alBufferData() and then alSourceQueueBuffers() is never processed by OpenAL until I move or resize my window (from Irrlicht's device) or I break into my code (in VC9). I think it has something to do with IO or either the message loop because the window appears to enter a state that allows OpenAL to process content pushed in its buffers. As soon as I come back to normal execution of the window, sound in buffer loops on really short samples (which is basically very annoying).

Any idea what could be wrong?
----
Solution: in the end it appears my window callbacks were forcing a play of the current buffer pushed in OpenAL that went starved because of a wrong buffer management (that explains why sometimes, when moving, resizing the window or breaking into the code I could hear short samples of the sound I wanted to be played). Looking at OpenAL samples helped me fix the issue (especially the streaming one).
Last edited by jpleveille on Wed Mar 04, 2009 7:58 pm, edited 1 time in total.
fmx

Post by fmx »

I'm sorry I can't give you any ideas with your OpenAL problems, but I would recommend looking into irrKlang instead.
It's free and its VERY easy to get it working with Irrlicht.
:)
rooly
Posts: 224
Joined: Tue Oct 25, 2005 4:32 pm
Location: Louisiana, USA, backwater country
Contact:

Post by rooly »

well, show us your app->Update() function. maybe somebody can figure it out by that
When banks compete, you win.
When ISPs compete, you win.
When electronics retailers compete, you win.
When governments compete...you get drafted.
Post Reply