ALSA midi support in SDL_mixer?

I was wondering if there were any plans to add ALSA midi support to
SDL_mixer. It seems that it only supports Timidity (software midi)
or /dev/sequencer (hardware midi in OSS). However, Timidity tends to
not sound very good and is CPU intensive. And /dev/sequencer support
doesn’t currently work in ALSA using oss-seq emulation (and the support
has been removed from OSS anyway).

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??

Steve

Le Sat, 8 Dec 2007 00:48:48 -0330
Stephen Anthony a ?crit:

I was wondering if there were any plans to add ALSA midi support to
SDL_mixer. It seems that it only supports Timidity (software midi)
or /dev/sequencer (hardware midi in OSS). However, Timidity tends to
not sound very good and is CPU intensive. And /dev/sequencer support
doesn’t currently work in ALSA using oss-seq emulation (and the support
has been removed from OSS anyway).

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??

Maybe this could help you:
http://bugzilla.libsdl.org/show_bug.cgi?id=509
Or is your problem different?–
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

Thanks for the info, but I make sure Timidity is not installed so that
hardware midi is used whenever possible (I have a SB Live card and
don’t need software midi at all).

I think the problem in in the ALSA OSS /dev/sequencer emulation itself,
since the ScummVM application can be toggled to use OSS sequencer or
ALSA midi support, and it doesn’t work with the OSS stuff either.

So while the problem may indeed be in the ALSA drivers for OSS sequencer
emulation, I feel SDL_mixer should use the defacto standard for sound
in Linux. I’m just wondering if the work will be justified :slight_smile:

SteveOn December 8, 2007 9:35:17 am Patrice Mandin wrote:

Le Sat, 8 Dec 2007 00:48:48 -0330

Stephen Anthony <@Stephen_Anthony> a ?crit:

I was wondering if there were any plans to add ALSA midi support to
SDL_mixer. It seems that it only supports Timidity (software midi)
or /dev/sequencer (hardware midi in OSS). However, Timidity tends
to not sound very good and is CPU intensive. And /dev/sequencer
support doesn’t currently work in ALSA using oss-seq emulation (and
the support has been removed from OSS anyway).

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??

Maybe this could help you:
http://bugzilla.libsdl.org/show_bug.cgi?id=509
Or is your problem different?

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.

–ryan.

Yes, that’s what I figured. I guess I’d really be targeting a small
subset of an already small userbase (hardware midi users from midi
users in general), since I believe only SB Live and Audigy and AWE32/64
cards support it.

However, for those that do have it, it’s a real letdown to use Timidity.
ScummVM is one such application that can use hardware midi, and they
even recommend it if you have the hardware. Another is eDuke32, which
is why I asked the question in the first place; it’s my current pet
project (converting it to 64-bit mode).

Anyway, if I find time I will develop an ALSA patch and submit it to
you. Thanks for the info.

SteveOn 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.

Some random blurbs because I always am amused at seeing MIDI threads
in this day and age :slight_smile:

You might check out the PortAudio/PortMusic/PortMidi projects. They
may already do what you need, and they may have code you can learn
from.

Midi may still have some interesting applications. Imagine Guitar Hero
with real instruments (educational games?). This obviously presumes
the actual musical instrument digital interface of “MIDI” and not just
the playback/sound generation part though.

Timidity’s playback quality is comparatively low by today’s standards
in my opinion. Even the default soft synth patches on today’s cheapie
sound chips have exceeded Timidity in my opinion. (I think by Windows
98, Microsoft had already licensed samples for the default GM .DLS
from Roland which came from their (Virtual?) Sound Canvas line and I
think Apple had already licensed samples too from Roland for the
QuickTime midi synth. I think Timidity uses Gravis Ultrasound sound
fonts which I think have more technical limitations than the current
generation of sound fonts.)

So unless you only have an FM Synth chip (or worse), native midi will
probably sound better than Timidity now-a-days. So assuming the Linux
drivers support all the semi-modern sound cards and SoundFonts, I
would think a ‘native’ midi implementation would be the best thing for
everybody.

Btw, for midi use in way-back things like ScummVM, the hard core tend
to get Roland MT-32s, Roland Sound Canvases, and sometimes Yamaha XG
series cards. Creative Labs was anti-standards with the AWE line and
General Midi was poorly emulated. Though if you’re into the classic
Demo scene, nothing beats a Gravis Ultrasound.

-EricOn 12/9/07, Stephen Anthony wrote:

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.

Yes, that’s what I figured. I guess I’d really be targeting a small
subset of an already small userbase (hardware midi users from midi
users in general), since I believe only SB Live and Audigy and AWE32/64
cards support it.

However, for those that do have it, it’s a real letdown to use Timidity.
ScummVM is one such application that can use hardware midi, and they
even recommend it if you have the hardware. Another is eDuke32, which
is why I asked the question in the first place; it’s my current pet
project (converting it to 64-bit mode).

Anyway, if I find time I will develop an ALSA patch and submit it to
you. Thanks for the info.

Steve


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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.

SteveOn 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.