[LAU] Linux systems as a distributed speaker array

Adrian Knoth adi at drcomp.erfurt.thur.de
Mon Feb 9 18:57:47 EST 2009


On Tue, Feb 10, 2009 at 10:25:34AM +1100, James Cameron wrote:

[Poor man's delay line]
> What tools exist to synchronise the audio outputs of several different
> kernels?  They all have the same audio hardware, if that helps.

I have hacked jack.udp to use IPv6 Multicast instead of unicast.

You'd simply connect your player (mplayer, qmmp, whatever) to the
sending jack.udp and every other running instance on the LAN would get
the broadcasted data within let's say 256 samples.

Since data is only sent once, bandwidth consumption is very low. The
buffersize is quite small, this system works fine over here for jamming
in different rooms of the same building (must share the same LAN).

I wouldn't claim sample accuracy, but the audible result should be good.
If you want to give it a whirl, get the source here:

   http://cluster.inf-ra.uni-jena.de/~adi/jack-udpv6.tar.bz2

How to use:

You don't provide hostnames anymore, the data is simply sent to a fixed
link local multicast address. Run the sender:

   jack.udp -b BUFSIZ send

where BUFSIZ is your desired FIFO size. Without realtime privs, I got
good results with BUFSIZ = 2*periodsize. You'd need to try a little to
get the best buffer size.

All receivers start

   jack.udp -b BUFSIZ(+1) recv

That's it. They automatically subscribe to the multicast group, receive
the data and offer it as a jack output port.

I got good results with BUFSIZ+1, but jack.udp would inform you on
buffer over/underflow. If so, increase the buffer size or add realtime
prio.


If you have multiple network interfaces, jack.udp would need to know
which one to use. Since the code is proof-of-concept, there's currently
no command line option for this. If you need it, I could add it, or you
edit nettools.c, look for "eth0" in the comment and specify your network
interface card number. You can get the right value from "ip a s":

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP qlen 1000

Here, "2" would be the right value. Once again, you only need that if
you have more than one NIC.


HTH

-- 
mail: adi at thur.de  	http://adi.thur.de	PGP/GPG: key via keyserver

Die Klassenarbeit ist versaut, wenn einer dir den Spicker klaut



More information about the Linux-audio-user mailing list