Using an Orange Pi Zero as Airplay Speakers…

… and redirecting all sound from desktop Ubuntu to them.

Note that this system isn’t working perfectly for me and I’m finding the sound drops out about once a minute. I’m looking into other methods using pulseaudio.

On Orange Pi Zero

Set up an Orange Pi Zero and boot it using an Armbian installation (it will say “Welcome to ARMBIAN” when you log in).

sudo apt update
sudo apt upgrade armbian-config
sudo armbian-config

armbian-config Main Menu

armbian-config Main Menu

Wait until it loads, then select “System” (arrow keys to move up and down, Enter to select).

armbian-config System Menu

armbian-config System Menu

Scroll down to “Hardware” with the arrow keys and press Enter.

armbian-config Hardware Menu

armbian-config Hardware Menu

Use arrow keys to select “analog-codec” (if it isn’t already) and then press space so that a “*” appears between the square brackets (if it isn’t there already).
Press Enter to Save.

Right arrow to select “Exit” and press Enter.

Right arrow to select “Cancel” and press Enter.

Right arrow to select “Cancel” and press Enter.

You have now enabled the audio output.

sudo apt install shairport-sync

You now have the sound server program running. Lets name it something different.

sudo nano /etc/shairport-sync.conf

Use the arrow keys to move the cursor to the start of the first line after “general =” that starts with a “//”. Press return to add a new line above it.

On the new line you created, press tab and then type (for example) :

name = “Sitting Room Speakers”

The part of the file should now look like this :
________________________________________________________________________________
// Sample Configuration File for Shairport Sync
// Commented out settings are generally the defaults, except where noted.

// General Settings
general =
{
name = “Sitting Room Speakers”
// name = “%H”; // This means “Hostname” — see below. This is the name th$
________________________________________________________________________________

Press Ctrl+x
Press y
Press Return

On mine I found that it was turned down really low, so had to turn it up. Run the following command to set the volume levels :

alsamixer

Left and right arrows select the “fader” – you want to push “Line Out” and “DAC” up. Push them both up until they start turning grey instead of green – you might want to return to this later to fine tune levels once you have music playing.

Restart the Orange Pi Zero :

sudo reboot

On Linux Desktop Computer (e.g. BeeLink S2)

sudo apt update
sudo apt install paprefs pulseaudio-module-raop

Search for an application called “PulseAudio Preferences” (press the windows key and start typing)

Check “Make discoverable Apple AirTunes sound devices available locally” and click “Close”.

Restart the computer.

Launch the “Settings” application and go to “Sound”. You should see your Orange Pi listed under “Output”. I have two versions appearing, one has what looks like a MAC address after it, the other my Orange Pi’s ip address. Use the latter.

Note there is usually a couple of seconds of latency due to the buffering, but this is fine with music (not so much with video).

If the audio drops out once in a while…

The following command increases the priority of the shairport-sync server running on the Orange Pi Zero by setting all process run by the user (-u) “shairport-sync” to be very important. Hopefully this will help. Another option might be to increase the buffer size, although this would increase latency.

sudo renice -n -19 -u shairport-sync

Leave a Reply