Copy these commands to your Raspberry Pi. Run them in order.
# 1. Copy project files to your Pi (from your computer)
scp -r /path/to/AirplayPortable pi@<your-pi-ip>:~/airplay
# 2. SSH into your Pi
ssh pi@<your-pi-ip>
# 3. Run installer
cd ~/airplay
chmod +x install.sh
sudo ./install.sh
# 4. Reboot
sudo rebootsudo apt update && sudo apt upgrade -ysudo raspi-config nonint do_i2c 0
sudo raspi-config nonint do_spi 0sudo apt install -y build-essential git autoconf automake libtool \
libpopt-dev libconfig-dev libasound2-dev libavahi-client-dev \
libssl-dev libsoxr-dev libplist-dev libsodium-dev libavutil-dev \
libavcodec-dev libavformat-dev libgcrypt20-dev libxxhash-dev \
uuid-dev xmltoman xxd python3-pip python3-venv python3-dev \
python3-smbus python3-pil i2c-tools hostapd dnsmasq avahi-daemonEdit boot config:
sudo nano /boot/firmware/config.txtAdd at the end:
# I2S DAC
dtparam=i2s=on
dtoverlay=hifiberry-dac
Comment out onboard audio:
#dtparam=audio=on
cd ~
git clone https://github.com/mikebrady/nqptp.git
cd nqptp
autoreconf -fi
./configure --with-systemd-startup
make -j$(nproc)
sudo make install
sudo systemctl enable nqptp
sudo systemctl start nqptpcd ~
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 -j$(nproc)
sudo make install
sudo systemctl enable shairport-syncsudo nano /etc/shairport-sync.confPaste this configuration:
general = {
name = "Portable AirPlay";
interpolation = "soxr";
output_backend = "alsa";
mdns_backend = "avahi";
volume_range_db = 60;
};
alsa = {
output_device = "hw:0";
mixer_control_name = "Digital";
mixer_device = "hw:0";
};
sudo tee /etc/asound.conf << 'EOF'
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
EOFcd ~/airplay
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install RPi.GPIO adafruit-circuitpython-ssd1306 adafruit-blinka \
Pillow rpi_ws281x adafruit-circuitpython-neopixel flask alsaaudiosudo cp ~/airplay/services/airplay-ui.service /etc/systemd/system/
sudo cp ~/airplay/services/wifi-portal.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable airplay-uisudo reboot# Check DAC is detected
aplay -l
# Test audio output
speaker-test -t sine -f 440 -c 2 -D hw:0# Check I2C device
sudo i2cdetect -y 1
# Should show 0x3C
# Test display
cd ~/airplay
source venv/bin/activate
python3 -c "
import board
import adafruit_ssd1306
from PIL import Image, ImageDraw
i2c = board.I2C()
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c)
oled.fill(0)
image = Image.new('1', (128, 64))
draw = ImageDraw.Draw(image)
draw.text((10, 25), 'Hello AirPlay!', fill=255)
oled.image(image)
oled.show()
print('Display working!')
"sudo python3 -c "
import board
import neopixel
pixels = neopixel.NeoPixel(board.D10, 1, brightness=0.2)
pixels[0] = (0, 255, 0)
print('LED should be green')
input('Press Enter to turn off...')
pixels[0] = (0, 0, 0)
"# Check Shairport Sync
sudo systemctl status shairport-sync
# Check UI service
sudo systemctl status airplay-ui
# View logs
journalctl -u airplay-ui -f# Check if DAC overlay loaded
dmesg | grep -i hifiberry
# Check ALSA
amixer -c 0# Check I2C enabled
ls /dev/i2c*
# Check wiring and address
sudo i2cdetect -y 1# Check Python environment
~/airplay/venv/bin/python3 --version
# Run manually for errors
cd ~/airplay
source venv/bin/activate
python3 src/main.py