Subject: Re: midi stuff
To: Andrew Kilpatrick <andrew@andrewkilpatrick.org>
From: Gavan Fantom <gavan@coolfactor.org>
List: tech-kern
Date: 04/15/2001 11:13:10
On Fri, 13 Apr 2001, Andrew Kilpatrick wrote:

> I started working on MIDI code the other day, and I found that
> the MIDI driver doesn't work very well. The state machine doesn't
> handle all the possible states for MIDI messages, and quickly
> gets into an endless loop, eventually overrunning its buffer and
> causing a panic.

Erk. What is your MIDI application here? Which messages does it choke on?

Having looked at the code there are a number of serious improvements that
could be made (see a thread about /dev/music in the archives), but I don't
remember thinking of anything that it couldn't recover from.

Are you using the raw MIDI device, or the sequencer?

> Anyway, I started designing a new state machine that handles the
> incoming messages properly, but am running into some trouble because
> the data coming into this module is often wrong. I'm pretty sure my
> MIDI interface isn't broken. It's currently a cheesy AWE32 with the
> game port MIDI port, because my USB interface isn't supported. I'm
> not sure what is at fault.

Could you post some sample data and say what it's doing wrong?

> If anyone can help me out before I spend a lot of time shooting in
> the dark, it would be great. I'm starting to dig a bit of kernel code
> but I'm still in over my head.

While I'm not particularly familiar with the kernel (yet), the MIDI stuff
seemed to make sense to me. Which is useful, because far too much of the
/dev/music API is poorly documented elsewhere.

-- 
Gillette - the best a man can forget