Skip to content

Instantly share code, notes, and snippets.

@enricorotundo
Last active December 8, 2022 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enricorotundo/b1d138a85f76b8c8c9d3313a485b70ee to your computer and use it in GitHub Desktop.
Save enricorotundo/b1d138a85f76b8c8c9d3313a485b70ee to your computer and use it in GitHub Desktop.
Configure and install raspotify

Configure Raspberry and Install Raspotify

1) Get Raspberry Pi OS Lite

  • Release date: September 22nd 2022
  • System: 32-bit
  • Kernel version: 5.15
  • Debian version: 11 (bullseye)
  • Size: 338MB
  • Linux pi 5.15.61-v7+ #1579 SMP Fri Aug 26 11:10:59 BST 2022 armv7l
cd ~/Downloads
wget https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2022-09-26/2022-09-22-raspios-bullseye-armhf-lite.img.xz

2) Get Rasperry Imager

https://www.raspberrypi.com/software/

3) Use Imager to Format SD card to FAT32

4) Use Imager to Write OS to SD card

  • Set hostname to pi
  • Enable SSH, pi/raspberry
  • Set locale settings Europe/Rome, keyboard US
  • Disable "Play sound when finished"
  • Disable telemetry

5) Figure out and save Raspberry ip address

export PI_ADDRESS=192.168.178.119

6) Install Raspotify version 0.43.13

ssh pi@$PI_ADDRESS

# Follow the steps in https://github.com/dtcooper/raspotify/wiki/Basic-Setup-Guide

# Install Raspotify
sudo apt-get -y install curl && curl -sL https://dtcooper.github.io/raspotify/install.sh | sh
# Optionally Install higher quality sample rate converters
sudo apt update && sudo apt install -y --no-install-recommends libasound2-plugins
# Install asound-conf-wizard
sudo apt update && sudo apt install -y asound-conf-wizard

Then run asound-conf-wizard

pi@pi:~ $ sudo awiz

This utility will backup /etc/asound.conf if it already exists,
and generate a new /etc/asound.conf based on your choices.

This utility is intended to be used on headless systems
that run bare ALSA where the hardware does not change often or at all.

It is NOT advised to run this utility on desktop systems.

This utility will NOT run on systems that have PulseAudio,
Jack Audio or PipeWire installed. That is by design.

You should use those to configure audio if they are installed.

You can exit this utility any time by pressing Ctrl+C.

Please go to:

https://github.com/JasonLG1979/asound-conf-wizard

If you have any questions, issues, or would like to contribute to this project.

Please Enter "OK" to Continue: Ok

Please make sure that the Device(s) you wish to configure are not currently in use.

Devices that are in use may not be available to choose from.

Please Press Enter to Continue

Retrieving PCM parameters. This may take a moment…

hw:CARD=vc4hdmi,DEV=0 has no valid configurations, and will be ignored.

hw:CARD=Headphones,DEV=0 is reporting an unusually large number of supported sampling rates (100+).

hw:CARD=Headphones,DEV=0 is more than likely not a real hardware device, but is actually a hardware device behind a plug plugin.

hw:CARD=Headphones,DEV=0 is not software mixable, and will be ignored.

There are no available Playback PCMs…

There are no available Capture PCMs…

Configure Raspotify

https://github.com/dtcooper/raspotify

sudo apt install vim
sudo vim /etc/raspotify/conf

Set:

# Bitrate (kbps) {96|160|320}. Defaults to 160.
LIBRESPOT_BITRATE="320"
sudo systemctl restart raspotify

7) Install Airport player version 4.1.1

https://github.com/mikebrady/shairport-sync/tree/4.1.1

Follow: https://github.com/mikebrady/shairport-sync/blob/4.1.1/BUILD.md#2-get-tools-and-libraries

sudo apt install --no-install-recommends build-essential git autoconf automake libtool \
    libpopt-dev libconfig-dev libasound2-dev avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev \
    libplist-dev libsodium-dev libavutil-dev libavcodec-dev libavformat-dev uuid-dev libgcrypt-dev xxd

Install https://github.com/mikebrady/nqptp

git clone https://github.com/mikebrady/nqptp.git
cd nqptp
autoreconf -fi
./configure --with-systemd-startup
make
sudo make install
sudo systemctl enable nqptp
sudo systemctl start nqptp

Install shairport

cd ..
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
autoreconf -fi
./configure --sysconfdir=/etc --with-alsa \
    --with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-airplay-2
make
sudo make install

sudo systemctl enable shairport-sync
sudo systemctl start shairport-sync
sudo iwconfig wlan0 power on

Finally sudo reboot

Set asla volume

# set
alsamixer
# save
sudo alsactl store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment