Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Graf Zahl

GZDoom + GPL: Help needed

Recommended Posts

Now that the Heretic and Hexen sources are finally released with a decent license I'd really like to relicense GZDoom.
However, in order to do this I need a replacement for the FMOD based sound which GZDoom inherits from ZDoom.

There's one problem though: I really don't have the time to familiarize with low level sound programming which I haven't done in a long time so I need someone to help me out here.

Anyone interested?

Share this post


Link to post

you'll also have to replace several lumps in the pk3 too (crouching doomguy, hexen ice and sounds are among the most obvious, large doom font and console font are secondary)

Share this post


Link to post

Odamex large and console fonts can be used if necessary as temp or perm replacements.

Obviously the bigger issue here like Graf said is the audio subsystem.

Share this post


Link to post

Without the sound all those things are pointless. That one's the big issue on which it all depends.

The Doom sprites aren't even such a big problem because if I am not mistaken they fall under the same license clause that allowed KDiZD (change is allowed as long as they are used with the same game they are taken from.) The only restriction would have to be for the shareware version but disabling them there should not be a big problem.

And while we are at it, the sounds from Quake 2 (Railgun and spark) also need replacements then.

Share this post


Link to post

One thing I do like about recent FMOD developments is the ability to use reverb effects with non eax cards. That's been a real boost for me so I hope that which ever option is picked, it can offer all the features that FMOD does (and hopefully more besides).

Share this post


Link to post
Enjay said:

so I hope that which ever option is picked, it can offer all the features that FMOD does (and hopefully more besides).



FMOD is by far the most advanced sound library available so I seriously doubt that the reverb effects can be easily reproduced. Whatever a free replacement will look like, unfortunately it won't be able to match FMOD.

(Which will inevitably mean that I'd keep the FMOD sound code as a plugin - but this can't be the only and most definitely not the default option.)

Share this post


Link to post

That's a shame, but I also had a feeling that FMOD may have had more features than the possible alternatives.

Ah well, as long as its functionality is available via a plugin, that wouldn't be such a huge issue. It seems that being able to GPL GZdoom will have benefits that outweigh the loss of a few features of FMOD as the default sound library.

Which libraries are the existing GPL ports using?

Share this post


Link to post

So, if 'pluginifying' the problematic code solve the problem.
Why not also put the oplsynth in the plugin. Unless it would be much more work.

Share this post


Link to post

Is there really one? I think OpenAL is the big one (unless you want to do DirectX, which is not an option for obvious reasons).

Share this post


Link to post

OpenAL is probably the best option for what you want to do. SDL is an increasingly awful library for any platform that isn't 32-bit Linux. I think this is also really admirable what you're doing, trying to make GZDoom a GPL source port.

Share this post


Link to post

I assume it's not just about playing back midi and wav files or directsound would suffice. What music and sound format support is actually needed?

mod?
midi?
wav?
voc?
mp3?
ogg?
???

Share this post


Link to post
rpeter said:

I assume it's not just about playing back midi and wav files or directsound would suffice. What music and sound format support is actually needed?

mod?
midi?
wav?
voc?
mp3?
ogg?
???



For sound effects at least:

Doom
WAV
AIF
MP3
OGG

although if I'd find a decent loader for VOC I would add that, too. Problems might arise with specially coded WAVs like ADPCM on non-Windows systems without a system-provided library like MSACM.

For music:

MIDI
MP3
OGG
Different module formats but that's already supported by using DUMB)
SNES SPC (code also available)

And DirectSound will not suffice because it's Windows only.

Share this post


Link to post

Can (G)Zdoom not also currently play Wolfenstein music (IMF?) or are they just some kind of modified midi?

Share this post


Link to post
Enjay said:

Can (G)Zdoom not also currently play Wolfenstein music (IMF?) or are they just some kind of modified midi?

IMF files are a raw stream of ADLIB register data.

To play it needs either a soundcard with ADLIB (OPL2 or OPL3) and direct access to that hardware, or an OPL2/3 emulation code like fmopl.c.

My program 'TranslateIMF' can convert IMF to MIDI by trying to guess what the instruments and notes are, however the result is often not very good.

Share this post


Link to post
Enjay said:

Can (G)Zdoom not also currently play Wolfenstein music (IMF?) or are they just some kind of modified midi?


It's played with the (GPL incompatible) OPL emulator so this won't be in any GPL compatible sound implementation.

Share this post


Link to post

[offtopic]

Ajapted said:

'TranslateIMF'

Do you have a link to that? I could't see it on the EDGE site and Google doesn't find it. I'd like to give it a go and see what the results are like.
[/offtopic]

Share this post


Link to post

You have a few libraries to choose from, these are some of the ones I have played with:

SDL - You'll need an external library for playing midi.

SDL + SDL_mixer - One of those external libraries that has mixing capabilities, but its considered the worst of the lot by a few developers, it does require hacks to work around bugs inside it, alot of port authors have ripped their eyes out after working around them.

SDL + SDL_sound - This might be a good choice format-wise, I haven't been able to compile a newer version of it on windows, the code is a bit of a mess to work with as well, but doesn't appear to be as buggy as SDL_mixer.

SFML - Probably the cleanest, SDL-like library I have seen (maybe the only one), it has individual api's for handling sound, graphics, input etc. The only thing it does not handle is midi which sucks.

For midi replacement, you can use something like:
timidity++ - latest CVS version
wildmidi - a slimmed down, GPLv3, version of a timidity-like library that is compatible with timidity cfg's

You can go here for a list

Share this post


Link to post
RTC_Marine said:

You have a few libraries to choose from, these are some of the ones I have played with:

SDL - You'll need an external library for playing midi.

SDL + SDL_mixer - One of those external libraries that has mixing capabilities, but its considered the worst of the lot by a few developers, it does require hacks to work around bugs inside it, alot of port authors have ripped their eyes out after working around them.

SDL + SDL_sound - This might be a good choice format-wise, I haven't been able to compile a newer version of it on windows, the code is a bit of a mess to work with as well, but doesn't appear to be as buggy as SDL_mixer.


SDL is an absolute no-go. It's ok for Linux but the Windows version is unacceptable because it has some serious limits (e.g. it's limited to English only keyboard.) Besides, why replace everything just for sound? If it ain't broke don't fix it. The current input system works fine and I have no intentions to replace it.

I won't say anything about SDL_Mixer. Everybody knows it's bad.

SFML - Probably the cleanest, SDL-like library I have seen (maybe the only one), it has individual api's for handling sound, graphics, input etc. The only thing it does not handle is midi which sucks.


Apparently the same main issue as SDL. It wants to take over the entire hardware so I'd have to replace more than I'd like. The capabilities of the sound interface sound interesting though. If this can be used without the rest it might indeed be interesting.

EDIT: I just had a look. It's only a thin layer over OpenAL so I might just use that directly and create my own class interface that better supports what I need...

For midi replacement, you can use something like:
timidity++ - latest CVS version
wildmidi - a slimmed down, GPLv3, version of a timidity-like library that is compatible with timidity cfg's


I won't worry about MIDI. GZDoom already contains a player for Windows's MIDI API and an older version of Timidity so there's already something there I can use. All I need is a decent sound API that can replace FMOD.

Share this post


Link to post
Graf Zahl said:

All I need is a decent sound API that can replace FMOD.


Unfortunately there is not alot to choose from which can be a direct replacement, if there was it would be in a certain project by now.

I looked at PortMedia (audio and music) briefly, unfortunately it doesn't have support for loading formats like wav, mp3 or ogg. Oh well :|

I might check out OpenAL too sometime and good luck with the venture, this and the raven code thing has been a big plus for me this week. (in the sense it should hopefully stop some people complaining ;)

Share this post


Link to post

The biggest problem I had with OpenAL was the WIN32 installer that people have to run to install it before your app will run correctly. Too many people don't read the README or website where you explain that OpenAL has to be installed first (e.g. with the installer you ship with the engine) and then come and ask/complain why sound doesn't work. It is not like most libraries (e.g. SDL) where you can ship the package with the DLL and it all "just works".

So that's the main reason and the fact that drivers for non-WIN32 platforms were so crappy and out-of-date (plus at the time it only supported 1/d^2 model which sounds too quiet compared to DOOM's 1/d model) why I replaced EDGE's OpenAL code with plain SDL sound output.

Share this post


Link to post

Hm. That doesn't sound too promising. So far OpenAL looks like the only library that seems to be good enough.

But the distance calculations are also an issue. FMOD allows the application to calculate the gain in a callback function and ZDoom's sound code makes use of this to get proper values for the different distance models of the supported games (and some allowes custom settings.)

But OpenAL is rather rigid in this regard and only allows a handful of preset values, none of which looks too useful. Not to mention that the OpenGL inspired API is among the most awful I have ever seen. What is it with certain people that they feel the need to emulate the worst parts of OpenGL?

It's really sad. I absolutely can't find a decent free sound library that wouldn't force me to strip out half the basic features out of the existing sound code. :(

Share this post


Link to post
Graf Zahl said:

Not to mention that the OpenGL inspired API is among the most awful I have ever seen. What is it with certain people that they feel the need to emulate the worst parts of OpenGL?

Lol, guess OpenAL was created at the time the OpenGL API was in fashion and everyone was copying it. Makes almost no sense for sound.

I believe OpenAL has added a 1/d distance model, last time I looked it was in an extension but it may have become base spec by now. And I think it's possible to, for example, set all the sounds 1 unit away from the listener and set the gain explicitly on them all, which defeats the whole point of OpenAL (positional sound for 5.1 and similar speaker setups) but would get the job done.

It may be possible to use SDL __just__ for sound, i.e. calling SDL_InitSubsystem(SDL_INIT_AUDIO). If I were in your position that's what I'd try (with my own sound mixing/blitting code).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×