Sound and Music

Hi!

My game (which has, in various versions, been in development for years) is
finally nearing completeness, and I’ve gone through a couple of different
audio systems in the process. I’ve stumbled on a couple of issues though,
which I’d very much like to clear up before finalising the system.

  1. SDL_mixer/OpenAL/anything else?

For the first version, I used SDL_mixer. Later, I switched to OpenAL, partly
because I had performance problems with SDL_mixer and stereo panning (I
suppose I did something wrong) but mainly because for a different project I
needed surround sound and wanted to reuse my resource manager. I’m not overly
happy with OpenAL though. The Linux version isn’t up to date, and having
sound effects in surround sound isn’t that exciting when the music comes out
only in mono…

From what I know, the Linux implementation of SDL supports surround sound
through ALSA now, but I believe this isn’t true for other target (e.g.
Windows) and not planned for the forseeable future? Are there any interesting
alternatives I should look into? I know about fmod, but don’t fancy their
license (and never managed to get the thing running on my Debian box anyway).

Of course, I’d also like to keep things as portable as possible. Currently,
I’m using OpenGL for rendering, so OpenAL is fine in that regard, but I’m
trying to keep the possibility of adding an SDL gfx backend to run on other
platforms, and I assume I’d pretty much be out of luck expecting them to
support OpenAL.

  1. Streaming music

For music playback, I use ogg files which I stream from the harddisk. The
problem is that the HD access results in a noticeable performance impact on
at least some systems; every few frames, a frame gets delayed a little longer
because the next bit of the stream is read. I tried to compensate for this by
putting the streaming code in a separate thread, hoping that the I/O blocking
mechanism wouldn’t slow down my gfx routines that way, but the effect is
still noticeable, and of course I now have to fight race conditions as well.

Is there any real gain in putting this in its own thread to begin with? Is
there a recommended buffer size for streaming audio which works reasonably
well for most platforms? Or should I simply cache the entire ogg files and
just decode them on the fly?

  1. Continuous updates

This has perhaps caused me the most trouble. Refreshing the screen is one
thing, because it (hopefully) runs at the display’s refresh rate and the
human eye doesn’t notice the difference. But how should I go about updating
sound volumes and panning for moving sources? Is it enough to update them
once per frame (all I know is that the ears are “quicker” than the eyes), or
would these steps be audible? This also applies to fading music (currently
done in the music thread, see #2).

When these questions are answered, I’m afraid I’ll probably come up with a few
more. :wink:

Thanks in advance,
Marian.–
Hofstadter’s law: “It always takes longer than you think, even when you take
account of Hofstadter’s law”.

Hi!

My game (which has, in various versions, been in development for years) is
finally nearing completeness, and I’ve gone through a couple of different
audio systems in the process. I’ve stumbled on a couple of issues though,
which I’d very much like to clear up before finalising the system.

  1. SDL_mixer/OpenAL/anything else?

For the first version, I used SDL_mixer. Later, I switched to OpenAL, partly
because I had performance problems with SDL_mixer and stereo panning (I
suppose I did something wrong) but mainly because for a different project I
needed surround sound and wanted to reuse my resource manager. I’m not overly
happy with OpenAL though. The Linux version isn’t up to date, and having
sound effects in surround sound isn’t that exciting when the music comes out
only in mono…

If you don’t plan to sell your game (or don’t have the money to buy a
license for commercial project), you may use FMOD and FMOD Ex for free.
I’ve been using FMOD for almost 2 years and IMHO it’s very good, stable,
cross platform, feature-rich etc. API. Now, with the release of FMOD Ex,
it became fantastic, filled with cool features, amazing API, that I
wholeheartly recommend. Read more: http://www.fmod.org/

  1. Streaming music

For music playback, I use ogg files which I stream from the harddisk. The
problem is that the HD access results in a noticeable performance impact on
at least some systems; every few frames, a frame gets delayed a little longer
because the next bit of the stream is read. I tried to compensate for this by
putting the streaming code in a separate thread, hoping that the I/O blocking
mechanism wouldn’t slow down my gfx routines that way, but the effect is
still noticeable, and of course I now have to fight race conditions as well.

Is there any real gain in putting this in its own thread to begin with? Is
there a recommended buffer size for streaming audio which works reasonably
well for most platforms? Or should I simply cache the entire ogg files and
just decode them on the fly?

I never had any problems of this kind with FMOD, everything was playing
smoothly and the overall performance loss was about stable ~1 or ~2 %.

  1. Continuous updates

This has perhaps caused me the most trouble. Refreshing the screen is one
thing, because it (hopefully) runs at the display’s refresh rate and the
human eye doesn’t notice the difference. But how should I go about updating
sound volumes and panning for moving sources? Is it enough to update them
once per frame (all I know is that the ears are “quicker” than the eyes), or
would these steps be audible? This also applies to fading music (currently
done in the music thread, see #2).

With FMOD all of this is done for you :slight_smile:

When these questions are answered, I’m afraid I’ll probably come up with a few
more. :wink:

Thanks in advance,
Marian.

In summary, if you don’t have the time to create your own solutions, I
suggest to use FMOD Ex. Even Blizzard is using FMOD :slight_smile:

Koshmaar

I thought Blizzard used Miles?

(/me is now waiting for Sam to pop up on the list to confirm this)

  • SROn 9/13/05, Koshmaar wrote:

In summary, if you don’t have the time to create your own solutions, I
suggest to use FMOD Ex. Even Blizzard is using FMOD :slight_smile:

FMOD is a really nice x-platform sound API, and Ex has added a C++
interface that is pretty darn nice. Certainly fits more nicely into my
code.On 9/13/05, Koshmaar wrote:

If you don’t plan to sell your game (or don’t have the money to buy a
license for commercial project), you may use FMOD and FMOD Ex for free.
I’ve been using FMOD for almost 2 years and IMHO it’s very good, stable,
cross platform, feature-rich etc. API. Now, with the release of FMOD Ex,
it became fantastic, filled with cool features, amazing API, that I
wholeheartly recommend. Read more: http://www.fmod.org/

Well, this one should be GNU when I finally clean up the code enough to
release it without feeling ashamed. :wink: But I have already plans for a next
game, which will probably come as a shareware version (either that, or it
will probably too much work for us to do it). I’m trying really hard to make
my classes low-level enough to carry them over to that new game, so I’m not
really comfortable with FMOD’s license (I did see the shareware option in the
license, but I’m still not too excited).

Thx,
Marian.On Tuesday 13 September 2005 22:32, Koshmaar wrote:

If you don’t plan to sell your game (or don’t have the money to buy a
license for commercial project), you may use FMOD and FMOD Ex for free.


Hofstadter’s law: “It always takes longer than you think, even when you take
account of Hofstadter’s law”.

Marian Schedenig wrote:>On Tuesday 13 September 2005 22:32, Koshmaar wrote:

If you don’t plan to sell your game (or don’t have the money to buy a
license for commercial project), you may use FMOD and FMOD Ex for free.

Well, this one should be GNU when I finally clean up the code enough to
release it without feeling ashamed. :wink: But I have already plans for a next
game, which will probably come as a shareware version (either that, or it
will probably too much work for us to do it). I’m trying really hard to make
my classes low-level enough to carry them over to that new game, so I’m not
really comfortable with FMOD’s license (I did see the shareware option in the
license, but I’m still not too excited).

Thx,
Marian.

there’s another problem with fmod: no sources!! so you cannot compile
your own static library.
and i tell you what: i really DO NOT WANT to depend my game on any dlls
except os provided dlls. why? i like games that are contained all into
a single exe file. no installation, no unpacking. just download and
start. how should i do it with dlls?
sure, there are commercial tools to embed dlls and all other resources
into the exe file, but then you need some temporary space to unpack the
dlls to this means writing to a probably slow / overfull / write
protected disk and adds platform specific code to detect temp directory
etc.

As he’s planning on it being GPL (I think), I would agree with your
static statement. But if you’re using SDL (which is LGPL), and you
statically link, you must release your source. If you’re cool with
that, I agree. If not, you must dynamically link.

On the windows side, I just include the DLL’s I use that aren’t system
ones right in the directory with the .exe, just like I do on MacOS.
Why do you percieve it to be so difficult? I’ve never needed an
installer that isn’t just a fancy self extracting archive.

On an embeded system, I would actually agree. But I don’t think you’re
talking about that here.On 9/14/05, Andre Krause wrote:

Marian Schedenig wrote:

On Tuesday 13 September 2005 22:32, Koshmaar wrote:

If you don’t plan to sell your game (or don’t have the money to buy a
license for commercial project), you may use FMOD and FMOD Ex for free.

Well, this one should be GNU when I finally clean up the code enough to
release it without feeling ashamed. :wink: But I have already plans for a next
game, which will probably come as a shareware version (either that, or it
will probably too much work for us to do it). I’m trying really hard to make
my classes low-level enough to carry them over to that new game, so I’m not
really comfortable with FMOD’s license (I did see the shareware option in the
license, but I’m still not too excited).

Thx,
Marian.

there’s another problem with fmod: no sources!! so you cannot compile
your own static library.
and i tell you what: i really DO NOT WANT to depend my game on any dlls
except os provided dlls. why? i like games that are contained all into
a single exe file. no installation, no unpacking. just download and
start. how should i do it with dlls?
sure, there are commercial tools to embed dlls and all other resources
into the exe file, but then you need some temporary space to unpack the
dlls to this means writing to a probably slow / overfull / write
protected disk and adds platform specific code to detect temp directory
etc.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Casey O’Donnell
RPI STS Department - Graduate Student

http://homepage.mac.com/codonnell/
http://homepage.mac.com/codonnell/wxsync/
http://homepage.mac.com/codonnell/wxblogger/

Replying to myself…bad sign.

Oh…and on the source thing. Part of that is because they target
platforms that they cannot because of NDA release source. So I guess
they could theoretically have some fancy in-house system (or file
structure) that would strip the source for PS1 (old versions of FMOD),
PS2, GC, XBox, XBox360, PSP before releasing the code…then you’ve
got an inverse problem of a qausi-open project where you’re constantly
having to re-port other people’s work that you actually bring in to
all those other platforms when necessary. Seems overly complicated.

CKOOn 9/14/05, Casey O’Donnell <@Casey_O_Donnell> wrote:

As he’s planning on it being GPL (I think), I would agree with your
static statement. But if you’re using SDL (which is LGPL), and you
statically link, you must release your source. If you’re cool with
that, I agree. If not, you must dynamically link.

On the windows side, I just include the DLL’s I use that aren’t system
ones right in the directory with the .exe, just like I do on MacOS.
Why do you percieve it to be so difficult? I’ve never needed an
installer that isn’t just a fancy self extracting archive.

On an embeded system, I would actually agree. But I don’t think you’re
talking about that here.

On 9/14/05, Andre Krause wrote:

Marian Schedenig wrote:

On Tuesday 13 September 2005 22:32, Koshmaar wrote:

If you don’t plan to sell your game (or don’t have the money to buy a
license for commercial project), you may use FMOD and FMOD Ex for free.

Well, this one should be GNU when I finally clean up the code enough to
release it without feeling ashamed. :wink: But I have already plans for a next
game, which will probably come as a shareware version (either that, or it
will probably too much work for us to do it). I’m trying really hard to make
my classes low-level enough to carry them over to that new game, so I’m not
really comfortable with FMOD’s license (I did see the shareware option in the
license, but I’m still not too excited).

Thx,
Marian.

there’s another problem with fmod: no sources!! so you cannot compile
your own static library.
and i tell you what: i really DO NOT WANT to depend my game on any dlls
except os provided dlls. why? i like games that are contained all into
a single exe file. no installation, no unpacking. just download and
start. how should i do it with dlls?
sure, there are commercial tools to embed dlls and all other resources
into the exe file, but then you need some temporary space to unpack the
dlls to this means writing to a probably slow / overfull / write
protected disk and adds platform specific code to detect temp directory
etc.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Casey O’Donnell
RPI STS Department - Graduate Student

http://homepage.mac.com/codonnell/
http://homepage.mac.com/codonnell/wxsync/
http://homepage.mac.com/codonnell/wxblogger/


Casey O’Donnell
RPI STS Department - Graduate Student

http://homepage.mac.com/codonnell/
http://homepage.mac.com/codonnell/wxsync/
http://homepage.mac.com/codonnell/wxblogger/

In summary, if you don’t have the time to create your own solutions, I
suggest to use FMOD Ex. Even Blizzard is using FMOD :slight_smile:

I thought Blizzard used Miles?

(/me is now waiting for Sam to pop up on the list to confirm this)

  • SR

Quote from FMOD site’s news:

“World of Warcraft Dominates Holiday Sales - This holiday season, demand
for World of Warcraft was so great that more than 600,000 copies of the
game were purchased by customers in North America, Australia, and New
Zealand. With so many copies of World of Warcraft installed, the game
went on to shatter all previous concurrency records in North America,
achieving over 200,000 simultaneous players during the holiday period.
Please see the full press release for more details on these momentous
achievements. FMOD is used as the audio engine for World of Warcraft.”

:slight_smile:

Koshmaar> On 9/13/05, Koshmaar <@Koshmaar> wrote:

i do not bother to have fmod sources, but i really want to have a
statically linkable library.
why? ok, i could just place the dll in the exe’s directory, but then my
simpla plan to have a single exe file, that you can download and
instantly start out of your browser, fails.
sure, i really nice solution is to make an self extracting archive, that
extracts all files in a temp directory, starts the game, after game
finish cleans up temp dir. BUT: you need to know where to write your
temporary stuff, you have a startup-delay, and you probably could fill
up the user harddiskspace. not a good idea. i even would accept to
display a fmod-logo ingame or some sort of inside-exe-signature to have
fmod statically linked.

by the way, i managed it to statically compile openAL… if openAL only
would receive more attention… seems to me that openAL is quite alot beta.

what do you think? is it possible to convince fmod developers to release
static libs?

Casey O’Donnell wrote:>Replying to myself…bad sign.

Oh…and on the source thing. Part of that is because they target
platforms that they cannot because of NDA release source. So I guess
they could theoretically have some fancy in-house system (or file
structure) that would strip the source for PS1 (old versions of FMOD),
PS2, GC, XBox, XBox360, PSP before releasing the code…then you’ve
got an inverse problem of a qausi-open project where you’re constantly
having to re-port other people’s work that you actually bring in to
all those other platforms when necessary. Seems overly complicated.

CKO

On 9/14/05, Casey O’Donnell wrote:

As he’s planning on it being GPL (I think), I would agree with your
static statement. But if you’re using SDL (which is LGPL), and you
statically link, you must release your source. If you’re cool with
that, I agree. If not, you must dynamically link.

On the windows side, I just include the DLL’s I use that aren’t system
ones right in the directory with the .exe, just like I do on MacOS.
Why do you percieve it to be so difficult? I’ve never needed an
installer that isn’t just a fancy self extracting archive.

On an embeded system, I would actually agree. But I don’t think you’re
talking about that here.

On 9/14/05, Andre Krause <@Andre_Krause> wrote:

Marian Schedenig wrote:

On Tuesday 13 September 2005 22:32, Koshmaar wrote:

If you don’t plan to sell your game (or don’t have the money to buy a
license for commercial project), you may use FMOD and FMOD Ex for free.

Well, this one should be GNU when I finally clean up the code enough to
release it without feeling ashamed. :wink: But I have already plans for a next
game, which will probably come as a shareware version (either that, or it
will probably too much work for us to do it). I’m trying really hard to make
my classes low-level enough to carry them over to that new game, so I’m not
really comfortable with FMOD’s license (I did see the shareware option in the
license, but I’m still not too excited).

Thx,
Marian.

there’s another problem with fmod: no sources!! so you cannot compile
your own static library.
and i tell you what: i really DO NOT WANT to depend my game on any dlls
except os provided dlls. why? i like games that are contained all into
a single exe file. no installation, no unpacking. just download and
start. how should i do it with dlls?
sure, there are commercial tools to embed dlls and all other resources
into the exe file, but then you need some temporary space to unpack the
dlls to this means writing to a probably slow / overfull / write
protected disk and adds platform specific code to detect temp directory
etc.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Casey O’Donnell
RPI STS Department - Graduate Student

http://homepage.mac.com/codonnell/
http://homepage.mac.com/codonnell/wxsync/
http://homepage.mac.com/codonnell/wxblogger/

there’s another problem with fmod: no sources!! so you cannot compile
your own static library.

If you buy a license, you get the sources.

and i tell you what: i really DO NOT WANT to depend my game on any dlls
except os provided dlls. why? i like games that are contained all into
a single exe file. no installation, no unpacking. just download and
start. how should i do it with dlls?

Do you realy think it’s possible to create huge commercial game (like
Quake IV, WoW, Unreal Tournament 2004 etc.) which consists of only one
exe, that contains all of game assets? Even when he’s not creating such
a game, still it would be amazingly difficult, and would provide no
important gains / advantages (from programmers point of view). Not to
mention that unpacking everything from such exe would be a slow and
painfull process. And if you think that there’s no need for assets, that
everything can be generated on the fly… how much time will your game
take in the initialization phase, generating every model, texture, sound?

Even SDL needs to have its dll distributed with games (or at least,
that’s how I was doing for years and seen that everyone else was doing
it like me).

The same goes with OpenAL (dll needed) and SDL_Mixer (which can be
linked staticaly, but GNU LGPL requires to distribute sources, or sth
like that).

For clarity, I’m not against your point of view - I also like static
libraries, but your statement about one-exe games is… :-/

sure, there are commercial tools to embed dlls and all other resources
into the exe file, but then you need some temporary space to unpack the
dlls to this means writing to a probably slow / overfull / write
protected disk and adds platform specific code to detect temp directory
etc.

Right, so you also see that one-exe games have no future :slight_smile:

Koshmaar

sure, the big one games do not need this. but they are commercial. but
my little game (just a simple 3d tetris, www.gravytris.tk) is exactly
the sort of games that profit from single .exe style! just download ,
start and have a short, entertaining time.
by the way: all the big games have some sort of archive (.wad, .pak etc)
where thez store textures, sound etc. in compressed form. i do the same,
with the exception that the archive is simply appended to the
executable. so there is no difference.>

there’s another problem with fmod: no sources!! so you cannot compile
your own static library.

If you buy a license, you get the sources.

and i tell you what: i really DO NOT WANT to depend my game on any
dlls except os provided dlls. why? i like games that are contained
all into a single exe file. no installation, no unpacking. just
download and start. how should i do it with dlls?

Do you realy think it’s possible to create huge commercial game (like
Quake IV, WoW, Unreal Tournament 2004 etc.) which consists of only one
exe, that contains all of game assets? Even when he’s not creating
such a game, still it would be amazingly difficult, and would provide
no important gains / advantages (from programmers point of view). Not
to mention that unpacking everything from such exe would be a slow and
painfull process. And if you think that there’s no need for assets,
that everything can be generated on the fly… how much time will your
game take in the initialization phase, generating every model,
texture, sound?

Even SDL needs to have its dll distributed with games (or at least,
that’s how I was doing for years and seen that everyone else was doing
it like me).

The same goes with OpenAL (dll needed) and SDL_Mixer (which can be
linked staticaly, but GNU LGPL requires to distribute sources, or sth
like that).

For clarity, I’m not against your point of view - I also like static
libraries, but your statement about one-exe games is… :-/

sure, there are commercial tools to embed dlls and all other
resources into the exe file, but then you need some temporary space
to unpack the dlls to this means writing to a probably slow /
overfull / write protected disk and adds platform specific code to
detect temp directory etc.

Right, so you also see that one-exe games have no future :slight_smile:

Koshmaar


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

the LGPL allows you to statically link against code which is licensed
under it… you just need to provide the object files for your code so
that someone may link it against another version of the LGPLed code.
It’s hardly practical… but possible.

Casey O’Donnell wrote:> As he’s planning on it being GPL (I think), I would agree with your

static statement. But if you’re using SDL (which is LGPL), and you
statically link, you must release your source. If you’re cool with
that, I agree. If not, you must dynamically link.

On the windows side, I just include the DLL’s I use that aren’t system
ones right in the directory with the .exe, just like I do on MacOS.
Why do you percieve it to be so difficult? I’ve never needed an
installer that isn’t just a fancy self extracting archive.

On an embeded system, I would actually agree. But I don’t think you’re
talking about that here.

On 9/14/05, Andre Krause wrote:

Marian Schedenig wrote:

On Tuesday 13 September 2005 22:32, Koshmaar wrote:

If you don’t plan to sell your game (or don’t have the money to buy a
license for commercial project), you may use FMOD and FMOD Ex for free.

Well, this one should be GNU when I finally clean up the code enough to
release it without feeling ashamed. :wink: But I have already plans for a next
game, which will probably come as a shareware version (either that, or it
will probably too much work for us to do it). I’m trying really hard to make
my classes low-level enough to carry them over to that new game, so I’m not
really comfortable with FMOD’s license (I did see the shareware option in the
license, but I’m still not too excited).

Thx,
Marian.

there’s another problem with fmod: no sources!! so you cannot compile
your own static library.
and i tell you what: i really DO NOT WANT to depend my game on any dlls
except os provided dlls. why? i like games that are contained all into
a single exe file. no installation, no unpacking. just download and
start. how should i do it with dlls?
sure, there are commercial tools to embed dlls and all other resources
into the exe file, but then you need some temporary space to unpack the
dlls to this means writing to a probably slow / overfull / write
protected disk and adds platform specific code to detect temp directory
etc.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

sure, the big one games do not need this. but they are commercial.
but my little game (just a simple 3d tetris, www.gravytris.tk) is
exactly the sort of games that profit from single .exe style! just
download , start and have a short, entertaining time.
by the way: all the big games have some sort of archive (.wad, .pak
etc) where thez store textures, sound etc. in compressed form. i do
the same, with the exception that the archive is simply appended to
the executable. so there is no difference.

What about offering two downloads of it – the statically linked and
the dynamically linked, and provide information in the readme that if
you want the dynamically linked one, to follow the link to the
website and download that – does that work to appease the LGPL?

–ScottOn 14 Sep, 2005, at 7:48 AM, Andre Krause wrote:

there’s another problem with fmod: no sources!! so you cannot
compile your own static library.

If you buy a license, you get the sources.

and i tell you what: i really DO NOT WANT to depend my game on
any dlls except os provided dlls. why? i like games that are
contained all into a single exe file. no installation, no
unpacking. just download and start. how should i do it with dlls?

Do you realy think it’s possible to create huge commercial game
(like Quake IV, WoW, Unreal Tournament 2004 etc.) which consists
of only one exe, that contains all of game assets? Even when he’s
not creating such a game, still it would be amazingly difficult,
and would provide no important gains / advantages (from
programmers point of view). Not to mention that unpacking
everything from such exe would be a slow and painfull process. And
if you think that there’s no need for assets, that everything can
be generated on the fly… how much time will your game take in
the initialization phase, generating every model, texture, sound?

Even SDL needs to have its dll distributed with games (or at
least, that’s how I was doing for years and seen that everyone
else was doing it like me).

The same goes with OpenAL (dll needed) and SDL_Mixer (which can be
linked staticaly, but GNU LGPL requires to distribute sources, or
sth like that).

For clarity, I’m not against your point of view - I also like
static libraries, but your statement about one-exe games is… :-/

sure, there are commercial tools to embed dlls and all other
resources into the exe file, but then you need some temporary
space to unpack the dlls to this means writing to a probably
slow / overfull / write protected disk and adds platform specific
code to detect temp directory etc.

Right, so you also see that one-exe games have no future :slight_smile:

Koshmaar

sure, the big one games do not need this. but they are commercial. but
my little game (just a simple 3d tetris, www.gravytris.tk) is exactly
the sort of games that profit from single .exe style! just download ,
start and have a short, entertaining time.

Sure, your project may be easily packed to one .exe, but I think that
for the majority of other projects - that’s not true.

Btw, so you are the author of GravyTris? Congratulations, I was playing
it some time ago and kinda liked it :slight_smile:

Koshmaar

Koshmaar wrote:

sure, the big one games do not need this. but they are commercial. but
my little game (just a simple 3d tetris, www.gravytris.tk) is exactly
the sort of games that profit from single .exe style! just download
, start and have a short, entertaining time.

Sure, your project may be easily packed to one .exe, but I think that
for the majority of other projects - that’s not true.

Btw, so you are the author of GravyTris? Congratulations, I was
playing it some time ago and kinda liked it :slight_smile:

Koshmaar


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

yes, i wrote that game.
after some searching the web, i found code how to load a dll directly
from memory:

http://www.joachim-bauch.de/tutorials/load_dll_memory.html/en

i did not tested that, but if it works, one can store even dlls in a
resource file, unpack it to memory and then dynamically load it !

I didn’t want to disrupt this discussion, and found it quite interesting
(although I see no problem with relying on external libraries for my own
games), but now that it seems to be over, I’d like to get back to my original
topic once more. :wink:

I’m now expecting to simply keep the OpenAL implementation, and perhaps adding
an alternative SDL implementation for Stereo games (there aren’t any current
plans for adding surround sound support to standard SDL, are there?).

What I’d still like to know: Is streaming an ogg file from the HD the right
way to play music, or would it be better to load the entire ogg and just
"stream decode" from RAM?

This is also connected to some other considerations of mine, a more dynamic
music engine for my next project. The music would consist of several
different parts (different ogg files) which are queued one after the other.
The queue would be modified depending on what’s currently happening in the
game. This would require frequent “context changes” (i.e. switching streams)
in the music thread, so the question whether to stream from HD or from RAM
probably becomes even more relevant. (Another idea would be adding layers to
the whole thing, i.e. playing several music streams at once - e.g. rhythm and
main meldoy - and only switching parts of these by exchanging the appropriate
stream… but I expect the additional mixing would make this too difficult to
be really worth looking into at this point).

Excuse the rambling… I’d still appreciate replies to my basic question. :wink:

Thx,
Marian.On Thursday 15 September 2005 10:56, Andre Krause wrote:

after some searching the web, i found code how to load a dll directly
from memory:

http://www.joachim-bauch.de/tutorials/load_dll_memory.html/en

i did not tested that, but if it works, one can store even dlls in a
resource file, unpack it to memory and then dynamically load it !


Hofstadter’s law: “It always takes longer than you think, even when you take
account of Hofstadter’s law”.

I’d stream from file. You might get a little performance benefit from having
it all in memory but not much, and using excessive amounts of memory can lead
to swapping, which will slow things down a LOT.

If you want to get fancy, you can “map” the file into to memory, to have the
OS automatically load the appropriate bits as needed; but not everything can
do this.On September 17, 2005 08:14 pm, Marian Schedenig wrote:

What I’d still like to know: Is streaming an ogg file from the HD the right
way to play music, or would it be better to load the entire ogg and just
"stream decode" from RAM?

Hi,

I’m trying to obtain the IP of my local machine using SDL_net. If I
haven’t misunderstood the SDL_net manual, using:

IPaddress ip;
if (SDLNet_ResolveHost(&ip,0,network_port)!=0) {
printf(“Error\n”);
} // if

should fill the “ip” variable with the IP of my machine. But this just
returns 0.0.0.0, Have I misunderstood something?

thanks in advance

santi

The typical way you’d use SDLNet_ResolveHost is like this:

SDLNet_ResolveHost(&ip,“something.org”,port);

Instead of giving it a string, you’re giving it NULL. It doesn’t know what to
do with NULL, so it sets things to INADDR_ANY. If you only need to talk to
your own machine, you can just resolve “127.0.0.1”. If you need to know your
REAL, ACTUAL IP address, SDL_Net can’t do that. It’s a more complicated
problem than it sounds – if your machine has several IPs on several cards,
which should it choose?

I had to find out the actual host IP address for one of my projects, faf,
derived from SDL_webserver… the IP address detection currently works under
win, linux, and mac. It’s in it’s own file in the tarball somewhere, maybye
you’ll find it helpful. http://burningsmell.org/faf/On September 18, 2005 04:58 am, santi wrote:

Hi,

I’m trying to obtain the IP of my local machine using SDL_net. If I
haven’t misunderstood the SDL_net manual, using:

IPaddress ip;
if (SDLNet_ResolveHost(&ip,0,network_port)!=0) {
printf(“Error\n”);
} // if

should fill the “ip” variable with the IP of my machine. But this just
returns 0.0.0.0, Have I misunderstood something?