Setup instructions for configuring shairport-sync on a Raspberry Pi with a hardware DAC, after completing the BUILD.md instructions, in place of the Finish Setting Up guide.
Direct ALSA hardware access to the DAC provides:
- Better audio fidelity (no PulseAudio processing/degradation)
- Hardware volume control (instant response to volume/mute)
- Lower CPU overhead (hardware mixer offloads work)
-
Identify your hardware DAC device name:
shairport-sync -h
Look for the hardware output devices listed (e.g.,
hw:BossDAC) -
Find the mixer control name:
amixer -c BossDAC scontrols
or
amixer -c BossDAC
Look for volume controls with
pvolumecapability. Common names:Digital,PCM,MasterFor BossDAC specifically: the mixer control is
Digital(207 steps, 0-207 range)
Since this is a dedicated music player, PulseAudio interferes with direct hardware access and should be disabled:
systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service
systemctl --user disable pulseaudio.socket
systemctl --user disable pulseaudio.serviceWhy: PulseAudio blocks direct ALSA access to hardware. Desktop Linuxes use sound servers, but dedicated audio devices don't need them.
Edit /etc/shairport-sync.conf:
general = {
name = "%H %v";
output_backend = "alsa";
};
alsa = {
output_device = "hw:BossDAC"; // Your hardware DAC name (step 1)
mixer_control_name = "Digital"; // The volume control mixer name (step 2)
disable_standby_mode = "auto"; // Prevents popping when DAC enters/exits standby
};
Critical gotcha: Even if the alsa section is configured correctly, shairport-sync may default to PulseAudio if output_backend = "alsa" is not explicitly set in the general section.
Consider adding to the general section:
general = {
name = "%H %v";
output_backend = "alsa";
volume_range_db = 60; // Typical range for useful volume control
// volume_max_db = 0.0; // Reduce if DAC outputs too much volume
};
Why:
volume_range_db: Ensures the full volume slider range is useful (not mostly inaudible at low end)volume_max_db: Prevents overloading downstream amplifiers if needed
sudo systemctl restart shairport-syncCheck logs for errors:
sudo journalctl -u shairport-sync -fTest hardware directly:
speaker-test -D hw:BossDAC -c 2- Error:
/home/shairport-sync/.config/pulse→ You forgot to setoutput_backend = "alsa"in general section - Device busy → PulseAudio is still running, or another process has the device open
- Permission denied → User needs access to audio group
# Check if PulseAudio is running
ps aux | grep pulse
pactl info
# List ALSA devices
aplay -L
# List mixer controls
amixer -c BossDAC scontrols- Configuration docs:
shairport-sync/docs/ADVANCED TOPICS/InitialConfiguration.md - Best practices:
shairport-sync/docs/ADVANCED TOPICS/GetTheBest.md