Synology NAS as an Airplay Receiver
The Synology DSM already provides quite some fancy ways to stream music (and even video) *FROM* the Synology NAS via Airplay to Airplay Receivers e.g. Apple-TV, etc. (see: Synology's Blogpost on Airplay).
However: unfortunately I could not find any out-of-the-box-solution or a (neither official nor un-official) package to use the Synology NAS as an Airplay-Receiver to stream music *TO* the NAS (...and play back via an USB soundcard).
All I could find were some horribly complicated instructions on how to compile that stuff on your own and eventually get it working. I have to mention and thank...
- http://blog.elsdoerfer.name/2011/05/15/shairport-on-synology-nas/ and
- a C-only fork of shairport (unmodified ;-))
- ALSA instead of OSS for sound output (way less hassle)
My setup is as follows:
- Synology DS1512+ (Intel Atom thingy) with DSM 4.3-3776. Should work with others as well - not sure regarding ARM/PPC/etc... (feedback welcome)
- Audiolab M-DAC (A.10 firmware) as USB soundcard. Again: should work with others as well - however: you might want to check Synology's Compatibility List.
- Apple-Bonjour enabled
- SSH-Login to that Synology
- A working IPKG (Hint: this link)
What do I have to do?
1. fetch needed IPKG packages:
> ipkg install pkgconfig gcc make openssl openssl-dev alsa-lib
2. fetch shairport
> wget "https://github.com/abrasive/shairport/archive/master.zip" > unzip master.zip > cd shairport-master
3. compile shairport
> ./configure > CC=gcc make
4. Configure ALSA to allow playback for your user (by default not even root is allowed):
> echo "defaults.pcm.ipc_gid \"root\"" > ~/.asoundrc
5. Launch shairport into backgound
Default Airplay port is 5000, which is also the alternative port of the Synology DSM. Can be changed using "-p" in shairport. "-a" specifies the name which will appear in Airplay.
> LD_LIBRARY_PATH=/opt/lib ./shairport -p 5005 -a "Synology" &
Et voilà! Go to iTunes an try to use that new Airplay target.
Still a bit complicated to start and stop, but surprisingly this worked quite stable for the last hours now... ;-)
Next up: how do I compile a Synology Package... ;-)