[SDL] ALSA midi support in SDL_mixer?

Stephen Anthony sa666666 at gmail.com
Sun Dec 23 18:09:13 PST 2007


On December 9, 2007 9:08:02 am Ryan C. Gordon wrote:
> > Since ALSA seems to be the way forward for sound in Linux, has
> > anyone ever attempted this?  Is it worth my time to investigate
> > this, or will SDL_mixer be replaced soon by SDL 1.3??
>
> SDL 1.3 won't add midi support in the base library. It's really a
> dying standard in a post-mp3 world, and mostly it's needed for legacy
> titles anyhow.
>
> SDL_mixer could certainly add ALSA-specific midi support, though, in
> the same way that we have win32-specific midi support too, if someone
> were to step up and submit a patch.
>
> Timidity is generally "good enough" for most cases--and there aren't
> many cases in the first place--so there's not a great deal of urgency
> on the issue, I guess.

OK, I finally got a chance to look at this.  First, I was going to add 
ALSA-specific code, but I haven't found any LGPL code that could be 
included.  Next, I decided to add a class to pipe the output to an 
external player (to get around the GPL vs. LGPL issue).  However, I 
noticed that there's already code to do that (Mix_SetMusicCMD), so I 
decided to use that instead, since all the apps I need midi for are 
open-source and can be modified to use it.

I think I'll come back to this once SDL 1.3 is finalized.  There really 
should be native support for this in SDL_mixer, which I'd like to add 
eventually.  I'm open to proposals for cleaning up the API wrt which 
backend to use.  It would be great to auto-detect hardware midi and use 
it by default, but fallback to software/timidity when necessary.  And 
to somehow get rid of the GPL/LGPL issue to be sure the functionality 
is always compiled in.

Steve



More information about the SDL mailing list