i have no speakers in my PC(Cent-OS 5.5) but there is a stereo speaker connected to the computer next to my Computer(Cent-OS 5.5). Both computers are networked. Is there any way to pipe my system sounds to that computer speaker ?
-
possible duplicate of How can I stream audio signals from various devices/computers to my home server?– BreakthroughCommented Jun 5, 2012 at 13:27
-
Specifically only "system sounds", as in "system beeps" and such, or do you mean all sound?– Daniel AnderssonCommented Jun 5, 2012 at 13:52
3 Answers
PulseAudio can be used over the network.
I usually suggest enabling automatic discovery using Avahi (unless you have a mortal fear of IP multicast) – the advantages are that you'll be able to use both local and networked audio devices, instead of having to hardcode one specific server. Even though this does not apply to @Bijoy's question, it might apply to many other readers.
Note regarding file paths:
Newer PulseAudio versions ≥ v2.99.1 put user configuration in
~/.config/pulse/default.paand the auth cookie in~/.config/pulse/cookie.Older versions ≤ v2.98 use
~/.pulse/default.paand~/.pulse-cookierespectively. If you have such an older version, keep that in mind when reading instructions.
Method 1, automatic discovery using Avahi with any number of servers including local devices:
On both computers, start the Avahi daemon.
On computer B, enable incoming network access:
Via
paprefs→ Network Server → Enable network access to local devicesOr, by editing
~/.config/pulse/default.pa:.include /etc/pulse/default.pa load-module module-native-protocol-tcp load-module module-zeroconf-publishDon't forget to restart
pulseaudioto make it reread the configuration (or load both modules manually withpactl load-module).
On computer A, enable discovery:
Via
paprefs→ Network Access → Make discoverable PulseAudio devices availableOr, by editing
~/.config/pulse/default.pa:.include /etc/pulse/default.pa load-module module-zeroconf-discoverDon't forget to restart
pulseaudioto make it reread the configuration (or load the module manually withpactl load-module).
On computer A, you should now see sound devices of B listed next to local devices (e.g. in
pavucontrolor in GNOME's sound settings).
Method 2, manual configuration with one server:
On computer B, enable incoming network access:
Via
paprefs→ Network Server → Enable network access to local devicesOr, by editing
~/.config/pulse/default.pa:.include /etc/pulse/default.pa load-module module-native-protocol-tcpDon't forget to restart
pulseaudioto make it reread the configuration (or load the module manually withpactl load-module).
Copy
~/.config/pulse/cookiefrom computer B to computer A.On computer A, tell PulseAudio to use a remote server:
Edit
~/.profileor equivalent startup script to add:export PULSE_SERVER="tcp:computer-b-address" test "$DISPLAY" && pax11publish -e || trueLog out, log in again, and ensure that at least one of
printenv PULSE_SERVERandpax11publishshows the address of computer B.
On computer A, you should now see sound devices of B listed (e.g. in
pavucontrolor in GNOME's sound settings).
Note about programs that don't support PulseAudio natively: Those which do not, can be configured to use a PulseAudio-ALSA compatibility layer via /etc/asound.conf. The following example is taken from the pulseaudio-alsa package in Arch Linux:
pcm.!default {
type pulse
fallback "sysdefault"
hint {
show on
description "Default ALSA Output (currently PulseAudio Sound Server)"
}
}
ctl.!default {
type pulse
fallback "sysdefault"
}
-
Just tested and it works as a charm. Streaming audio Ubuntu -> Gentoo. Commented Jan 30, 2013 at 20:52
Well... the first thing that came to my mind was a version of VNC that allows for sound. Not every install does. So, I cranked up a VNC comparison page.
Looking through it, there are a number of VNC based installs that not only work with Linux, but support sound. So right there, that's one way. You install the server on your computer, install the client on the computer with the speakers, enable multi-user sessions so you don't get disconnected, and you can pipe your sound to that computer.
Otherwise, you can try the Network Audio System which I got out of a similar question asked last year Play system sounds from one computer through another computer's speakers?
I think is is better to set up samba shares for your whole music collection, then access it with your player of choice on the second machine. I am sure it will work better than VNC (I reckon VNC sound isn't stereo)
-
This answer doesn't address the question. What about streaming videos from within the browser and VoIP calls, for instance?– MarcoCommented Jun 5, 2012 at 16:27