I’ve moved over from Squeezebox server to Roon as my multi-room music playback system. The new system works wonderfully, and I love it. However, there’s one thing that I’ve had a problem with, and that’s getting Apples AirPlay to work reliably with my Roon Raspberry Pi endpoints running Diet-Pi Linux. The Shairport-sync constantly crashed. After searching around the net, I found a solution to my problem.

Raspberry Pi, Diet-Pi Linux and Shairport

When using a Raspberry Pi DAC board, everything works as it should when installing Roon and Shairport in Diet-Pi Linux. However, I’ve upgraded to better external USB DAC’s, and Shairport refused to work. Here’s two things that should make it work again.

Changing shairport-sync.conf

To get USB DAC’s to work in Diet-Pi, you need to modify the shairport-sync.conf file and add some settings.

You need to SSH into the Raspberry Pi endpoint and make some edits.

pico /usr/local/etc/shairport-sync.conf

Scroll down until you are in the ´alsa´ section of the settings in the file. Add the two following rows of settings to the alsa settings.

output_rate = 88200; // can be 44100, 88200, 176400 or 352800
output_format = "S32"; // can be "U8", "S8", "S16", "S24", "S24_3LE", "S24_3BE" or "S32"

The above setting works perfectly for my Topping D-50 DAC.

If you’re DAC can’t handle either of the sample rates and 32-bit resolution, set it to one of the other settings, for example, 44100 and S16 for CD-quality audio.

On my S.M.S.L SU-8 DAC, I also needed to add the following line; otherwise, there was no sound output:

output_device="hw:1";

Do a restart of the shairport software with the command:

diet-pi-services restart shairport-sync

So my complete shairport-sync now looks like this:

general =
{
  name = "%H";
  interpolation = "soxr";
};

metadata =
{
        enabled = "yes";
        include_cover_art = "no";
        pipe_name = "/tmp/shairport-sync-metadata";
        pipe_timeout = 5000;
        socket_address = "226.0.0.1";
        socket_port = 5555;
        socket_msglength = 65000;
};

alsa =
{
//    mixer_control_name = "PCM";
    output_device="hw:1";
    output_rate = 88200; // can be 44100, 88200, 176400 or 352800
    output_format = "S32"; // can be "U8", "S8", "S16", "S24", "S24_3LE", "S24_3BE" or "S32"
};

You should now have a working AirPlay setup on your Diet-Pi Raspberry Pi.