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

Chocolate Doom & prBoom 'linked' sound problem.

Recommended Posts

Hey folks, apologies if this is an issue already known. I've tried searching for results and i couldn't find any matches.

Basically i have a sound and music adjustment problem when using source ports such as Chocolate and prBoom. When i turn the music bar right the way down to mute, for some reason the sound effects also mute with them, even if the sound effects bar is raised to its maximum level. However, if i mute the sound effects, the music still plays fine, so i'm not entirely sure of what is really happening here.

Other source ports such as ZDoom don't have this issue, i can mute the music no problem without affecting the sound.

As far as i know i'm running the latest versions of both source ports, and it's just one of those circumstances i've not been able to work my way around.

Any ideas? It may not be strictly a source port issue since it happens on two accounts, but i've only had this issue with both source ports listed.

Share this post


Link to post

SDL (or SDL_mixer) bug, I think. Current Prboom+ has different music code (several options, including Fluidsynth) that avoids this problem. Try that and see if it solves your problem.

Share this post


Link to post

That's solved the issue with PrBoom+ thanks.

I guess it's safe to assume Chocolate Doom has yet to fix this? Unless it has and i've completely overlooked it.

Share this post


Link to post

Chocolate Doom should be bug free if you use the OPL synth. Prboom-Plus should be bug free if you use OPL, Fluidsynth, or Portmidi.

As far as fixing it for real (ie not just using different play code), it's more or less an SDL Mixer bug with Windows Vista/7.

Share this post


Link to post

There seems to be a similar bug that rears it's head in XP as well. It manifests itself as just running the music at full volume regardless of where the slider is though the SFX work fine. I presume it's the same bug. A pain in the neck!

Share this post


Link to post
Average said:

There seems to be a similar bug that rears it's head in XP as well. It manifests itself as just running the music at full volume regardless of where the slider is though the SFX work fine. I presume it's the same bug. A pain in the neck!


I would guess that this could be caused by a midi device that does not respond to being turned down by the windows midi controls. You could check your midi options (in windows) and make sure it's set to Windows synth

Share this post


Link to post
Ralphis said:

I would guess that this could be caused by a midi device that does not respond to being turned down by the windows midi controls. You could check your midi options (in windows) and make sure it's set to Windows synth


Maybe he doesn't want to use the Windows GS Wavetable synth though.

Share this post


Link to post

^
Hmm, that seems to have fixed the problem, thank you. I was using my external Creative sound card's soundfont. I messed around with Eternity as you can switch the SDL-Mixer on and off in-game. The music volume works with the MicrosoftGS font but not the Creative one... :(

PS: Sorry Six for stealing your thread!

Share this post


Link to post
natt said:

Maybe he doesn't want to use the Windows GS Wavetable synth though.


I understand that, but unfortunately it is an issue with a lot of wavetable synths that came out in the early 00s. Maybe there is a solution to this within the code, which you would surely know more about. I was only offering a solution to Average that I came across a few years ago so that he could play these engines NOW without having the music blasting.

Share this post


Link to post
Ralphis said:

I understand that, but unfortunately it is an issue with a lot of wavetable synths that came out in the early 00s. Maybe there is a solution to this within the code, which you would surely know more about. I was only offering a solution to Average that I came across a few years ago so that he could play these engines NOW without having the music blasting.


You are right of course, and I apologize. I have come to dislike sdl mixer quite a bit, and it makes me grumpy at times.

Share this post


Link to post

For the record I much prefer the Creative soundfont but if it's a choice between acceptable SF with no volume control and pretty rubbish sF with volume control, I'm afraid I'm going to suffer the rubbish one - at least until there's some kind of fix or work around...

I'll finish this post later - my girlfriend is standing tapping her foot waiting on me to go out with her!!! *Slap....* :P

Share this post


Link to post
Average said:

For the record I much prefer the Creative soundfont but if it's a choice between acceptable SF with no volume control and pretty rubbish sF with volume control, I'm afraid I'm going to suffer the rubbish one - at least until there's some kind of fix or work around...

I'll finish this post later - my girlfriend is standing tapping her foot waiting on me to go out with her!!! *Slap....* :P


For what it's worth, I looked at implementing a volume control of the sort I used for my own midi code in SDL_Mixer, and it would be possible, but some rather ugly code would have to be modified. What SDL_Mixer's mmsystem backend does is "pre-bake" an entire MIDI song into mmsystem-native structures at load time, and then it just runs through that with a callback while the song plays. So you can't add extra events into the stream while it plays (as you would need to do to if the user hits the master volume control in the middle of a song) without significant modification.

Also, my impression of SDL_Mixer's development was "very stagnant", so any fix I made wouldn't likely make it back to mainline, which means I'd be stuck maintaining an SDL_Mixer branch, which opens a few more cans of worms.

Share this post


Link to post

SDL_Mixer caused way too many headaches for me, so much that I decided to replace it entirely with Fluidsynth which is now the main API for handling all SFX and Music in my port. I really wish I've heard about Fluidsynth sooner.

Share this post


Link to post

^
Indeed. I hope Fluidsynth ends up elbowing out SDL-Mixer. Ever since I tried it out in ZDoom a while back I've been very happy with it. It's also nice and easy to change soundfonts too. I know it's more resource heavy than SDL-Mixer but I think the overheads are worth it - especially as most people have at least dual core CPU's...

Share this post


Link to post

The OP's problem isn't a bug in SDL_mixer; it's a bug in Windows Vista and 7's system sound mixer which ties the volume of the Microsoft GS Synth to the application's digital audio output gain.

The midiOutVolume API provided by the mmsystem library (aka MCI) is the only function called by SDL_mixer to set volume. It's MS's wavesynth code, which they re-implemented in the most lazy way possible for Vista, that is entirely at fault here.

Share this post


Link to post
Quasar said:

The OP's problem isn't a bug in SDL_mixer; it's a bug in Windows Vista and 7's system sound mixer which ties the volume of the Microsoft GS Synth to the application's digital audio output gain.

The midiOutVolume API provided by the mmsystem library (aka MCI) is the only function called by SDL_mixer to set volume. It's MS's wavesynth code, which they re-implemented in the most lazy way possible for Vista, that is entirely at fault here.


Perhaps the original fault lies with Microsoft; but Windows Vista has been out for 5 years now, and if you can't fix an OS bug directly, you create a work-around where possible. Pointing fingers doesn't help.

Share this post


Link to post
natt said:

Perhaps the original fault lies with Microsoft; but Windows Vista has been out for 5 years now, and if you can't fix an OS bug directly, you create a work-around where possible. Pointing fingers doesn't help.

The only workaround is literally to add your own software synth. Any application using both the GS wavesynth and digital audio at the same time under the NT 6 platform will suffer this same fate. The real thing is that, as mentioned previously, SDL 1.2 is now frozen and hasn't been updated in forever - they are stuck in some kind of development hell on v1.3 instead.

Share this post


Link to post
Quasar said:

The only workaround is literally to add your own software synth.


I can't test it myself (no Vista/7 machine), but I've been informed that the workaround I coded into prboom-plus works. Give it a try! Any recent build should do; use portmidi music player option and this config file option:

mus_extend_volume     0

You should be able to change both music and sfx volume in game without fraking anything up.

Share this post


Link to post
natt said:

...I've been informed that the workaround I coded into prboom-plus works. Give it a try! Any recent build should do; use portmidi music player option and this config file option:

mus_extend_volume     0
You should be able to change both music and sfx volume in game without fraking anything up.


That's fine, but how does that help sdl_mixer usage? That is what quasar is referring to. If your application only has sdl_mixer as an option, you're kinda screwed unless you add other midi options like prboom+ did.

Share this post


Link to post
Mancubus II said:

That's fine, but how does that help sdl_mixer usage? That is what quasar is referring to. If your application only has sdl_mixer as an option, you're kinda screwed unless you add other midi options like prboom+ did.


The same work around could have been applied to sdl_mixer. My post was in response to "The only workaround is literally to add your own software synth."

Share this post


Link to post

DoomLegacy has bug reports on unspecified Windows machines that sound similar. I will blame Vista and Win7, being that it looks like I cannot not do much about it by changing SDL calls.

Share this post


Link to post
wesleyjohnson said:

DoomLegacy has bug reports on unspecified Windows machines that sound similar. I will blame Vista and Win7, being that it looks like I cannot not do much about it by changing SDL calls.

Pull in PrBoom+ sound code. It cannot be that difficult. (okay, just tedious.)

Share this post


Link to post
Mancubus II said:

If your application only has sdl_mixer as an option, you're kinda screwed unless you add other midi options like prboom+ did.



Well, sorry to be harsh - but since sdl_mixer can be considered broken by now one can consider any application that requires it broken as well.

Time to ditch it, I say.

Share this post


Link to post

Yknow if lowering the Windows volume is do damn buggy, why not just lower the volume of the notes that are played? ReMooD (when it had music that is) did this.

Share this post


Link to post
GhostlyDeath said:

Yknow if lowering the Windows volume is do damn buggy, why not just lower the volume of the notes that are played? ReMooD (when it had music that is) did this.

This same workaround was used by natt in prboom+.

Share this post


Link to post

SDL_Mixer midi playback on Linux (OSS) doesn't have functioning master volume control either. Here's their implementation:

native_midi_gpl/native_midi_gpl.c

void native_midi_setvolume(int volume)
{
}

Share this post


Link to post
natt said:

SDL_Mixer midi playback on Linux (OSS) doesn't have functioning master volume control either.

SDL_Mixer/native_midi_win32.c is written by author of prboom :)

native_midi_win32.c

/*
    native_midi:  Hardware Midi support for the SDL_mixer library
    Copyright (C) 2000,2001  Florian 'Proff' Schulze
*/
#include "SDL_config.h"

/* everything below is currently one very big bad hack ;) Proff */

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
×