Jarkko's guides
You are here: Home » Raspberry Pi » Raspotify

Raspotify

This software is a Spotify Connect receiver. It is meant for a “headless” Linux system, meaning no keyboard/mouse/monitor attached. You need a Spotify Premium account to use this.

Website of the software: https://github.com/dtcooper/raspotify

How to use

What you can do in practice:

  • You can run the Spotify app on e.g. your TV, laptop or phone
  • Connect to the Raspberry Pi as playback device in the app
  • Your Raspberry Pi streams music directly from Spotify (as requested via the app)

Installation

sudo apt-get -y install curl
curl -sL https://dtcooper.github.io/raspotify/install.sh | sh

This executes an installation script that also adds a Debian package repository for the software. That way you can update it with apt afterwards. (See also Linux: software packages.)

ALSA loopback

In my use case I don't want Raspotify to directly output the audio to a playback device. Instead I want to connect it to an ALSA loopback device. See page Linux: audio about what it is.

This allows me to select either the music from Spotify or my TV as input in CamillaDSP. With the configuration below I can use dsnoop:Loopback,1,0 to get the sound from Raspotify. The sound from Raspotify is always 16 bit (format S16LE) with sample rate 44.1 kHz.

Configuration

Edit the following lines in /etc/raspotify/conf:

BITRATE=320                               # Highest possible quality
LIBRESPOT_ENABLE_VOLUME_NORMALISATION=off # Set to your preference
LIBRESPOT_NAME="Raspberry Pi Jarkko"      # Change to what you want
LIBRESPOT_DEVICE="hw:Loopback,0,0"        # Send audio to ALSA loopback

Then restart the Raspotify service:

sudo systemctl restart raspotify

Previous Next

ALL THE TOPICS ON THIS WEBSITE:

Linux

Raspberry Pi

Digital room correction

Web design

By Jarkko Huijts
Jarkko's guides

Table of Contents

Table of Contents

  • Raspotify
    • How to use
    • Installation
    • ALSA loopback
    • Configuration

RASPBERRY PI HARDWARE

  • Intro
  • Pinning & interfaces
  • Audio components
  • FLIRC for IR remotes
  • Small displays
  • USB gadget
  • Linux groups

RASPBERRY PI SOFTWARE

  • SD card images
  • CamillaDSP
  • Raspotify

MY DRC SET-UP

  • Overview
  • Spectrum analyzer

AVAILABLE TOPICS

  • Linux
  • Raspberry Pi
  • Digital room correction
  • Web design