Streaming Audio from a Mac to a Ubuntu Box

Initial setup

(only do this once)

On the ubuntu box, install esound. This will automatically remove two packages (pulseaudio-esound-compat ubuntu-desktop), but they don't seem important.

$ sudo apt-get install esound

On the Mac, install the SoundFlower package via its GUI. Then install the esound on the Mac from the command line (I use MacPorts for this stuff, and so should you.).

$ sudo port install esound

Update: On Ubuntu 12.10 and later it takes a bit more configuration.

Edit your /etc/default/pulseaudio file so that:
PULSEAUDIO_SYSTEM_START=1
DISALLOW_MODULE_LOADING=0

Put the following three lines in the bottom of /etc/pulse/system.pa file:
load-module module-esound-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16
load-module module-zeroconf-publish

Streaming audio from Mac to Ubuntu

(do this every time you stream audio)

Start the esound process on the Ubuntu box. It will receive audio that has been broadcast over the network from any local computer.

$ esd -tcp -public

This isn't necessary on Ubuntu 12.10 if it is configured as above.

Then on the Mac, open System Preferences and set sound input and output to Soundflower (2ch). This will capture the audio from iTunes and make it available to the command line.

Start the esd audio process up (do this before you start CAPTURING sound).

$ esd -tcp -bind ::1 

Then capture the audio (with esdrec) and send it (that's a pipe character) over the network (esdcat) to the Ubuntu box (mine is called harold.local).

$ esdrec -s ::1 | esdcat -s harold.local 

See also. And also.