[pulseaudio-discuss] Audio over SSH

Colin Guthrie gmane at colin.guthr.ie
Thu Feb 18 01:22:38 PST 2010


Hi,

Please can you use plain text only when posting to this list? And we
prefer bottom posting (as does everyone on mailing lists generally
speaking). Many thanks :)

Reply below.

'Twas brillig, and Jeremy Nickurak at 18/02/10 00:35 did gyre and gimble:
> What I'd really like is for the pulseaudio server at B to show the
> sinks/sources from A, so I could just select A's sound device as the
> fallback (although since it's the only device, even that wouldn't be
> neccesary.) This takes place over avahi right now as I understand it,
> but I'd like it to expand beyond that. (It's a high-speed network, but
> different link-level networks).

Well assuming that an SSH tunnel is the only way to talk to the other
server then the simplest solution is to simply:

 1) Do not run a PA server on the machine without hardware.
 2) Configure remote PA for network access + anonymous auth (or copy the
~/.pulse-cookie file from the remote system to the local one)
 3) ssh -L 4713:localhost:4713 remotehost # Keep connection open
 4) Run a pulse aware app. (you may need to do "export
PULSE_SERVER=localhost" but this shouldn't be needed)

This will bypass the need to run a local PA server at all and just
connect directly to the remote one, but the downside is that if the
connection drops then apps will lose sound and need to be restarted.

The other way is to run a local PA server and then load the tunnel sinks
into them. You would do this via:

 1) Run a local PA
 2) Configure remote PA for network access + anonymous auth (or copy the
~/.pulse-cookie file from the remote system to the local one as
~/.pulse-cookie-tunnel)
 3) ssh -L 1234:localhost:4713 remotehost # Keep connection open
 4) pactl load-module module-tunnel-sink server=localhost:1234
sink_name="Tunnel" sink="<Sink name from remote server>"
cookie="~/.pulse-cookie-tunnel


That should let your local PA create a virtual tunnel sink that is
connected to the remote PA. If the connection drops the tunnel module
will be unloaded in the local PA and you'll have to reestablish the
connection and rerun the load-module command to make it work.

In order to see all sinks and sources from the remote side on your local
machine you'll have to load a tunnel for each of them (using
module-tunnel-source for input devices).

You can get the names to use via "pacmd list-sinks" on the remote server
(it's the bit in angle (<>) brackets - but don't include the brackets).

Port 1234 in the second example is arbitrarily picked, adjust to your
tastes.

In both examples the cookie stuff is optional and only needed if you
keep authentication enabled/secured.

Hope that helps explain your options.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list