mfashby.net

Website mfashby.net
git clone git://code.mfashby.net:/mfashby.net
Log | Files | Refs | Submodules | README

2022-12-26-spotifyd.smd (2194B)


      1 ---
      2 .title = "Spotifyd",
      3 .author = "Martin Ashby",
      4 .date = @date("2022-12-26T23:08:03Z"),
      5 .layout = "single.shtml",
      6 .custom = {"comments": true},
      7 ---
      8 
      9 I recently discovered [spotifyd](https://spotifyd.github.io/), an open source alternative to the deprecated libspotify. I happened to also have a [pi-zero W](https://www.raspberrypi.com/news/raspberry-pi-zero-w-joins-family/) from a while back, and a [pHAT DAC](https://learn.pimoroni.com/article/raspberry-pi-phat-dac-install) amplifier.
     10 
     11 It was a relatively trivial job to set up the pi zero w headless, get audio output to the pHAT DAC, install spotifyd and use it as a spotify connect device connected to my old [Cambridge Audio A1](http://www.hi-fi-insight.com/cambridge-audio-a1-integrated-amplifier.html).
     12 
     13 Install guides: 
     14 - [raspberry pi headless](https://www.raspberrypi.com/documentation/configuration/wireless/headless.md), since I last used this, userconf.txt was added which allows setting up a proper user with a unique password! Bonus security points.
     15 - [spotifyd](https://spotifyd.github.io/spotifyd/installation/Raspberry-Pi.html), zero-w requires the arm-v6 variant, luckily they build releases for this architecture! Building on the pi-zero could take a while.
     16 - [phat-dac](https://learn.pimoroni.com/article/raspberry-pi-phat-dac-install)
     17 - [tailscale](https://tailscale.com/kb/1025/install-rpi/), not strictly necessary, but nice to have
     18 - and [ufw](https://help.ubuntu.com/community/UFW) and [unattended-upgrade](https://manpages.ubuntu.com/manpages/bionic/man8/unattended-upgrade.8.html), just for the additional security and sanity. Note that you must set spotifyd to listen on a fixed port for disovery to work, and allow that port in the firewall! Specifically set `--zeroconf-port <number>` either via command line or in the configuration file, and allow connections with `sudo ufw allow <number>`
     19 
     20 I tried a similar project a few years ago, using [MPD](https://www.musicpd.org/) and spotify plugin, but at the time it was too unreliable. Thanks to the folks who spent the time creating spotifyd!
     21 
     22 I should get a case for the pi some time, at the moment it's just freely sitting on the shelf next to the speakers.
     23