Skip to content

Instantly share code, notes, and snippets.

@dialupdev
Last active September 8, 2024 19:10
Show Gist options
  • Select an option

  • Save dialupdev/e070e99ebf04f2d278a2b6b49c3aa908 to your computer and use it in GitHub Desktop.

Select an option

Save dialupdev/e070e99ebf04f2d278a2b6b49c3aa908 to your computer and use it in GitHub Desktop.

Revisions

  1. dialupdev revised this gist Sep 8, 2024. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -96,7 +96,11 @@ $ cd librespot
    > $ nano connect/src/spirc.rs
    > ```
    >
    > Look for `repeated.push(64)` and change it to `repeated.push(16)`.
    > Look for `const VOLUME_STEPS` and change that line and the following line to this:
    > ```rs
    > const VOLUME_STEPS: i64 = 16;
    > const VOLUME_STEP_SIZE: u16 = 4096; // (u16::MAX + 1) / VOLUME_STEPS
    > ```
    Build librespot. This step will take a very long time on a Raspberry Pi - most likely 30 minutes or more.
  2. Steve Davis revised this gist May 3, 2020. 1 changed file with 46 additions and 0 deletions.
    46 changes: 46 additions & 0 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -199,3 +199,49 @@ You can check the status of the service at any time by running the following com
    ```sh
    $ systemctl status shairport-sync
    ```

    # Avoiding conflicts over the sound card

    If you have both librespot and shairport-sync running, they'll fight over the sound card and you'll have to manually stop one before using the other. The solution to this is to stop librespot every time shairport-sync begins playing audio. See discussion here: https://github.com/mikebrady/shairport-sync/issues/152.

    First, add a sudoer file for shairport-sync by copying the default sudoer file.

    ```sh
    sudo cp /etc/sudoers.d/010_pi-nopasswd /etc/sudoers.d/010_shairport-sync-nopasswd
    ```

    Now edit that file.

    ```sh
    $ sudo nano /etc/sudoers.d/010_shairport-sync-nopasswd
    ```

    Change the username to give shairport-sync permission to use `sudo`

    ```sh
    shairport-sync ALL=(ALL) NOPASSWD: ALL
    ```

    Now edit the shairport-sync config again.

    ```sh
    $ sudo nano /etc/shairport-sync.conf
    ```

    Find the section called "sessioncontrol" and make it look like this.

    ```sh
    sessioncontrol =
    {
    run_this_before_play_begins = "/usr/bin/sudo systemctl stop librespot";
    run_this_after_play_ends = "/usr/bin/sudo systemctl start librespot";
    };
    ```

    Finally, reboot for your changes to take effect.

    ```sh
    $ sudo reboot now
    ```

    Great job! 🥃
  3. Steve Davis revised this gist Mar 2, 2020. 1 changed file with 25 additions and 13 deletions.
    38 changes: 25 additions & 13 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -61,7 +61,7 @@ $ alsamixer

    You should see `Card: snd_rpi_hifiberry_dac` displayed in the top left corner.

    # Setting up Spotify Connect
    # Setting up Spotify Connect using librespot

    Install https://github.com/librespot-org/librespot using the commands below.

    @@ -147,21 +147,26 @@ You can check the status of the service at any time by running the following com
    $ systemctl status librespot
    ```

    # Setting up Airplay
    # Setting up Airplay using Shairport Sync

    The following is taken from the install instructions located at https://github.com/mikebrady/shairport-sync/tree/development.
    The following is modified from the install instructions located at https://github.com/mikebrady/shairport-sync/blob/master/INSTALL.md.

    ```sh
    $ git clone https://github.com/mikebrady/shairport-sync.git

    $ git checkout development
    $ autoreconf -i -f
    $ ./configure --sysconfdir=/etc --with-alsa --with-pa --with-avahi --with-ssl=openssl --with-soxr --with-systemd
    $ sudo apt install build-essential git xmltoman
    $ sudo apt install autoconf automake libtool libdaemon-dev libpopt-dev libconfig-dev
    $ sudo apt install libasound2-dev
    $ sudo apt install avahi-daemon libavahi-client-dev
    $ sudo apt install libssl-dev
    $ sudo apt install libsoxr-dev

    $ autoreconf -i -f
    $ ./configure --sysconfdir=/etc --with-alsa --with-avahi --with-ssl=openssl --with-soxr --with-systemd
    $ make
    $ sudo make install
    $ sudo systemctl enable shairport-sync
    ```

    Now, edit this file:

    ```sh
    @@ -173,17 +178,24 @@ Change these values:
    ```sh
    general = {
    name = "whatever you want!";
    };
    alsa = {
    output_device = "hw:1,0"; // (or whatever number card,device "sndrpihifiberry" is above)
    interpolation = "soxr";
    };
    ```

    If audio is underflowing, set `audio_backend_buffer_desired_length` to 22050.
    Now we can start the service.

    ```sh
    $ sudo systemctl start shairport-sync
    ```

    And set it to start automatically on every boot.

    ```sh
    $ sudo systemctl enable shairport-sync
    ```

    Restart Shairport-sync to apply the new settings.
    You can check the status of the service at any time by running the following command.

    ```sh
    $ sudo service shairport-sync restart
    $ systemctl status shairport-sync
    ```
  4. Steve Davis revised this gist Mar 1, 2020. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -115,16 +115,15 @@ Copy the following into the service configuration file.
    ```sh
    [Unit]
    Description=Spotify Connect daemon
    After=network.target
    StartLimitIntervalSec=0
    Documentation=https://github.com/librespot-org/librespot
    After=sound.target
    After=network-online.target

    [Service]
    Type=simple
    ExecStart=/home/pi/librespot/target/release/librespot -u [spotify_username] -p [spotify_password] -n "Librespot" -b 320 -c /tmp/librespot
    Restart=always
    RestartSec=1
    User=pi
    ExecStart=/home/pi/librespot/target/release/librespot -u [spotify_username] -p [spotify_password] -n "Librespot" -b 320 -c /home/pi/librespot/cache --enable-volume-normalisation
    RestartSec=5

    [Install]
    WantedBy=multi-user.target
  5. Steve Davis revised this gist Feb 8, 2020. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -71,7 +71,11 @@ First, install Rust and Cargo using [rustup](https://rustup.rs/).
    $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    ```

    Log out of your account and log back in to add the `cargo` binary into your `PATH`.
    Source the cargo env file to add the `cargo` binary into your `PATH`.

    ```sh
    $ source $HOME/.cargo/env
    ```

    Now, install `git` and build dependencies.

  6. Steve Davis revised this gist Feb 8, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -76,7 +76,7 @@ Log out of your account and log back in to add the `cargo` binary into your `PAT
    Now, install `git` and build dependencies.

    ```sh
    $ sudo apt-get install build-essential libasound2-dev
    $ sudo apt install git build-essential libasound2-dev
    ```

    Clone the repo and navigate to the directory.
  7. Steve Davis revised this gist Feb 8, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -68,15 +68,15 @@ Install https://github.com/librespot-org/librespot using the commands below.
    First, install Rust and Cargo using [rustup](https://rustup.rs/).

    ```sh
    $ curl https://sh.rustup.rs -sSf | sh
    $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    ```

    Log out of your account and log back in to add the `cargo` binary into your `PATH`.

    Now, install `git` and build dependencies.

    ```sh
    $ sudo apt install git build-essential portaudio19-dev
    $ sudo apt-get install build-essential libasound2-dev
    ```

    Clone the repo and navigate to the directory.
  8. Steve Davis revised this gist Jun 6, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ This configuration works with [HiFiBerry DACs](https://www.hifiberry.com/build/d
    If you are using WiFi, turn off WiFi Power Management.

    ```sh
    $ iwconfig wlan0 power off
    $ sudo iwconfig wlan0 power off
    ```

    Configure the device tree overlay by editing boot config.
  9. Steve Davis revised this gist Jun 6, 2019. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,12 @@ First, [install Raspbian](https://gist.github.com/celeryclub/8f74c76a641310462ab

    This configuration works with [HiFiBerry DACs](https://www.hifiberry.com/build/documentation/configuring-linux-3-18-x/) and the Sabre ES9023 chip.

    If you are using WiFi, turn off WiFi Power Management.

    ```sh
    $ iwconfig wlan0 power off
    ```

    Configure the device tree overlay by editing boot config.

    ```sh
  10. Steve Davis revised this gist Nov 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -70,7 +70,7 @@ Log out of your account and log back in to add the `cargo` binary into your `PAT
    Now, install `git` and build dependencies.

    ```sh
    $ sudo apt-get install git build-essential portaudio19-dev
    $ sudo apt install git build-essential portaudio19-dev
    ```

    Clone the repo and navigate to the directory.
  11. Steve Davis revised this gist Nov 24, 2018. 1 changed file with 44 additions and 0 deletions.
    44 changes: 44 additions & 0 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -94,6 +94,50 @@ Build librespot. This step will take a very long time on a Raspberry Pi - most l
    $ cargo build --release
    ```
    Now, let's create a system service for `librespot`.

    ```sh
    sudo nano /etc/systemd/system/librespot.service
    ```

    Copy the following into the service configuration file.

    ```sh
    [Unit]
    Description=Spotify Connect daemon
    After=network.target
    StartLimitIntervalSec=0
    Documentation=https://github.com/librespot-org/librespot

    [Service]
    Type=simple
    Restart=always
    RestartSec=1
    User=pi
    ExecStart=/home/pi/librespot/target/release/librespot -u [spotify_username] -p [spotify_password] -n "Librespot" -b 320 -c /home/pi/librespot/cache --enable-volume-normalisation

    [Install]
    WantedBy=multi-user.target
    ```

    Now we can start the service.

    ```sh
    $ sudo systemctl start librespot
    ```

    And set it to start automatically on every boot.

    ```sh
    $ sudo systemctl enable librespot
    ```

    You can check the status of the service at any time by running the following command.

    ```sh
    $ systemctl status librespot
    ```

    # Setting up Airplay

    The following is taken from the install instructions located at https://github.com/mikebrady/shairport-sync/tree/development.
  12. Steve Davis revised this gist Nov 24, 2018. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,12 @@ Configure the device tree overlay by editing boot config.
    $ sudo nano /boot/config.txt
    ```

    Remove the following line if it exists. This will disable the onboard sound card.

    ```sh
    dtparam=audio=on
    ```

    Add the following line to the end of the file.

    ```sh
  13. Steve Davis revised this gist Nov 23, 2018. 1 changed file with 14 additions and 11 deletions.
    25 changes: 14 additions & 11 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ This configuration works with [HiFiBerry DACs](https://www.hifiberry.com/build/d
    Configure the device tree overlay by editing boot config.

    ```sh
    sudo nano /boot/config.txt
    $ sudo nano /boot/config.txt
    ```

    Add the following line to the end of the file.
    @@ -19,6 +19,8 @@ dtoverlay=hifiberry-dac
    Reboot your Pi and make sure device shows up.

    ```sh
    $ sudo reboot now

    $ aplay -l
    ```

    @@ -28,19 +30,20 @@ Create `/etc/asound.conf` with the following content. Replace `0` with your card

    ```sh
    pcm.!default {
    type hw
    card 0
    type hw
    card 0
    }

    ctl.!default {
    type hw
    card 0
    type hw
    card 0
    }
    ```

    Reboot your Pi and make sure the ALSA settings have taken effect.

    ```sh
    $ sudo reboot now
    $ alsamixer
    ```

    @@ -53,36 +56,36 @@ Install https://github.com/librespot-org/librespot using the commands below.
    First, install Rust and Cargo using [rustup](https://rustup.rs/).

    ```sh
    curl https://sh.rustup.rs -sSf | sh
    $ curl https://sh.rustup.rs -sSf | sh
    ```

    Log out of your account and log back in to add the `cargo` binary into your `PATH`.

    Now, install `git` and build dependencies.

    ```sh
    sudo apt-get install git build-essential portaudio19-dev
    $ sudo apt-get install git build-essential portaudio19-dev
    ```

    Clone the repo and navigate to the directory.

    ```sh
    git clone https://github.com/librespot-org/librespot.git
    cd librespot
    $ git clone https://github.com/librespot-org/librespot.git
    $ cd librespot
    ```

    > Optional step: Change the number of volume steps from 64 to 16. I prefer this because it matches the iPhone's volume control. 🙂
    >
    > ```sh
    > nano connect/src/spirc.rs
    > $ nano connect/src/spirc.rs
    > ```
    >
    > Look for `repeated.push(64)` and change it to `repeated.push(16)`.
    Build librespot. This step will take a very long time on a Raspberry Pi - most likely 30 minutes or more.
    ```sh
    cargo build --release
    $ cargo build --release
    ```
    # Setting up Airplay
  14. Steve Davis revised this gist Nov 22, 2018. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -24,8 +24,6 @@ $ aplay -l

    Look for `card 0: sndrpihifiberry`. Your card ID may be different from `0`.

    ## Configure ALSA

    Create `/etc/asound.conf` with the following content. Replace `0` with your card ID from above.

    ```sh
  15. Steve Davis revised this gist Nov 22, 2018. 1 changed file with 4 additions and 6 deletions.
    10 changes: 4 additions & 6 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -74,18 +74,16 @@ cd librespot
    ```

    > Optional step: Change the number of volume steps from 64 to 16. I prefer this because it matches the iPhone's volume control. 🙂
    > ```
    > sh
    >
    > ```sh
    > nano connect/src/spirc.rs
    > ```
    >
    > Look for `repeated.push(64)` and change it to `repeated.push(16)`.
    Build librespot. This step will take a very long time on a Raspberry Pi - most likely 30 minutes or more.
    ```
    sh
    ```sh
    cargo build --release
    ```
  16. Steve Davis revised this gist Nov 22, 2018. 1 changed file with 39 additions and 5 deletions.
    44 changes: 39 additions & 5 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,6 @@
    First, [install Raspbian](https://gist.github.com/celeryclub/8f74c76a641310462ab3).

    Release 2017-07-05 is the latest one compatible with this guide.
    https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-07-05/

    # Set up your sound card
    # Configuring your sound card

    This configuration works with [HiFiBerry DACs](https://www.hifiberry.com/build/documentation/configuring-linux-3-18-x/) and the Sabre ES9023 chip.

    @@ -53,7 +50,44 @@ You should see `Card: snd_rpi_hifiberry_dac` displayed in the top left corner.

    # Setting up Spotify Connect

    Follow installation instructions here: https://github.com/Spotifyd/spotifyd
    Install https://github.com/librespot-org/librespot using the commands below.

    First, install Rust and Cargo using [rustup](https://rustup.rs/).

    ```sh
    curl https://sh.rustup.rs -sSf | sh
    ```

    Log out of your account and log back in to add the `cargo` binary into your `PATH`.

    Now, install `git` and build dependencies.

    ```sh
    sudo apt-get install git build-essential portaudio19-dev
    ```

    Clone the repo and navigate to the directory.

    ```sh
    git clone https://github.com/librespot-org/librespot.git
    cd librespot
    ```

    > Optional step: Change the number of volume steps from 64 to 16. I prefer this because it matches the iPhone's volume control. 🙂
    > ```
    > sh
    > nano connect/src/spirc.rs
    > ```
    > Look for `repeated.push(64)` and change it to `repeated.push(16)`.
    Build librespot. This step will take a very long time on a Raspberry Pi - most likely 30 minutes or more.
    ```
    sh
    cargo build --release
    ```
    # Setting up Airplay
  17. Steve Davis revised this gist Nov 22, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -53,7 +53,7 @@ You should see `Card: snd_rpi_hifiberry_dac` displayed in the top left corner.

    # Setting up Spotify Connect

    Follow installation instructions here: https://github.com/dtcooper/raspotify (uses newer `librespot` from https://github.com/librespot-org/librespot)
    Follow installation instructions here: https://github.com/Spotifyd/spotifyd

    # Setting up Airplay

  18. Steve Davis revised this gist Nov 22, 2018. 1 changed file with 23 additions and 19 deletions.
    42 changes: 23 additions & 19 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,19 @@
    Modified from https://www.hifiberry.com/guides/configuring-linux-3-18-x/.

    First, [install Raspbian](https://gist.github.com/celeryclub/8f74c76a641310462ab3).

    Release 2017-07-05 is the latest one compatible with this guide.
    https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-07-05/

    # ES9023 sound card setup
    # Set up your sound card

    This configuration works with [HiFiBerry DACs](https://www.hifiberry.com/build/documentation/configuring-linux-3-18-x/) and the Sabre ES9023 chip.

    ## Configure the device tree overlay
    Configure the device tree overlay by editing boot config.

    ```sh
    sudo nano /boot/config.txt
    ```

    To do this, you must edit `/boot/config.txt` and add the following line
    Add the following line to the end of the file.

    ```sh
    dtoverlay=hifiberry-dac
    @@ -21,31 +25,31 @@ Reboot your Pi and make sure device shows up.
    $ aplay -l
    ```

    Look for `card { id }: sndrpihifiberry`.
    Look for `card 0: sndrpihifiberry`. Your card ID may be different from `0`.

    ## Configure ALSA Mixer
    ## Configure ALSA

    Create `/etc/asound.conf` with the following content:
    Create `/etc/asound.conf` with the following content. Replace `0` with your card ID from above.

    ```sh
    pcm.softvol {
    type softvol
    slave.pcm "plughw:0"
    control {
    name "Spotify"
    card 0
    }
    pcm.!default {
    type hw
    card 0
    }

    ctl.!default {
    type hw
    card 0
    }
    ```

    Make sure the mixer shows up.
    Reboot your Pi and make sure the ALSA settings have taken effect.

    ```sh
    $ amixer
    $ alsamixer
    ```

    Look for `Simple mixer control 'Spotify',0`.

    You should see `Card: snd_rpi_hifiberry_dac` displayed in the top left corner.

    # Setting up Spotify Connect

  19. Steve Davis revised this gist Nov 21, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ Create `/etc/asound.conf` with the following content:
    ```sh
    pcm.softvol {
    type softvol
    slave.pcm "plughw:1"
    slave.pcm "plughw:0"
    control {
    name "Spotify"
    card 0
  20. Steve Davis revised this gist Nov 21, 2018. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ $ aplay -l

    Look for `card { id }: sndrpihifiberry`.

    ## Configure ALSA
    ## Configure ALSA Mixer

    Create `/etc/asound.conf` with the following content:

    @@ -38,6 +38,15 @@ pcm.softvol {
    }
    ```

    Make sure the mixer shows up.

    ```sh
    $ amixer
    ```

    Look for `Simple mixer control 'Spotify',0`.


    # Setting up Spotify Connect

    Follow installation instructions here: https://github.com/dtcooper/raspotify (uses newer `librespot` from https://github.com/librespot-org/librespot)
  21. Steve Davis revised this gist Nov 21, 2018. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -7,14 +7,22 @@ https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-07-05/

    # ES9023 sound card setup

    ## Configure device tree overlay file
    ## Configure the device tree overlay

    To do this, you must edit `/boot/config.txt` and add the following line

    ```sh
    dtoverlay=hifiberry-dac
    ```

    Reboot your Pi and make sure device shows up.

    ```sh
    $ aplay -l
    ```

    Look for `card { id }: sndrpihifiberry`.

    ## Configure ALSA

    Create `/etc/asound.conf` with the following content:
    @@ -30,14 +38,6 @@ pcm.softvol {
    }
    ```

    Reboot your Pi and make sure device shows up.

    ```sh
    $ aplay -l
    ```

    Look for `card { id }: sndrpihifiberry`.

    # Setting up Spotify Connect

    Follow installation instructions here: https://github.com/dtcooper/raspotify (uses newer `librespot` from https://github.com/librespot-org/librespot)
  22. Steve Davis revised this gist Nov 1, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ Look for `card { id }: sndrpihifiberry`.

    # Setting up Spotify Connect

    Follow installation instructions here: https://github.com/Fornoth/spotify-connect-web
    Follow installation instructions here: https://github.com/dtcooper/raspotify (uses newer `librespot` from https://github.com/librespot-org/librespot)

    # Setting up Airplay

  23. Steve Davis revised this gist Nov 1, 2018. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -38,7 +38,11 @@ $ aplay -l

    Look for `card { id }: sndrpihifiberry`.

    # Installing shairport-sync
    # Setting up Spotify Connect

    Follow installation instructions here: https://github.com/Fornoth/spotify-connect-web

    # Setting up Airplay

    The following is taken from the install instructions located at https://github.com/mikebrady/shairport-sync/tree/development.

  24. Steve Davis revised this gist Aug 16, 2018. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,9 @@ Modified from https://www.hifiberry.com/guides/configuring-linux-3-18-x/.

    First, [install Raspbian](https://gist.github.com/celeryclub/8f74c76a641310462ab3).

    Release 2017-07-05 is the latest one compatible with this guide.
    https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-07-05/

    # ES9023 sound card setup

    ## Configure device tree overlay file
  25. Steve Davis revised this gist Jul 5, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    Modified from https://www.hifiberry.com/guides/configuring-linux-3-18-x/.

    First, [install Raspbian](https://gist.github.com/celeryclub/8f74c76a641310462ab3).

    # ES9023 sound card setup

    ## Configure device tree overlay file
  26. Steve Davis revised this gist Jul 5, 2018. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -67,3 +67,9 @@ alsa = {
    ```

    If audio is underflowing, set `audio_backend_buffer_desired_length` to 22050.

    Restart Shairport-sync to apply the new settings.

    ```sh
    $ sudo service shairport-sync restart
    ```
  27. Steve Davis revised this gist Jun 2, 2018. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,21 @@ To do this, you must edit `/boot/config.txt` and add the following line
    dtoverlay=hifiberry-dac
    ```

    ## Configure ALSA

    Create `/etc/asound.conf` with the following content:

    ```sh
    pcm.softvol {
    type softvol
    slave.pcm "plughw:1"
    control {
    name "Spotify"
    card 0
    }
    }
    ```

    Reboot your Pi and make sure device shows up.

    ```sh
  28. Steve Davis revised this gist Jun 2, 2018. 1 changed file with 0 additions and 21 deletions.
    21 changes: 0 additions & 21 deletions Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -10,21 +10,6 @@ To do this, you must edit `/boot/config.txt` and add the following line
    dtoverlay=hifiberry-dac
    ```

    ## Configure ALSA

    Create `/etc/asound.conf` with the following content:

    ```sh
    pcm.softvol {
    type softvol
    slave.pcm "plughw:1"
    control {
    name "Master"
    card 0
    }
    }
    ```

    Reboot your Pi and make sure device shows up.

    ```sh
    @@ -33,12 +18,6 @@ $ aplay -l

    Look for `card { id }: sndrpihifiberry`.

    ## Initialize mixer

    ```sh
    $ speaker-test -D softvol -c 2 -t wav
    ```

    # Installing shairport-sync

    The following is taken from the install instructions located at https://github.com/mikebrady/shairport-sync/tree/development.
  29. Steve Davis revised this gist Jun 2, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -67,7 +67,7 @@ general = {
    name = "whatever you want!";
    };
    alsa = {
    output_device = "hw:0,0"; // (or whatever number card,device "sndrpihifiberry" is above)
    output_device = "hw:1,0"; // (or whatever number card,device "sndrpihifiberry" is above)
    interpolation = "soxr";
    };
    ```
  30. Steve Davis revised this gist Jun 1, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Raspberry Pi Music Server.md
    Original file line number Diff line number Diff line change
    @@ -67,7 +67,7 @@ general = {
    name = "whatever you want!";
    };
    alsa = {
    output_device = "hw:1"; // (or whatever number card "sndrpihifiberry" is above)
    output_device = "hw:0,0"; // (or whatever number card,device "sndrpihifiberry" is above)
    interpolation = "soxr";
    };
    ```