Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: [chap-midi] src/sys/dev



Module Name:    src
Committed By:   chap
Date:           Sat May 20 03:15:33 UTC 2006

Modified Files:
        src/sys/dev [chap-midi]: midi.c midivar.h sequencer.c

Log Message:
Implement Active Sense on transmit. The same callout used by
midi_start_output for brief delays in output is now also scheduled
for 285 ms if there is nothing to transmit, and will send an Active Sense
at that time if there is nothing else to go; this will keep the receiving
equipment expecting our Active Sense and ensure that notes will stop
sounding when it ceases (either because we close normally, or we hang,
or someone trips over a cable). Sounds simple enough but involved a new
locking strategy, because we used to block out user_incurred start_output
whenever the device interrupt or callout was pending, but in the case of
the 285ms callout we /want/ to let a user write through and cancel the
callout (and avoid races, etc).  Also moved the callout_init into
midi_attach because midiattach was not called in all cases, and added
a callout_stop in detach (though it is not yet quite up to all cases where
the callout may have been fired but not yet run at the time of detach -
nothing is easy.)

Surprisingly, the Active Sense works almost right over umidi: umidi's
state machine isn't smart enough to pass it through a packet being built,
and makes garbage instead, but a Yamaha keyboard at least is happy to
accept a bit of garbage within 300 ms as a sign we're still alive. :)

Now to go do a better state machine for output. :/  It shouldn't be in
umidi; it should be in midi, done once and done right; there should be
no need to have slightly different replicas of the midi state machine
all over the kernel ... I think there's one in sequencer too.


To generate a diff of this commit:
cvs rdiff -r1.43.2.4 -r1.43.2.5 src/sys/dev/midi.c
cvs rdiff -r1.11.14.4 -r1.11.14.5 src/sys/dev/midivar.h
cvs rdiff -r1.30.14.4 -r1.30.14.5 src/sys/dev/sequencer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index