[pulseaudio-discuss] How to redirect pulse audio through ssh?

Colin Guthrie gmane at colin.guthr.ie
Fri May 20 08:48:11 PDT 2011


'Twas brillig, and Quinn Plattel at 20/05/11 15:52 did gyre and gimble:
> I am currently trying to attempt to redirect pulse audio sound from a
> server to a client through ssh.  I am bit unclear on what the correct
> way is of doing it.

Firstly, I wrote up how our X11 piggy backing stuff work here:


Technically we do not tunnel over SSH directly (this can of course be
done, but not automatically as SSH does not know about PA in the same
way it knows about X11). We can however piggy back on the X11 forwarding
built into SSH for our authentication (cookie) and server connection

If this is on a private network (direct routing) then the built in way
is the best, but it doesn't go over SSH. You just need to ensure the
machine you're sshing from has the netwrok protocol module loaded into
PA (pactl load-module module-protocol-native-tcp, or put it in your
default.pa) and make sure port 4713/tcp is open for external connections.

Also ensure that module-x11-publish is loaded on the client side and you
should get some interesting results from "xprop -root | grep PULSE".

Then when you ssh with x11 forwarding running the xprop command on the
remote machine should show you the same results.

If you cannot use the direct connection, just setup TCP tunnels in your
SSH config and then hack the PULSE_SERVER property or env var on the
remote machine to point to e.g. localhost:4713 which will actually be a
tunnel back to localhost:4713 on the remote machine. The PULSE_COOKIE
stuff already forwarded should be enough for auth.

For debugging connections:

PULSE_LOG=99 pactl stat

This shows you e.g. the server name it's trying to connect to etc.

Hope that helps (although I wrote it really quick so apologies if it
doesn't! I'll clarify later if needs be :D)



Colin Guthrie

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]

More information about the pulseaudio-discuss mailing list