Windows 7 MIDI volume

Seems the infinite wisdom of MS has dictated that MIDI volume shall be irreparably attached to the total process volume level in Windows Vista and 7. Is there a workaround for this yet? Has it been reported to SDL as a bug?

Using the music volume level slider in Eternity causes the digital sound volume to reduce by the same amount, making it completely useless.

Share this post


Link to post

I've not heard of a work around. We are having the same issue when using SDL for audio in Doomsday under Win7.

Share this post


Link to post

Looks like another reason to adopt *nix as my primary OS when XP's service packs reach the end of their support lifecycle.

Share this post


Link to post

Monster bump on the original thread for this issue to post about the solution I have finally devised to it:

http://mancubus.net/svn/eternity/trunk/midiproc/?#a70f846a6e3f33532c045236738c1f538

"MidiRPC" is a lightweight embedding of the SDL_mixer API inside an RPC - "Remote Procedure Call" - framework. This enables the MIDI player to run in a separate process, and via that, obtain the ability to independently set its MIDI volume level.

RPC is the simplest method for inter-process communication (IPC) on Windows, and isn't going anywhere any time soon considering it is the foundation upon which DCOM and COM+ are built. Plus, it just freaking works. It offers built-in synchronization and a high-level procedure-call-based interface.

See also the file i_midirpc.cpp for the client code:
http://mancubus.net/svn/eternity/trunk/source/sdl/i_midirpc.cpp

Share this post


Link to post

Excellent! Great job in fixing this long-standing problem, Quasar! And Fraggle... any chance of implementing this in Chocolate DOOM? Please?

Share this post


Link to post

\o/

Thanks Quasar for come up with a functioning solution for this :) Hopefully it can get implemented into all the SDL ports soon.

I look forward to having music in Doom again.

Share this post


Link to post

PS: Any other ports that adopt the code should be sure to generate their own UUID and rename the interface appropriately, to prevent any possibility of conflicts.

Share this post


Link to post

This approach is a clever solution to a very dumb decision by Microsoft.

P.S. why use another interface name and UUID? I thought the nice thing about COM was that you could create an interface once, and multiple pieces of software could use it.

Share this post


Link to post
andrewj said:

This approach is a clever solution to a very dumb decision by Microsoft.

P.S. why use another interface name and UUID? I thought the nice thing about COM was that you could create an interface once, and multiple pieces of software could use it.

Well I suppose but... if you're one of those crazy people that play multiple ports at the same time you might run into trouble, unless somebody rewrites this to be totally re-entrant and multithreadable :P

Share this post


Link to post
GreyGhost said:

Looks like another reason to adopt *nix as my primary OS when XP's service packs reach the end of their support lifecycle.

What? You were willing to abandon Windows just because of its MIDI incompatibility? Heheheheheh.

Share this post


Link to post

I have stopped using Windows's internal MIDI player when I got my first Vista-computer 5.5 years ago.

It was not only the volume problem but the overall (lack of) quality it offered that made me ditch it.

IMO the whole thing has become completely useless and it might be better to have one software-synth based alternative available. Even something like ZDoom does with its external Timidity++ player is infinitely better than anything Windows has to offer by default.

I think it's quite obvious that for Microsoft this has become legacy baggage that's only barely maintained to avoid completely breaking older software that still need it.

Out of curiosity: What prevents SDL-based ports from using something like FluidSynth and mixing the music into their sound stream themselves?

Share this post


Link to post
Graf Zahl said:

Out of curiosity: What prevents SDL-based ports from using something like FluidSynth and mixing the music into their sound stream themselves?


Nothing. PrBoom+ supports FluidSynth.

Share this post


Link to post

Indeed, as does Doomsday (on Linux/Ubuntu/Unix). The current plan is to phase out SDL_mixer for music entirely, on all supported platforms.

Share this post


Link to post
Graf Zahl said:

Out of curiosity: What prevents SDL-based ports from using something like FluidSynth and mixing the music into their sound stream themselves?

When I investigated FluidSynth (years ago), there was only one decent freely available soundfont, which was huge (127MB or so) and legally dubious.

Nowadays the size is less of an issue, but are there any soundfonts for it which are freely available, high quality, and without any legal concerns?

Quasar said: (regarding UUID)
Well I suppose but... if you're one of those crazy people that play multiple ports at the same time you might run into trouble, unless somebody rewrites this to be totally re-entrant and multithreadable :P

Hmmm I thought the UUID was to ensure the uniqueness of the interface (the ABI)? Or are you somehow locating the process to talk to via the UUID? (which doesn't seem necessary if you are creating the process yourself from a parent process, the engine)

Share this post


Link to post

I remember from IRC that Quasar was having lots of trouble trying to compile FluidSynth on Windows.

Share this post


Link to post
printz said:

I remember from IRC that Quasar was having lots of trouble trying to compile FluidSynth on Windows.



Yes, it's an utter mess. But it isn't really necessary because there's some compiled DLLs floating around, most notably Randy's own version available on zdoom.org.

Share this post


Link to post

From my understanding, the "volume control" present in Windows XP and before was more of a courtesy, if anything. AFAIK no OS has an API that presents a system-wide MIDI output volume control device that is independent of the MIDI events, at least one that does not rely on nasty hacks.

Even today, whenever a programmer asks how he could control MIDI output the most general method proposed is to directly manipulate MIDI events and scale the volume "at the source", with all the obvious drawbacks this method could have (not the least of which, is that volume might change randomly and at a whim). Apparently, there's no universal "master volume" method. Perhaps XP did a good job at disguising this, but M$, in their infinite wisdom, decided that this was a Bad Thing and not in line with the Power Of New Hardware, and so let it go.

This is to be expected, to a degree: most modern soundcards don't actually have a dedicated MIDI hardware section, not even an FM chip, and so there's no actual "final output" to control. Some MIDI drivers/emulators might do a better job at presenting a controllable and unambiguous "final volume", but again, there doesn't seem to be some OS-specific API for that, at least not anymore. Worse is better?

Share this post


Link to post
Quasar said:

Monster bump on the original thread for this issue to post about the solution I have finally devised to it:

http://mancubus.net/svn/eternity/trunk/midiproc/?#a70f846a6e3f33532c045236738c1f538

"MidiRPC" is a lightweight embedding of the SDL_mixer API inside an RPC - "Remote Procedure Call" - framework. This enables the MIDI player to run in a separate process, and via that, obtain the ability to independently set its MIDI volume level.

RPC is the simplest method for inter-process communication (IPC) on Windows, and isn't going anywhere any time soon considering it is the foundation upon which DCOM and COM+ are built. Plus, it just freaking works. It offers built-in synchronization and a high-level procedure-call-based interface.

See also the file i_midirpc.cpp for the client code:
http://mancubus.net/svn/eternity/trunk/source/sdl/i_midirpc.cpp


Sound server revival!

EDIT:

Win32 lacks AF_UNIX support, so a cross platform solution would need to use something like TCP but even then Windows screws that up too with all that Winsock garbage.

But, I phased out SDL_mixer a long time ago, sure I can't play MP3s and OGGs, but i'd rather lose those than have lock ups, crashes, and freezes constantly.

Maes said:

Stuff


ReMooD when playing Music just modifies the MIDI instruments directly, at least when it uses its own internal MUS2MID (which I wrote myself) which does live streaming.

Share this post


Link to post
GhostlyDeath said:

ReMooD when playing Music just modifies the MIDI instruments directly, at least when it uses its own internal MUS2MID (which I wrote myself) which does live streaming.


Which is exactly the level of control I said you often have: only relative volume (instruments), but not of the final absolute one.

Share this post


Link to post

I considered several solutions before trying this one, including the "take over MIDI playing yourself" one (waaaay too much work), the "use a synth library" one (let me know when one appears that can actually successfully compile from source and doesn't require you to have GTK+ on the include path), etc.

This turned out to be a simpler thing I could knock out in the course of 24 hours, after doing the prerequisite research on MSRPC.

Share this post


Link to post
entryway said:


I used a bit of that code as the basis for the PortMidi player in Odamex. Unfortunately switching back and forth between SDL_Mixer and PortMidi still requires a little bit of hackery but it seems to be a working solution for us. ...at least until I can get around to submitting patches to SDL_Mixer and hoping for the best.

Share this post


Link to post
Maes said:

Which is exactly the level of control I said you often have: only relative volume (instruments), but not of the final absolute one.

The volume control in every version of Windows prior to Vista worked fine. The problem in Vista itself is nothing to do with not properly scaling the volume of MIDI events. It has everything to do with Microsoft routing the output of the GS Software Synth through the process's mixer under the same channel as digital sound output and without implementing an independent volume control for it.

Don't try to make excuses for their poor engineering in the change-over to the Vista mixer model, and especially don't do it by making claims regarding previous versions of the OS that simply are not true. Revisionist history at best.

Share this post


Link to post

The Vista/7 mixer pretty much ruined my process for creating music and I've had to re-adapt to the way 7's mixer works. The jump adversely affected my work and also made writing music much less enjoyable.

Share this post


Link to post

I'm really sorry for bumping an ancient thread, but I'm having the same problem - MIDI is just blasting to the point where I cant hear SFX at all, and as stated, the MIDI volume slider also changes the SFX volume. Yes, I'm using Win7..

It looks like Quasar posted a helpful solution, but I might has well be attempting to read Chinese. How can youy average dumb Doomer get some decent sound levels these days? Is there some program I can run to fix this?

Playing without music blows arsehole, IMO.

Share this post


Link to post
Doomkid said:

I'm really sorry for bumping an ancient thread, but I'm having the same problem - MIDI is just blasting to the point where I cant hear SFX at all, and as stated, the MIDI volume slider also changes the SFX volume. Yes, I'm using Win7..

It looks like Quasar posted a helpful solution, but I might has well be attempting to read Chinese. How can youy average dumb Doomer get some decent sound levels these days? Is there some program I can run to fix this?

Playing without music blows arsehole, IMO.

Well, which port are you using?

A workaround would be to use a music pwad with mp3 versions of the doom music.

Share this post


Link to post
Doomkid said:

I'm really sorry for bumping an ancient thread, but I'm having the same problem - MIDI is just blasting to the point where I cant hear SFX at all, and as stated, the MIDI volume slider also changes the SFX volume. Yes, I'm using Win7..

It looks like Quasar posted a helpful solution, but I might has well be attempting to read Chinese. How can youy average dumb Doomer get some decent sound levels these days? Is there some program I can run to fix this?

Playing without music blows arsehole, IMO.

The solution here is only for the Eternity Engine. AFAIK, no other ports adopted this approach because they do other things (use FluidSynth, PortMIDI, etc). EE can also play hi-def music as an alternative to MIDI, but that's only good for mods that don't modify the music obviously.

Now that dotfloat has managed to create a version of FluidSynth that does not depend on glib at all, I may try to integrate it with EE.

Share this post


Link to post
Doomkid said:

I'm really sorry for bumping an ancient thread, but I'm having the same problem - MIDI is just blasting to the point where I cant hear SFX at all, and as stated, the MIDI volume slider also changes the SFX volume. Yes, I'm using Win7..

It looks like Quasar posted a helpful solution, but I might has well be attempting to read Chinese. How can youy average dumb Doomer get some decent sound levels these days? Is there some program I can run to fix this?

Playing without music blows arsehole, IMO.

I have had the same issue with prboom+ while using SDL for music. I've installed timidity and MIDI/SFX volume issue went away, here's some info how to do it.

Share this post


Link to post

Thanks a lot for the responses, everyone. It happens to me in Odamex, Doom Legacy and Doom95. I was wondering if there's a simple way to 'trick' Windows into allowing me to adjust MIDI volume from some place they forgot to dickishly cover up, but I suppose not.

Share this post


Link to post

If they were gonna deprecate MIDI support they could at least make it easy to replace/clean it up a bit. Why are big tech companies like Google and Microsoft doing such shitty jobs with what they do?

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