Instructions how to play sound on a remote server
Using the KDE sound daemon “artsd” it is possible to play all sounds on a remote machine running artsd. You could e.g. use you laptop to control JuK, but play this music on a machine which is connected to your HiFi system digitally.
You have to install the artsd on both machines. Now you have to tell the artsd daemons to use the X11 root window properties for communication establishment. To accomplish this task you have to edit the ~/.mcoprc file of the user who starts the artsd (usually this would be your normal user on the laptop and root on the machine acting as the server). Replace the following line:
GlobalComm=Arts::TmpGlobalComm
with this:
GlobalComm=Arts::X11GlobalComm
On the server you probably need a startup script to start the artsd, since you probably have no KDE running there. You can use script below.
#!/sbin/runscript
depend() {
need alsasound
}start() {
ebegin “Starting Artsd”
start-stop-daemon –background –start –quiet –exec /usr/kde/3.3/bin/artsd — -n -u -p 5$
eend $?
}stop() {
ebegin “Stopping Artsd”
start-stop-daemon –stop –quiet –exec /usr/kde/3.3/bin/artsd
eend $?
}
Please note that the -u option disables authentification. This may be a security issue for you. I have not yet tried to work around this.
On the client (in my case the laptop) you have to tell the applications to send the sound ouput to the server. Therefore you have to set the ARTS_SERVER evironment variable.
export ARTS_SERVER=192.168.123.158:5001
Of course you have to change the ip address accordingly. Maybe setting ALSA_SERVER to the same also works.
You can add:
ARTS_SERVER=hacki-server:5001
to /etc/env.d/00basic so that the variable is set globally during start-up.
After restarting artsd on the server everything should work as desired.
Please note, that the artsd on the client must not be running!
PS: You can do the same with esd (the Gnome sound daemon). Just start esd on the host with the soundcard:
esd -tcp -public -port 5001
and then add the line:
export ESPEAKER=sound-server:5001
(where sound-server is the hostname, or IP of your server with the soundcard.) to /etc/env.d/00basic
Have fun!