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.
Raspberry Pi Music Server

Modified from https://www.hifiberry.com/guides/configuring-linux-3-18-x/.

ES9023 sound card setup

Configure device tree overlay file

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:

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

Reboot your Pi and make sure device shows up.

$ aplay -l

Look for card { id }: sndrpihifiberry.

Initialize mixer

$ 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.

$ 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

$ make
$ sudo make install
$ sudo systemctl enable shairport-sync

Now, edit this file:

sudo nano /etc/shairport-sync.conf

Change these values:

general = {
	name = "whatever you want!";
};
alsa = {
	output_device = "hw:0,0"; // (or whatever number card,device "sndrpihifiberry" is above)
	interpolation = "soxr";
};

If audio is underflowing, set audio_backend_buffer_desired_length to 22050.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment