Ubuntu – How to stream music over the network to multiple computers

musicstream

Results

I want to be able to walk from one room to another and hear the same song playing. Like you do if you were listening to the radio in all rooms.

I want that effect but I want to listen to my own music, can this be done?

Materials

  • Ubuntu laptop.
  • Mac computer.

First alternative

Best Answer

Yes, with pulseaudio this can easily be done. You will need to install and run paprefs Install paprefs that makes your sound devices available over the network.

enter image description here

enter image description here

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).

Related Question