Home | History | Annotate | Download | only in dev
History log of /src/sys/dev/midictl.c
RevisionDateAuthorComments
 1.10  31-Oct-2022  andvar s/singled/single/
 1.9  01-Jun-2017  chs remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.8  28-Aug-2015  joerg Don't left-shift negative numbers by making them unsigned.
 1.7  23-Nov-2011  jmcneill branches: 1.7.8; 1.7.26;
Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

Add MP locking to the audio drivers.

Making the audio drivers MP safe is necessary before efforts
can be made to make the VM system MP safe.

The are two locks per device instance, an ISR lock and
a character device lock. The ISR lock replaces calls to
splaudio()/splx(), and will be held across calls to device
methods which were called at splaudio() before (e.g.
trigger_output). The character device lock is held across
calls to nearly all of the methods, excluding some only
used for initialization, e.g. get_locks.

Welcome to 5.99.57.
 1.6  24-Jun-2008  gmcgarry branches: 1.6.8; 1.6.30; 1.6.32;
The forward declation in the parameter list for a variable-length array is
another gcc extension. Pass the array as a pointer to blob.

See: http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/gcc/Variable-Length.html
 1.5  28-Apr-2008  martin branches: 1.5.2; 1.5.4;
Remove clause 3 and 4 from TNF licenses
 1.4  16-Nov-2006  christos branches: 1.4.4; 1.4.50; 1.4.52; 1.4.54;
__unused removal on arguments; approved by core.
 1.3  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.2  30-Jun-2006  chap branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10;
Ankh-Morpork, we have a MIDI driver....

Merge from chap-midi branch, after
~month for review
Comments by thorpej@ drochner@ and Alexandre Ratchov

Incorporated: points by thorpej@ drochner@; preliminary support for
a stats-collecting ioctl suggested by martin@ from comments by A.R.

PR kern/32441 kern/32442 kern/32567 kern/32588 kern/32694 kern/33590
kern/33614 and one instance of kern/32651

ok martin@
 1.1  06-Jun-2006  chap branches: 1.1.2; 1.1.4;
file midictl.c was initially added on branch chap-midi.
 1.1.4.1  13-Jul-2006  gdamore Merge from HEAD.
 1.1.2.4  22-Jun-2006  chap Now with non-proplib-backed store, as proplib (undocumentedly) relies on
never being called in interrupt context.

This store implementation will also use memory a bit more economically
than the proplib version, and inserts are amortized O(1) rather than O(n).
I was ready to live with a bit of inefficiency for the sake of code reuse,
but if proplib can't be used anyway, may as well use the opportunity to
improve some.
 1.1.2.3  10-Jun-2006  chap Now with support for the following MIDI controls -

Channel Volume
Expression

- the following heretofore unimplemented message -

Pitch Bend

- and the following registered parameters -

Pitch Bend Range
Channel Fine Tuning
Channel Coarse Tuning

Volume and Expression are handled by all synth chip drivers but pcppi
(which has a fixed volume). All of the pitch controls will be effective
(at least for new notes struck after a change) for all current synth
drivers but cms (that driver discards all the fractional pitch bits and
calculates its own frequency by a table lookup; it should be possible to
do better with knowledge of the formula behind the table, but I have
found no cms docs). If a driver provides repitchv and relevelv methods
for changing the pitch/level of a sounding voice, then changes to these
parameters will take effect in real time and not just for subsequent notes.
The effect can be heard (for repitchv) over pcppi.

Heads up: if you build with libprop earlier than 2006.05.28, you can enjoy
the exhilarating experience of seeing kernel memory stomped. ;)
 1.1.2.2  07-Jun-2006  chap midisyn now uses midictl instead of punting every ctl_change message
uninterpreted down to the MD synth driver (most of which don't even
try to field it). Right now that means no control change has any effect
right now, but that is a loss of functionality only for OPL, which handled
the following extensive set of control messages: { PAN }

Now to do some tillage of the midisyn <-> md synth interface with the goal
of adding a method for communicating /cooked/ control messages down. Won't
be much tillage because there are only 3 children in the tree and the two
that aren't opl have no ctl logic at all. Start by making them all use
designated initializers for their method structures, so the set of methods
can evolve without a versioning nightmare. Then probably prune a number of
methods that NOBODY implements, where it's not clear they're defined the
best way to begin with, and they can easily re-evolve (possibly in better
form) when there is actual interest in implementing them.
 1.1.2.1  06-Jun-2006  chap Add midictl, a module dedicated to managing a MIDI controller/parameter
space, as a first step to getting the partial and duplicated controller-
handling logic OUT of the md synth chip drivers, and getting as much as
possible of the control effects that are common and well-defined (pitch
bend depth, say) handled centrally by midisyn itself.

Compiles, works in unit testing, added to 'files', but nothing else in
the kernel calls it yet.

Possibly some naming of private symbols to be revisited pending style
question posted on tech-kern.
 1.2.10.2  10-Dec-2006  yamt sync with head.
 1.2.10.1  22-Oct-2006  yamt sync with head
 1.2.8.2  09-Sep-2006  rpaulo sync with head
 1.2.8.1  30-Jun-2006  rpaulo file midictl.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:49:09 +0000
 1.2.6.1  18-Nov-2006  ad Sync with head.
 1.2.4.2  11-Aug-2006  yamt sync with head
 1.2.4.1  30-Jun-2006  yamt file midictl.c was added on branch yamt-pdpolicy on 2006-08-11 15:43:52 +0000
 1.4.54.2  04-May-2009  yamt sync with head.
 1.4.54.1  16-May-2008  yamt sync with head.
 1.4.52.1  18-May-2008  yamt sync with head.
 1.4.50.2  29-Jun-2008  mjf Sync with HEAD.
 1.4.50.1  02-Jun-2008  mjf Sync with HEAD.
 1.4.4.2  30-Dec-2006  yamt sync with head.
 1.4.4.1  16-Nov-2006  yamt file midictl.c was added on branch yamt-lazymbuf on 2006-12-30 20:47:50 +0000
 1.5.4.1  27-Jun-2008  simonb Sync with head.
 1.5.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.6.32.3  22-Nov-2011  mrg - make this not crash with "midiplay -l" anymore by killing store_thread()
with kthread_exit() instead of return

- adjust wait channels to be unique

- add some asserts that insert it not called while destroy is in progress

- note some probably dead code with KASSERT(FALSE) for now
 1.6.32.2  22-Nov-2011  mrg avoid one use-after-free error. midi_store->lock is unlocked after
we cv_broadcast() to get the midi_store freed. keep a local copy
of the lock pointer to avoid this.
 1.6.32.1  19-Nov-2011  jmcneill port ad-audiomp2 branch changes to 5.99.56
todo:
- port ad-audiomp2 pcppi changes
- these drivers need to be fixed:
- emuxki
- gcscaudio
- hdafg
- uaudio
- umidi
- MD audio drivers
 1.6.30.1  17-Apr-2012  yamt sync with head
 1.6.8.1  09-Dec-2008  ad Checkpoint work on MIDI.
 1.7.26.2  28-Aug-2017  skrll Sync with HEAD
 1.7.26.1  22-Sep-2015  skrll Sync with HEAD
 1.7.8.1  03-Dec-2017  jdolecek update from HEAD

RSS XML Feed