FW: [Openal] Release build problems

Peter Mares pmares at controlshift.co.za
Wed Jul 6 10:46:21 PDT 2005


Ok, I've managed to reproduce the error in a stripped down piece of
code:

Here is pseudo code for the problem:

Main function()
{
	Initialise OpenAL;
	Create OpenAL Context;
	Make the context current;
	Create 2 buffers;
	Create 2 sources;
	Load a WAV file into each buffer;
	Assign each buffer to a source;
	Create Thread 1;
	Create Thread 2;
	Wait for Threads to exit;
	ShutDown OpenAL;
}

Thread1 Function()
{
	Wait for key input;
	If '1' was pressed
		Play Source #1;
	else if '2' was pressed
		Play Source #2;
}

Thread2 Function()
{
	Wait for key input;
	If '3' was pressed
		Play Source #1;
	else if '4' was pressed
		Play Source #2;
}

What you observe is that as soon as source #1 is played from within the
context of a particular thread, lets say thread 1, any attempts at
playing source #1 on the alternative thread produce no sound (as well as
no error).

I suppose I would have to ensure that all sounds get played within the
context of the same thread? But surely this is something OpenAL should
support?

Any comments will be appreciated.
Peter


-----Original Message-----
From: openal-admin at opensource.creative.com
[mailto:openal-admin at opensource.creative.com] On Behalf Of
dpeacock at creativelabs.com
Sent: Wednesday, July 06, 2005 6:19 PM
To: OpenAL Mailing List
Subject: Re: [Openal] Release build problems






Hi Peter,

What version(s) of the AL DLLs are you using (OpenAL32.dll, wrap_oal.dll
and ct_oal.dll (if present)) ?   What AL device are you opening ?

Dan

Daniel Peacock
Custom Engineering Dept.
Creative Labs, Inc.
email : dpeacock at creativelabs.com
phone : (408) 546 6552

Notice
The information in this message is confidential and may be legally
privileged.  It is intended solely for the addressee.  Access to this
message by anyone else is unauthorized.  If you are not the intended
recipient,  any disclosure,  copying or distribution of the message,  or
any action taken by you in reliance on it,  is prohibited and may be
unlawful.  If you have received this message in error,  please delete it
and contact the sender immediately.  Thank you.



 

             "Peter Mares"

             <pmares at controlsh

             ift.co.za>
To 
             Sent by:                  "OpenAL Mailing List"

             openal-admin at open         <openal at opensource.creative.com>

             source.creative.c
cc 
             om

 
Subject 
                                       [Openal] Release build problems

             07/05/2005 01:10

             PM

 

 

 

 





Hi there,

A while ago I posted that I was getting strange behaviour in my release
build with regards to sound playback. Someone suggested that I might
have memory (de)allocation problems, so I checked that out and fixed all
the memory leaks (I had no assertions or overwrites). I still have the
problem.

Allow me to paint a quick picture as to what my code is doing, and then
maybe you can help:

1. I initialise OpenAL in the main thread of the application. 2. The
main thread launches a window which acts as my "control panel" for the
application. Any sounds played from within this window work fine. 3.
When the main thread launches a plugin, a worker thread is created in
which the plugin window is created. 4. Within the plugin, I am
experiencing this problem: A sound will play once, but as soon as it is
finished playing, it will not play again, until I kill and restart the
thread.

This leads me to believe that I am not doing something on a per-thread
basis (perhaps some form of initialisation). Has anyone got any ideas as
to the problem? To summarise, sounds play great while in the main
thread. As soon as I shift to a worker thread context and attempt to
play sounds, each individual sound will only play once (unless I create
a new source and new buffer each time I wish to play a sound, which I
don't really want to do).

Thanks in advance,
Peter
ForwardSourceID:NT0002377E

_______________________________________________
openal mailing list
openal at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal




More information about the Openal mailing list