Subject: Re: [linux-audio-dev] MidiShare Linux
From: Stephane Letz (letz_AT_grame.fr)
Date: Wed Jul 19 2000 - 18:25:39 EEST
>I do not know much of the Midishare design yet,
>(I gave it only a quick look at the general infos sometime ago),
>but it would be interesting to see if it fits well into my proposed
>"manual audio process scheduler" model.
>Hopefully the MIDI share event system is lean and fast , so we could
>run the MIDI share "server" (correct me if I am wrong), for calling
>callbacks of the apps (all should run within the same process space
>to avoid scheduling overhead) when MIDI events occur.
>As for assembly programming: just provide a C version of the
>routines too, so that on x86 users can enjoy it too.
The lock-free structures used in MidiShare are lifo and fifo.
Lock-free lifo have to be implemented in inlined assembly language because
they use special instructions like "cmpxchg8b" on Pentium and "lwarx ",
"stwcx" on PowerPC.
This is very similar to the implementation of atomic operations in Linux
which also have to be implemented directly in inlined assembly language on
Lock-free fifo is currently implemented using two lock-free lifo, but this
is not completly general. It only works correctly when they are several
writers and only one reader. A general implementation has still to be done.
With this kind of implementation, lock-free lifo and fifo are SMP safe.
Lock-free lifo are used for the Midi events freelist management, and fifo
are used in each MidiShare client.
We plan to publish soon a short document on the current design and
implementation with benchmarks.
>MidiShare currently supports audio events as well as MIDI. Stephane
>demonstrated it sharing audio input (and output) across several
This is still experimental and not in the published version. The idea is to
extend the type of events that MidiShare clients can exchange with audio
events. Audio events transports sound buffers.
There is an audio In driver that "slice" the continous audio stream read on
/dev/dsp into separate time-stamped audio events.
There is an audio Out Mixer/driver that mix events received by all
applications and produces a continous audio stream written on /dev/dsp.
Sound buffers are allocated in a global shared memory area.
Grame: Centre National de creation musicale
9, Rue du Garet
This archive was generated by hypermail 2b28 : Wed Jul 19 2000 - 19:02:57 EEST