raspotify

Raspotify

Spotify Connect client for the Raspberry Pi that Just Works™.

tl;dr

Install the Spotify Connect client on your Raspberry Pi,

curl -sL https://dtcooper.github.io/raspotify/install.sh | sh

Introduction

Raspotify is a Spotify Connect client for Raspbian on the Raspberry Pi that Just Works™. Raspotify is a Debian package and associated repository which thinly wraps the awesome librespot library by Paul Lietar that works out of the box on all three revisions of the Pi, immediately after installation.

Download Latest Version

Head on over to the releases page to download themost recent version and install the Debian package. Or follow the directions below.

Requirements

Raspotify works on a Raspberry Pi running Raspbian. You’ll need a Spotify Premium account in order to use Connect.

Raspotify should work on any Pi but it has been tested on,

Easy Installation

This command downloads and installs the Debian package and adds its apt repository, which ensures you’ll always be up to date with upstream changes.

curl -sL https://dtcooper.github.io/raspotify/install.sh | sh

That’s it! Plug a speaker into your Pi on your local network, select the device in Spotify et voilà!

Hard installation

Essentially, here’s what the easy installer does,

# Install curl and https apt transport
sudo apt-get -y install curl apt-transport-https

# Add repo and its GPG key
curl -sSL https://dtcooper.github.io/raspotify/key.asc | sudo apt-key add -v -
echo 'deb https://dtcooper.github.io/raspotify jessie main' | sudo tee /etc/apt/sources.list.d/raspotify.list

# Install package
sudo apt-get update
sudo apt-get -y install raspotify

Or just download the latest .deb package and install it manually:

Uninstalling

To uninstall, remove the package,

sudo apt-get remove -y raspotify

To completely remove the Raspotify and its Debian repo, try

sudo apt-get remove -y --purge raspotify
sudo rm -v /etc/apt/sources.list.d/raspotify.list

Configuration

Raspotify works out of the box and should be discoverable on Spotify Connect on your local network, however you can configure it by editing /etc/default/raspotify which passes arguments to librespot.

# /etc/default/raspotify -- Arguments for librespot

# Device name on Spotify Connect
#DEVICE_NAME="raspotify"

# Bitrate, one of 96 (low quality), 160 (default quality), or 320 (high quality)
#BITRATE="160"

# Additional command line arguments for librespot can be set below.
# See `librespot -h` for more info.
#
# To make your device visible on Spotify Connect across the Internet add your
# username and password which can be set via "Set device password", on your
# account settings, use `--username` and `--password`.
#
# To choose a different output device (ie a USB audio dongle or HDMI audio out),
# use `--device` with something like `--device hw:0,1`. Your mileage may vary.
#
#OPTIONS="--username <USERNAME> --password <PASSWORD>"

# Uncomment to use a cache for downloaded audio files. It's best to leave this
# as-is since permissions are properly set on directory `/var/cache/raspotify'.
#CACHE_ARGS="--cache /var/cache/raspotify"

After editing restart the daemon by running sudo systemctl restart raspotify.

Building the Package Yourself

All that’s required is Docker on a *nix system with git and Make. It can built on any amd64 platform that runs docker using Raspberry Pi’s cross-compiler (tested on Ubuntu 16.04 LTS and macOS El Capitan).

git clone https://github.com/dtcooper/raspotify
cd raspotify
make

There should be a built Debian package (a .deb file) in your project directory.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Special thanks to Paul Lietar for librespot, which Raspotify packages. Without librespot, Raspotify would simply not exist.