Yes, with pulseaudio this can easily be done. You will need to install and run paprefs
that makes your sound devices available over the network.
![enter image description here](https://i.stack.imgur.com/glDuy.png)
![enter image description here](https://i.stack.imgur.com/pdMMO.png)
These settings allow both sound sources and sinks to be published over the network, ideally to another pulseaudio server.
In case you have your server setup without desktop manager you will need to install a sound system first (see this question). You can then edit /etc/pulse/default.pa
uncommenting these lines in the Network access section:
load-module module-esound-protocol-tcp
load-module module-native-protocol-tcp
load-module module-zeroconf-publish
If you want to use RTP sender uncomment these lines the RTP sender module section:
load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 description="RTP Multicast Sink"
load-module module-rtp-send source=rtp.monitor
The pulseaudio server needs to be started as a daemon with pulseaudio -D
in case it's not yet running. For optimizing sound qualitity settings in the /etc/pulse/daemon.conf
may be adapted to personal needs.
An alternative method to stream audio in your network would be to setup an Icecast Server (see this question).
Use rygel (sudo apt-get install rygel
).
Configuration
Install necessary things:
sudo apt-get install rygel rygel-preferences pavucontrol paprefs gupnp-tools
Due to bug #827030, we can't autostart rygel easily. But we can do this:
Install, start rygel-preferences
, exit rygel preferences.
Start Rygel preferences, untick the "Share Media through DLNA" button, exit Rygel preferences, then start Rygel preferences, tick the checkbox and exit it again and it should work.
Note: How to fix stolen from comments on the bug report
Now, enable the necessary PulseAudio module:
pacmd load-module module-http-protocol-tcp
To do this automatically, add the line load-module module-http-protocol-tcp
to /etc/pulse/default.pa
, or do this: sudo su -c 'echo 'load-module module-http-protocol-tcp' >> /etc/pulse/default.pa
Run paprefs, select the "Network Server" tab and enable "Make local sound devices available as DLNA/UPnP Media Server".
Browse the DLNA network on a client device (Android phone, Smart TV, etc.). You will see "Audio on $hostname" -> Output Devices -> Built-in Audio Analogue Stereo (the device name will likely change depending on the audio hardware in your computer). You should hear on your client device whatever is currently being played via that sink.
Guide taken from, and full guide available, if that doesn't work here
Best Answer
Why not connect to the internet stream from one computer and then use PulseAudio to provide the audio to the network?
You'll need to install
paprefs
for this, on the "server" (the computer connecting to the internet stream) and on each "client" (computer receiving audio data from the server) you wish to use.paprefs
is a GUI program, but its options are a little opaque. The manpage is, as is too often the case, useless for figuring out the options. It does provide a Web address, http://0pointer.de/lennart/projects/paprefs/ , which has a link to "Documentation" but contains no actual documentation. I will attempt to walk you through the configuration process, but my setup is different from yours so I may err. Hopefully someone will see it and correct it if I do.First, run
paprefs
on the server machine. Under "Network Access" tab, select:"Enable network access to local sound devices" "Allow other machines on the LAN to discover local sound devices", and "Don't require authentication"
There are two more options on that tab regarding DLNA/UPnp media streaming. I don't know what that is so I have left it alone.
Under "Multicast/RTP" tab, select:
"Enable Multicast/RTP sender" and "Create separate audio device for Multicast/RTP" That should do it for the server.
For each client, run
paprefs
and:Under "Network Access" tab, select:
"Make discoverable PulseAudio network sound devices available locally"
Under "Multicast/RTP" tab, select:
"Enable Multicast/RTP receiver"
This should suffice for client configuration.
When it's time to listen to your broadcast, connect the server to the internet stream in the usual way. Then open System→Preferences→Sound and select "RTP Multicast" from the "Output" tab.
After that, on each client, open System→Preferences→Sound and look in the "Input" tab. It should contain an entry for an RTP Multicast from (server's hostname). I am not sure of the exact wording as I am not in a position to test it right at the moment. In any case, select the multicast, adjust the volume, and you should be hearing the broadcast (and any other audio) coming from the server.
As far as I know, there is no way to bind particular applications to particular inputs/outputs. If anyone knows of such a way, I would very much like to know about it. I have a question on the subject at How to clone audio output?.