I am just wondering what the main difference between SDL Mixer and SDL Sound support libraries. From what I can tell, SDL Mixer is better supported and both seem to be similar or the same library.
SDL_sound is just focused on decoding, while SDL_mixer does both
decoding and playback. The long term plan has been to replace
SDL_mixerâs decoding backend to use SDL_sound.
-EricOn 11/22/09, C.W. Betts wrote:
I am just wondering what the main difference between SDL Mixer and SDL Sound
support libraries. From what I can tell, SDL Mixer is better supported and
both seem to be similar or the same library.
[âŚ]
SDL_sound is just focused on decoding, while SDL_mixer does both
decoding and playback. The long term plan has been to replace
SDL_mixerâs decoding backend to use SDL_sound.
Speaking of which, there has also been discussion on desired features for a
future SDL_mixer (or replacement) like that. Apart from treating music and
sound effects the same (for crossfading songs etc), some users have asked for
real time pitch control and other stuff like that.
Has there been any work done on this?
(Iâll need something like this soon. Just thinking it might be a better idea
to collaborate around an SDL_mixer evolution/replacement, instead of me
hacking it as an integral part of my next sound engine.)On Tuesday 24 November 2009, at 00.24.22, âE. Wingâ wrote:
â
//David Olofson - Developer, Artist, Open Source Advocate
.â Games, examples, libraries, scripting, sound, music, graphics â.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
â---------------------------------------------------------------------â
how about rewriting sdl_mixer as a contex creator for openal, much like sdl
can be a contex creator for opengl?
openal is fullycrossplatform and can handle much more events, queues and
effects, as well as 3d sound!
what do you think of this idea?
VittorioOn Tue, Nov 24, 2009 at 1:53 AM, David Olofson wrote:
On Tuesday 24 November 2009, at 00.24.22, âE. Wingâ wrote:
[âŚ]SDL_sound is just focused on decoding, while SDL_mixer does both
decoding and playback. The long term plan has been to replace
SDL_mixerâs decoding backend to use SDL_sound.Speaking of which, there has also been discussion on desired features for a
future SDL_mixer (or replacement) like that. Apart from treating music and
sound effects the same (for crossfading songs etc), some users have asked
for
real time pitch control and other stuff like that.Has there been any work done on this?
(Iâll need something like this soon. Just thinking it might be a better
idea
to collaborate around an SDL_mixer evolution/replacement, instead of me
hacking it as an integral part of my next sound engine.)â
//David Olofson - Developer, Artist, Open Source Advocate.â Games, examples, libraries, scripting, sound, music, graphics â.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
â---------------------------------------------------------------------â
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
â
Marie von Ebner-Eschenbachhttp://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html
- âEven a stopped clock is right twice a day.â
I donât know⌠It might do the job in most of the cases where SDL_mixer is
used. What I have in mind is something that can also serve as a back-end for
MOD players, MIDI players, synthesizers etc - that is, basically what you want
from a serious sound effects engine, with the addition of (at least)
millisecond accurate timing.
Does OpenAL provide sufficient timing accuracy for music? (On the ânote-by-
noteâ level, that is; not streaming.)
How does it scale to low end integer-only CPUs?
Either way, does OpenAL actually need a context creator for portabilityâŚ?On Tuesday 24 November 2009, at 02.26.24, âVittorio G.â <vitto.giova at yahoo.it> wrote:
how about rewriting sdl_mixer as a contex creator for openal, much like sdl
can be a contex creator for opengl?
openal is fullycrossplatform and can handle much more events, queues and
effects, as well as 3d sound!what do you think of this idea?
â
//David Olofson - Developer, Artist, Open Source Advocate
.â Games, examples, libraries, scripting, sound, music, graphics â.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
â---------------------------------------------------------------------â
how about rewriting sdl_mixer as a contex creator for openal, much like
sdl
can be a contex creator for opengl?
openal is fullycrossplatform and can handle much more events, queues and
effects, as well as 3d sound!what do you think of this idea?
I donât know⌠It might do the job in most of the cases where SDL_mixer is
used. What I have in mind is something that can also serve as a back-end
for
MOD players, MIDI players, synthesizers etc - that is, basically what you
want
from a serious sound effects engine, with the addition of (at least)
millisecond accurate timing.
Well openal is used to reproduce any kind of sound data that is loaded in
source data, so as long as the stream is properly decoded there should be no
problem in reproducing any sound! For example a wav file can be played
directly by loading in memory its pcm data, but also an ogg file by decoding
it first.
I donât have experience about midi and mods but i suppose that they are
files with one heades and some data that can be read using information
contained in the header⌠but letâs think about it: do we need openal
features for some midi effects? we could leave the old decoder in sdl_mixer
for such files
Does OpenAL provide sufficient timing accuracy for music? (On the ânote-by-
noteâ level, that is; not streaming.)
i believe so, but i havenât digged enough in the api to support my statement
How does it scale to low end integer-only CPUs?
Either way, does OpenAL actually need a context creator for portability�
Well there was the equivalent GLUT library, that is ALUT, but itâs not
officially part of the standard and support has been controversial⌠right
now itâs pretty much dead and replaced by ALURE
and, no, you can create your own contex creator and write yourself the
various loaders, but thatâs where SDL_mixer would come in play! If SDL_mixer
provided a simple way to initialize the context, select wheter hardware or
software sound, and load wav, mp3 and ogg files easily (also in streaming),
then the user would exposed to all the OpenAL API, which would work on
windows/linux/macos (iphone included)
VittorioOn Tue, Nov 24, 2009 at 8:20 AM, David Olofson wrote:
On Tuesday 24 November 2009, at 02.26.24, âVittorio G.â < vitto.giova at yahoo.it> wrote:
â
Charles de Gaullehttp://www.brainyquote.com/quotes/authors/c/charles_de_gaulle.html
- âThe better I get to know men, the more I find myself loving dogs.â
[âŚ]
Well openal is used to reproduce any kind of sound data that is loaded in
source data, so as long as the stream is properly decoded there should be
no problem in reproducing any sound! For example a wav file can be played
directly by loading in memory its pcm data, but also an ogg file by
decoding it first.
Yes, I know that much - but what Iâm talking about is quite a bit beyond just
correctly playing back pre-rendered raw audio âapproximatelyâ when you want it
played.
Anyway, Iâve been browsing the OpenAL documentation, trying to find out if
itâs capable of doing what I need.
I donât have experience about midi and mods but i suppose that they are
files with one heades and some data that can be read using information
contained in the header⌠but letâs think about it: do we need openal
features for some midi effects? we could leave the old decoder in sdl_mixer
for such files
Well, yes, one could hack that out of SDL_mixer - or just use SDL_sound, which
is already designed to be used like that.
However, itâs not always an option to decode the whole file and just play back
the raw data. Handheld devices are rather popular these days - and they
generally donât have the kind of memory youâd need to hold full songs in raw
format. Looped songs, interactive music and stuff like that also needs
streaming. (Well, you could âfakeâ some of that if you have some way of
starting buffers with sample accurate timingâŚ)
Anyway, OpenAL seems to handle this just fine with alSourceQueueBuffers() and
friends. (Asynchronous buffering, so you donât have to worry about callbacks
running in âreal time contextâ.)
The problem with that is that it provides only this interface - no âreal
time contextâ callbacks. So, apparently, you cannot implement custom real time
processing with minimal and consistent latency - which is pretty much the core
of what I intend to do.
And, I can see why OpenAL is designed this way too: This sort of âaudio
context hackingâ just doesnât mix very well with hardware acceleration, in
much the same way that hardware accelerated graphics rendering doesnât mix too
well with software rendering. The CPU/âspecialized hardwareâ synchronization
and interaction would need to go way beyond what a general purpose OS and
standard drivers can support. (Doing this all in software is bad enough, and
thatâs just one critical deadline per audio bufferâŚ! Each
hardware/software connection adds another such point.)
As to âdecodingâ MODs and MIDIs, Iâm not talking about rendering them into raw
audio using a complete synth/sampler, but rather using this new âmixerâ to
play and mix individual sounds.
The critical part here is the timing, which needs to be millisecond accurate
or better; preferably sample accurate. Thereâs no way youâll ever accomplish
that without direct callbacks from the audio thread (which BTW may not even
exist on the software side when using hardware acceleration), or timestamped
commands/events. AFAICT from the documentation, OpenAL provides neither.
Does OpenAL provide sufficient timing accuracy for music? (On the
ânote-by- noteâ level, that is; not streaming.)i believe so, but i havenât digged enough in the api to support my
statement
I cannot see how that would be possible with the OpenAL 1.1 API, but I could
be missing something⌠No mention of timestamps or anything like that, and
the Source state transition commands (alSourcePlay() and co) have no other
arguments than the names of the objects to operate on.
I suppose OpenAL does timestamp those calls internally to maintain somewhat
constant latency, but thatâs nowhere near sufficient for music on a normal
operating system. Youâd need to run the music calls from a thread thatâs
scheduled with millisecond accurate timing, which is just barely possible with
a properly configured Mac OS X or Linux audio workstation.
How does it scale to low end integer-only CPUs?
Either way, does OpenAL actually need a context creator for
portabilityâŚ?Well there was the equivalent GLUT library, that is ALUT, but itâs not
officially part of the standard and support has been controversial⌠right
now itâs pretty much dead and replaced by ALURE
and, no, you can create your own contex creator and write yourself the
various loaders, but thatâs where SDL_mixer would come in play!
I see⌠That would be motivated then, I guess.
If SDL_mixer provided a simple way to initialize the context, select wheter
hardware or software sound, and load wav, mp3 and ogg files easily (also
in streaming), then the user would exposed to all the OpenAL API, which
would work on windows/linux/macos (iphone included)
That would be nice, of course.
Anyway, it seems like that âsampler/synth/mixerâ thing I want would still need
itâs own mixer then. Of course, you could have it stream through an OpenAL
Source, if you want to use OpenAL as well⌠That mixer and the related code
(application or third party libraries) would do their sample accurate timing
stuff in âvirtual timeâ, and just output a raw audio stream to send to your
audio output API of choice.On Tuesday 24 November 2009, at 16.33.56, âVittorio G.â <vitto.giova at yahoo.it> wrote:
â
//David Olofson - Developer, Artist, Open Source Advocate
.â Games, examples, libraries, scripting, sound, music, graphics â.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
â---------------------------------------------------------------------â