[Openal] Multiple local players

Daniel PEACOCK dpeacock at creativelabs.com
Mon Nov 26 13:00:02 PST 2007





Multiple Contexts on a single Device are not well supported in Creative's
OpenAL implementations - so should probably be avoided unless you ship your
own 'known' OpenAL implementation.

I think Buffers technically belong to a Device so you can't share Buffers
across multiple Devices.

This means supporting multiple Listeners (on a single Context & Device)
requires some work on the application side.   Assuming you want to have all
the sound effects "heard" by both Listeners you will need to play each
sound each 2 different Sources (they can share the same audio sample data,
stored in an AL Buffer).   One of the Listeners can be represented by the
AL Listener and all it's sound effect positions can be passed to AL "as
is".   Sound effects for the other game Listener will need to have their 3D
positions rotated and translated based on the position and orientation of
the two listeners.   It would be worth having a cut-off point where
sound-effects are no longer heard by a Listener.

Dan

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.




                                                                           
             Chris Robinson                                                
             <chris.kcat at gmail                                             
             .com>                                                      To 
             Sent by:                  openal at opensource.creative.com      
             openal-bounces at op                                          cc 
             ensource.creative                                             
             .com                                                  Subject 
                                       Re: [Openal] Multiple local players 
                                                                           
             11/24/2007 01:22                                              
             PM                                                            
                                                                           
                                                                           
                                                                           




On Saturday 24 November 2007 12:30:55 pm Charles Pence wrote:
> What's the potential overhead for this look like?  It would seem that
> I'd be loading each buffer into both contexts, keeping a full set of
> sources for both contexts, and manipulating them identically through
> some sort of a wrapper layer (presumably both at around 70% volume to
> prevent clipping?).  How much RAM would that eat up, assuming some
> reasonable number of buffers/sources for a small-ish game (maybe 40 or
> 50 buffers, tops, and maybe sixteen sources/channels per context)?

As far as OpenAL Soft is concerned, sources don't take up much memory (a
bit
over 100 bytes each), and buffers can be shared between devices. However,
in
a hardware environment (eg. with Creative's drivers using accelerated
DirectSound), sources in one context can reduce the number of sources
available for the other context (since you have limitted hardware voices,
which may be taken when the source is created, when a buffer is attached to

it, or when it's played).

I'm also not sure if the spec allows for sharing buffers across devices.
Sources are per-context, but I'm having trouble finding where the spec
mentions the scope of buffers (per-device or global). Hopefully someone
with
more knowledge can say.
_______________________________________________
Openal mailing list
Openal at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal

ForwardSourceID:NT000525FA



More information about the Openal mailing list