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 22:56:34
On Fri, 26 Jan 2001, Gavan Fantom wrote:

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

Sorry to reply to my own post, but here's a little more (interesting)
information.

I had a peek at sequencer.c, which prompted me to have a bit more of a
play. The problem disappears on putting a sleep(1) between
ioctl(SEQUENCER_SYNC) and close().

So, a timing issue. After close() on /dev/music, seq_drain() waits until
the sequencer has done its business and then calls midiclose() on each
midi device... this is then supposed to wait until everything is finished
on that MIDI port (and does appear to have code to do so), and then calls
close() on the driver (in this case, eap), which just turns things off in
the UART.

So, either I've missed something, or the card does some funny business
which needs an extra command to flush things out before it's closed.

Does any of this ring any bells? (alarm bells included)

-- 
Gillette - the best a man can forget