Home music server setup
Abstract
I want to get rid of my old and bulky CD player and use my tiny home server instead for music playback. The idea is to connect the analog audio output of my small home server to an amplifier and let the server play some music over the big HiFi system. I want playback controlled by a different device like my notebook or smartphone and everything should be controlled remotely over the network. My preference would be that the music is stored on the home server. The home server should also accept an audio stream from any other device on the network, like it works with airplay. I have no idea how to accomplish all this and collect my ideas and findings here in this article.
Server as Airplay receiver
It seems pretty easy to turn the home server into an airplay receiver: Just install shairport-sync
on the server. There is a Debian backport available and this may be an option in case there are compatibility issues with devices running the latest iOS.
Also install the alsa-utils
. This allows to set volume using alsamixer
. In my case, volume was set to minimum and output was muted.
Enable the service systemctl enable shairport-sync
and start the service systemctl start shairport-sync
.
Note that UFW needs to be configured to allow connections for the airplay. Here is an example UFW configuration from the troubleshooting document that comes with shairport-sync:
ufw allow from 192.168.1.1/16 to any port 3689 proto tcp
ufw allow from 192.168.1.1/16 to any port 5353
ufw allow from 192.168.1.1/16 to any port 5000:5005 proto tcp
ufw allow from 192.168.1.1/16 to any port 6000:6005 proto udp
ufw allow from 192.168.1.1/16 to any port 35000:65535 proto udp
That's it. Now I can send music from my iPhone to my tiny home server to play on my big HiFi.
Airplay client
Installation and setup
Apple devices can stream music to the server without further configuration. In order to stream music from devices running Linux over the airplay protocol to the server, pulseaudio-module-raop
and paprefs
and pulseaudio-module-zeroconf
and pavucontrol
needs to be installed on the device that has the music stored. Running Debian buster, I had to use those packages from the backports repository.
Run paprefs and set "Make discoverable Apple AirTunes sound devices available locally". Reboot the client machine. Run pavucontrol to set sound output device.
Troubleshooting
Running pacmd list-sinks
shows details on available audio sinks.
Running pulseaudio --kill
, deleting ~/.config/pulse
and running pulseaudio --start
followed by a reboot has helped me getting rid of a misconfigured sink.
Server as music player
Setting up the server to receive music via airplay was surprisingly easy. I had expected Apple to place more obstacles in the way. I haven't found a way to play music stored on the server on my HiFi yet. It seems that Jellyfin could be worth a try. But is also seems that this software is designed to stream music stored on the server to the remote device for playback on the remote device only. I could use airplay to output the stream back to the server. This back and forth action is not really what I'm looking for.