[linux-audio-dev] lad design patterns

Fons Adriaensen fons.adriaensen at skynet.be
Sat Jan 29 18:32:33 UTC 2005


On Sat, Jan 29, 2005 at 10:53:14AM -0600, Levi D. Burton wrote:

> does the idea of documenting various lad design patterns make sense to anyone?
> 
> seems a lot of stuff is sort of voodooish.


There is a lot of common sense involved, and usually a whole
collection of different types of voodoo:

- signal processing 
- designing for real time
- multithreading
- system interfaces
- event driven systems
- ...

and of course this leads to some recurring patterns in
all but the most trivial applications.

It's a good thing to have some framework that is designed to
be compatible with all these aspects. Given this, it doesn't
matter so much how a particular pattern is implemented, but
consistency and making simple things fit and work together 
help a lot.

For example, a recurring theme in more complex audio apps is
the 'lock_free ring buffer' that is normally used to pass
audio samples between two threads without ever blocking one
of them.
The JACK code provides an implementation of this, and many
people use it. I don't, not because there is anything wrong
with the code, but because if I use the ITC features of my
threads lib in the correct way, I get the same effect without
any extra code. The two implementations couldn't be more
different, but it's still the same pattern.

Because audio (and signal processing in general) programming
involves this mix of disciplines, combining high (abstraction)
and low (down to the hardware) level features and elements
from audio engineering and DSP, many of the things you may
learn on the way to a degree in IT could actually more of
a hindrance than a asset, unless you are capable of taking
some distance from them. Forget 'extreme programming', and
all the other 'hype of the day' that thrives in information
engineering circles, and embrace common sense.

(just my 2 eurocents of course)

-- 
FA







More information about the Linux-audio-dev mailing list