Sharing sound across computers with PulseAudio

2012-08-22    Filed under linux, Tags linux sound

There are several good articles on how to redirect an audio stream from one computer to another or how to multicast from one computer to many of them using PulseAudio. But I found some unexpected problems when trying to make it work.

One of the applications needed to set it up is paprefs (PulseAudio preferences setup GUI). This application was working fine in one of my computers but in the other most options of the GUI were grayed out/disabled. The difference was in was in the linux distribution I run in them. The one working was Debian Testing while the problem was with Linux Mint LMDE (201204).

I found out that the version of paprefs in LMDE included a hardwired path to the pulseaudio modules that was wrong. It was looking for pulseaudio modules in path /usr/lib/pulse-1.1.0 instead of /usr/lib/pulse-1.0. You can check where paprefs is looking for the modules by issuing:

strace paprefs 2>&1 | grep /lib/pulse

Even when the paprefs application is failing, the PulseAudio system itself is properly configures (the needed modules are there and in the right place, available to PulseAudio). What happens is that paprefs thinks they are not available just because it is looking for them in the wrong place and disable the GUI options.

So the solution was simple and dirty:

sudo ln -s /usr/lib/pulse-1.0 /usr/lib/pulse-1.1.0

Newer versions of paprefs doesn't have this problem and this fix isn't necessary.

In LMDE it is necessary to close and open the session, or restart avahi-daemon or pulseaudio daemons, maybe even reboot to make it work. You can try:

sudo service avahi-daemon restart
sudo servide pulseaudio restart

To force a rediscovery with avahi (install package avahi-discover first):

avahi-discover -t --all

Simultaneous local and remote output

First you need to know the name of the remote and local sinks, use command:

pacmd list-sinks

Then enter the pacmd shell and create a combined sink using the module-combine:

>>> load-module module-combine sink_name=combined \

There is another possibility which is not using avahi/zeroconf at all, but use tcp tunnel.