proposal: /dev/midi/...

Paul Barton-Davis (pbd@Op.Net)
Wed, 15 Jul 1998 10:44:38 -0400


I suspect that there is a better forum to propose this, but I'm not
sure of it. PLEASE tell me where it is if it exists.

I think that a future version of the Linux sound driver(s) should
support a MIDI /dev tree, somewhat along the following lines:

/dev/midi/synth0
/dev/midi/synth1
/dev/midi/port0
/dev/midi/port1

For the above, assume that there are a couple of synth devices (say,
the OPL/3 FM synth and a wavetable device), and two MIDI
ports. The semantics are pretty simple: if you open one of these
devices, then:

read: gets MIDI bytes from the portNN series, and may or
may not return any data from the synthNN series, depending
on whether or not the synth outputs MIDI data.

write: uses the midi operations struct to map MIDI data to
synth ops for the synthNN series, and simply uses the
current midibuf stuff for the portNN series.

Backwards compatability is maintained by linking /dev/midi00 to
/dev/midi/port0.

The idea of this tree is to allow applications to easily identify and
access the MIDI devices they wish to communicate with. Currently, for
example, it is difficult (perhaps impossible) to open up a MIDI stream
to the OPL3 FM synth found on many soundcards without going through
/dev/sequencer, which is absurd given that the driver internals
support handling a MIDI datastream as a control source for the
OPL3. Other soundcard-based synths sometimes support a /dev/midiNN
device that directly communicates with that synth, but some
don't. Unifying MIDI access in this way seems like a better way to do
things.

Any comments ?

--p

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html