Subject: Re: /dev/music weirdness
To: Lennart Augustsson <lennart@mail.augustsson.net>
From: Gavan Fantom <gavan@coolfactor.org>
List: tech-kern
Date: 01/26/2001 20:23:24
On Thu, 25 Jan 2001, Lennart Augustsson wrote:

> > Firstly, a small gripe. /dev/music seems to be rather lacking in
> > documentation. I've been relying so far on <sys/midiio.h> and the source
> > for midiplay. Have I missed something blatantly obvious?
>
> It's severely lacking in documentation, but this fact is documented. :-)
> Check the midi(4) man page.  It also says that the API is compatible
> with the OSS (Linux) API.  Or at least it was when I wrote it.
> So any documentation you find for Linux should be largely applicable
> here.  And if you feel like writing some documentation it would be great. :)

Well, we shall have to see. :)

> > Now, the problem: When I write data to /dev/music (having practially
> > cut+pasted code out of midiplay), the last MIDI event seems to get lost.
>
> This sounds like a bug.  But doesn't midiplay work properly?

I've just done some testing with midiplay, and it seems that midiplay is
in fact affected by this bug as well.

I have a MIDI file which is sufficiently short to play lots of times
without waiting around for ages, which reliably ends up with a note stuck
on at the end of the file. The last events are (are printed by midiplay -v
-v):

DELAY    0 TRACK  2 MIDI 81 (2) 48 40
DELAY    0 TRACK  2 META 2f (0)

The note stuck on is indeed a C above middle C (assuming my Ocarina is in
tune ;-) and is very prominent as it is a trumpet sound.


Would I be right to suspect that other people have not come across this
before because they haven't been using external MIDI devices, and hence
notes don't stick on after the device is closed?


Where should I start looking if I want to track this bug down and fix it?

-- 
Gillette - the best a man can forget