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

Is there hardware midi available in any sourceport for linux? If so how do I compile?

Recommended Posts

Well in my old post I was curious about using sycraft's ogg soundtrack in zdoom which I gave up and then went on to do some midi to wave conversion using SGM-V2.01 soundfont which sounds incredibly realistic and organic. Only downside is all the music for doom, doom2, final doom ended up being over a gig in flac's highest compression mode... It's pretty pathetic considering I have a hardware midi synthesizer on my audigy 2 and should be able to just use it with any soundfont I damn well want!

So yeah instead of going through wine and getting hardware midi there. Is there any source port than can be natively compiled for linux to have hardware midi access? I'm using alsa (snd-emu10k1-synth) driver together with the awesfx utility (asfxload) and I can use pretty much any sf2 soundfont with unlimited memory space (you can change a buffer setting for that if you read the docs).

If DosBox can use hardware midi in linux why can't doom? It seems as though every source port (even chocolate doom) uses SDL. I've read here and there that SDL_mixer doesn't support hardware midi access. Then again I thought dosbox uses SDL. Am I missing something here?

So is there such thing as a native linux source port that can access hardware midi? Is there some magically epic way to get timidity to send the midi into to the alsa driver's midi input to therefore get hardware midi playback from my audigy 2? Isn't there a way to compile it to get hardware midi? What gives?

Share this post


Link to post

I think the problem is very few sound cards actually have a hardware synthesizer. I recently read somewhere that the EMU10K1 based sound cards (SB Live! through Audigy 2) are the only sound cards to have on board hardware wavetable synths. (I really hope someone will prove me wrong.) As a result it seems like a lot of effort to support if only few people will actually end up using it.

Also the EMU10K1 apparently has a bug where it can only load the soundfont if it's in the first 31-bit address space. Which means that unless you use a small sound font the hardware synth doesn't work on a 64-bit operating system. Assuming I'm right about the EMU10K1 being the only hardware synth on a sound card, this makes the effort required even less worthy.

On a side note. I have a hard time believing that your hardware synth sounds any different than Timidity for background music (are you loading the same soundfont into Timidity?). The only difference I can tell between the two is my hardware synth has no noticeable delay. This can really only be noticed if you are using your computer as the synth for a midi instrument (as I do).

Share this post


Link to post

Well chocolate-doom always seems to use timidity in my case. Eternity engine won't even compile on my box for some weird reason (don't have a problem compiling other ports). Eternity seems to work fine however through wine.

I've never had a problem loading soundfonts on my audigy 2 and to me the SGM's 256MB soundfont makes a huge difference. WAAAAAaaay way big difference!! It even surpasses Sycrafts music pack in some cases but I wouldn't consider it that way since it's a totally different flavor of doom music. If it didn't I wouldn't've gone as far as making a music pack for each doom in flac format (midi to flac). But it's a complete waste of space being over 1.5gb and especially when there's hardware midi available. If u wan't I could upload a song in flac format so you can hear yourself but I don't know what site to upload to for free unless someone says so.

I heard the xfi series have midi hardware as well. Perhaps I'm wrong?

AFAIK chocolate-doom uses SDL under linux so how am I gonna tell (SDL_MIXER) it to use hardware midi? It sucks using wine with the windows ports because there's either sound latency and/or the keyboard doesn't even work (zdoom) or some other damn problem. If I choose oss for wine's sound driver sound latency is gone but then there's no midi. What a paradox!

Share this post


Link to post
Csonicgo said:

Hardware midi will always be better. there's no latency or popping/skipping issues.


No shit! This is driving me crazy. I'd use windows but unfortunately I gotta pay cash for it plus I like compiling-optimizing my system (slackware user)

Share this post


Link to post
Holering said:

Eternity engine won't even compile on my box for some weird reason (don't have a problem compiling other ports). Eternity seems to work fine however through wine.

What are you using to compile, and what are the errors?

Share this post


Link to post
Holering said:

I've never had a problem loading soundfonts on my audigy 2

I take it you're using a 32-bit kernel? The problems only occur on 64-bit kernels. Remember I have 3 sound blaster Live! 5.1s which use the same hardware synthesizer as your Audigy 2.

Holering said:

to me the SGM's 256MB soundfont makes a huge difference. WAAAAAaaay way big difference!!

Of course it does. Although my sound font (that I use with both Timidity and hardware) is only about 70MB I can say I don't have any skipping and popping issues. The only issue I have with software synths is the 1/2 second delay, which considering Doom isn't synchronized to the music means it should be unnoticeable unless you are using a midi keyboard.

Edit: I forgot to mention, I think the 64-bit issue only happens when more than 4GB of memory is available.

Share this post


Link to post

Wow I got it to compile don't know why it didn't before. I just upgraded alot of stuff so... Yeah no more sound lag through wine (and other wine bugs I'm sure). It's finally native yet it's finally timidity software midi lol. Timidity reminds me of my ex-wife... No offence to her btw. I gotta say eternity is damn beautiful and sexy! I can't believe there's actually an option for the little file loading icon to popup. This is what I like about the EDGE source port as it made it feel like good ol dos doom! I can't believe how great the menu looks! It's all very beautiful work! And original! can't believe it...

Yeah so I built eternity off trunk r1116 with epic flags!!11onezzeesz So if anyone here could tell me how to get hardware midi to work in native linux source ports that'd be great lol... I mean I could keep using wine but it can sometimes messup like for example it wont find a pwad when I go | WINEDEBUG="-all" wine edge.exe -iwad /usr/local/games/doom/wads/doom.wad -file /usr/local/games/doom/pwads/pk_doom_sfx.wad | . I gotta put the pwad in the root folder of "the windows version of EDGE" to get it to load...

I mean if hardware midi is so scarce then why does every port (correct me if I'm wrong) support hardware midi synthesis in windows (including vista). I know it's SDL_mixer's fault probly. I swear I read something in a prboom forum about a hacked sdl_mixer that used hardware midi in windows or something like that. Don't know what that was about. No hardware midi for a linux doomer is a sad sad doomer... :(

At least eternity is awesome!

Share this post


Link to post

TO answer your question: under Windows source ports work so smoothly with hardware MIDI because...well....it appears as any other MIDI device to the OS, thanks to the CL labs midi drivers that take care of loading the soundfonts, feeding data to the card etc. and presenting a standards-compliant MIDI device to the system, that ANY program can use, from a MIDI player to games.

I have no idea what the situation is on Linux though....AFAIK Creative Labs offered only very basic driver support for these OSes (if any), and the default drivers that most flavours of linux install must only offer standard digital wave sound, not MIDI or hardware-mixed multi-channel.

There is an EMU10K1 driver for Linux that addresses these shortcomings, but then installing MIDI devices under Linux is another can of worms.

Blzut3 said:

I think the problem is very few sound cards actually have a hardware synthesizer. I recently read somewhere that the EMU10K1 based sound cards (SB Live! through Audigy 2) are the only sound cards to have on board hardware wavetable synths.


True, only the Audigy and X-Fi lines have a hardware synthsizer/multi-channel hardware mixer/DSP, although some older cards like the Gravis Ultrasound, the SB AWE series and the Yamaha Waveforce also had hardware mixing, the very least. Some budget "Audigy" and "X-Fi" cards however just do all mixing in software, like onboard codecs.

Today the tendency is to do everything in software (AC'97, C-Media chips etc.) and save on the cost and drivers for a dedicated mixer chip. And, to be quite honest, the Audigy's were always plagued by crackle, pop, PCI bus mastering problems ever since they moved from using onboard RAM to system RAM, at least under Windows, let alone that soundcards today are ridiculously overpriced (come on, you can get a video card with 128 GPGPU stream processors with 1 GB of dedicated RAM nowadays, why does a sound card with 64 MB of onboard RAM -if any- cost almost as much, sometimes without even a hardware DSP?)

Share this post


Link to post
Blzut3 said:

I think the problem is very few sound cards actually have a hardware synthesizer. I recently read somewhere that the EMU10K1 based sound cards (SB Live! through Audigy 2) are the only sound cards to have on board hardware wavetable synths.

What about the Orchid soundcards, SoundWave32 and GameWave32? They had hardware wavetable synths before Creative Labs copied them, IIRC. Also they had MT-32 emulation.

Share this post


Link to post
Gez said:

What about the Orchid soundcards, SoundWave32 and GameWave32? They had hardware wavetable synths before Creative Labs copied them, IIRC. Also they had MT-32 emulation.


Heh these are pretty obscure, I could barely remember them or the company that made them. Many sources also claim they were the first "wavetable" cards, but that's probably wrong: there were Roland soundcards before that (with their own, custom, ROM partials-based wavetable synthesis) and the GUS, which was released in 1992 and was fully programmable.

The GUS had a hardware synth/mixer and its onboard RAM so it could actually be used by games for sound effects and module music too, the Orchid soundcards seem to be more of a mix of basic SB/Adlib compatibility and MT-32 emulation (ROM-based?). Seeing how I can't remember any game having special support just for them, the wavetable portion must have been a purely MIDI device, such as the Turtle Beach MIDI soundcards.

Share this post


Link to post
Maes said:

Heh these are pretty obscure, I could barely remember them or the company that made them. Many sources also claim they were the first "wavetable" cards, but that's probably wrong: there were Roland soundcards before that (with their own, custom, ROM partials-based wavetable synthesis) and the GUS, which was released in 1992 and was fully programmable.


The Roland and Turtle Beach cards were crazy expansive, marketed to serious hobbyists and professional musicians. Something like the GameWave32 was dirt cheap in comparison. It had awesome midi, much better than just about anything else in the same price range. I think it and its more complete variant the SoundWave32 were the first cards that aimed to give quality MIDI composition to mere gamers. I know there was a sudden explosion of soundcards with wavetables a couple months after they appeared.

I hope Munt will eventually find its way into Doom sourceports. OPL emulation is all the rage, but MT-32 sounded a lot better!

Share this post


Link to post

Does anybody have any dates on when the Orchid products were released? The first generation AWE32 was released in March 1994, and the oldest product reviews of the SoundWave32 I can find are generically labelled "1994" too. I don't know if Creative developed and manufactured the AWE32 in just months to catch up with Orchid, but they did a pretty good job.

Keep in mind, the AWE32 was also cheaper compared to Roland or Turtle Beach (still expensive though, any actual price comparisons?) and boasted full SB16 compatibility, unlike competing products which either had none, only partial, or only SB 1.0/2.0/Pro compatibility.

Edit: this article here is dated May 1, 1994 and mentions a price of $299 for the Orchid...so it's probably just an AWE32's contemporary competing product, and it could very werll be that Orchid designed it in response to the AWE32 (industrial espionage notwithstanding).

Share this post


Link to post

Well as mentioned before there is certainly hardware midi available under linux for both OSS and alsa via the awesfx utility. It's similar to windows xp in that you had to do a registry edit to get over a memory limit on soundfonts. In linux you set an option for the snd-emu10k1-synth module to whatever limit you want.

Hardware midi works beatifully in linux dosbox (hell it's better than in windows 9x) with all the dos games. I feel truly grateful that something as lonely as dosbox actually supports something as important as hardware midi under linux (you can even specify ports). I couldn't imagine every dos game not having proper midi support under linux. That's like one of the most important things for dos gaming! Why can't zdoom specify midi ports in linux like it does under windows though (windows vista even)? I just can't believe it... What's so special about SDL_Mixer that it just doesn't do it under linux.

It seems emu10k1 based cards even have hardware mixing for other things under linux so it seems like a very well supported card despite some 64 bit bugs which I never heard about till the previous poster mentioned it.

Share this post


Link to post
Holering said:

Why can't zdoom specify midi ports in linux like it does under windows though (windows vista even)? I just can't believe it...


ZDoom doesn't even have a MIDI implementation for Linux. All it offers is the various software synths that are available in general for all platforms. The only dedicated MIDI code it has is for Windows. This may be important to you and a few others but please don't forget that the on board soundchips which >90% of all people use these days can't make any use of such code.

In the end it' probably way too much work for a single program. DosBox on the other hand, as a general purpose emulator, has completely different goals and certainly more programmers available to code such stuff.

Share this post


Link to post

I see...

I guess maybe someone could write a modified version and/or update of timidity to send midi data to an available hardware port? That would be sweet since that's what most source ports support anyway. Or an update to SDL_Mixer which might be better (might break things). I have no idea about coding but I think I might have a general idea of how things could work out. Maybe I'll learn someday heh...

Share this post


Link to post
Holering said:

I see...

I guess maybe someone could write a modified version and/or update of timidity


That's probably the one thing that will never work. Timidity's sole purpose is to be a software synth.

If you want some basic MIDI player code ZDoom's is probably better because it already provides all the necessary framework to parse the MIDI file and create the events that need to be sent. What's missing is a backend for Linux but I'm afraid that I can't help you with that.


Or an update to SDL_Mixer which might be better (might break things)



I don't think that SDL_Mixer is the right place, either. As the name implies its purpose is to mix sounds and output them as waveforms.

Share this post


Link to post
Graf Zahl said:

I don't think that SDL_Mixer is the right place, either. As the name implies its purpose is to mix sounds and output them as waveforms.

SDL_Mixer does have code for 'native' MIDI playback (e.g. QuickTime on OSX), so true hardware output would fit into that framework.

Share this post


Link to post

Timidity is built into SDL_mixer. SDL_mixer can play to a real keyboard, i've done it before but it depends if it decides to use it or not. ReMooD uses the OSS interface to interact with a real device.

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
×