Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I have finch, a command line chat client (think pidgin) running on a remote machine that I ssh into. finch has notification sounds and can run a command when certain events occur, letting you pass the sound file in as %s. e.g. mplayer %s

from the remote machine, when the notification occurs, what kind of command could I run to play whatever %s is on my local machine?

share|improve this question

migrated from serverfault.com Mar 22 '12 at 20:30

This question came from our site for system and network administrators.

up vote 5 down vote accepted

If you use pulse-audio as sound server, you can use module-native-protocol-tcp to accept tcp connection from your remote machine.

In the following example, I use an ssh tunnel to forward the audio request from remote machine to the local one.

On the local machine, do something like:

pactl load-module module-native-protocol-tcp auth-ip-acl=
ssh -R 9999: you@remotehost

then on remote machine you can use paplay

paplay -s soundfile.wav

ADDED I discovered that auth-ip-acl does not accept localhost as a valid parameter, you have to use (or whatever your machine uses localhost address).

EDIT It should be ssh -R, not ssh -L (we are forwarding a remote port to a local port).

If you have an old version of pulse-audio (pre 0.9.3), you can use cookie based authorization.

pactl load-module module-native-protocol-tcp auth-anonymous=1 auth-cookie-enabled=0
scp ~/.pulse-cookie you@remotehost:
ssh -R 9999:localhost:4713 you@remotehost

Obviously, you can simply do not use any authentication in pulse-audio but I can not recommend you this solution. Use, at least, a firewall to avoid remote connections.

share|improve this answer
getting "Failure: Module initialization failed" on pactl load-module module-native-protocol-tcp auth-ip-acl=localhost. Am I missing a dependency or something? – tester Mar 22 '12 at 21:42
Try pulseaudio --check ; echo $? to check if pulseaudio server is running. It should print 0 if running. – andcoz Mar 23 '12 at 15:55
On my machine (opensuse 12.1), the module is in /usr/lib64/pulse-1.1/modules/module-native-protocol-tcp.so. Which distribution are you running on? – andcoz Mar 23 '12 at 15:57
my local machine echos 0 properly.. remote is on ubuntu 11.10 and my local is on 11.04. i tried referencing the module directly on my local pactl load-module /usr/lib/pulse-0.9.22/modules/module-native-protocol-tcp.so auth-ip-acl=localhost and I get Failure: Invalid argument. Any idea? (btw thanks for helping) – tester Mar 23 '12 at 20:17
auth-ip-acl is supported since version 0.9.3. See freedesktop.org/wiki/Software/PulseAudio/Documentation/User/… – andcoz Mar 23 '12 at 23:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.