Airplay and Spotify with Signal Cancel (ThinkPad ALC257)
How I got AirPlay (and Spotify Connect) working on a ThinkPad with ALSA only—and killed the idle hum
PulseAudio/pipewire wasn’t cooperating on my ThinkPad (Realtek ALC257). I wanted Shairport-Sync (AirPlay) and librespot (Spotify Connect) to play directly through ALSA, mix with each other, and not buzz when idle. Here’s the exact setup that finally worked.
Hardware & goal
- Laptop: ThinkPad T-series
- Codec: Realtek ALC257
- ALSA only (no PulseAudio/pipewire)
- Services:
- Shairport-Sync (AirPlay receiver)
- librespot (Spotify Connect)
- Hum silencer keep-alive so inputs don’t float (no buzz when idle)
1) Create a shared output with dmix (system-wide)
ALSA doesn’t mix by default. dmix lets multiple apps share the same device. Put this in /etc/asound.conf:
.dmixed_analog {
dmix
1024
false0666 slave {
"hw:0,0"44100S16_LE
2
0
1024
8192
}
}
.!default {
plug
.pcm "dmixed_analog"
}
.!default {
hw
0
}
If your card is not
hw:0,0, change both thepcm "hw:X,Y"andcardlines accordingly (aplay -lshows the indexes).
If you switch to 48 kHz later, update all commands/services to match that rate.
2) Add a hum silencer keep-alive (systemd, ALSA only)
Many receivers hum when the source goes idle (the DAC output “floats”). We keep the device lightly busy with a near-zero signal so the analog stage stays biased.
A robust service is a SoX→aplay pipe (SoX generates, aplay talks to ALSA):
/etc/systemd/system/alsa-keepalive.service
[Unit]
Keep ALSA output active to prevent hum (sox->aplay)
sound.target
sound.target
0
[Service]
/bin/bash -lc '/usr/bin/sox -q -r 44100 -c 2 -b 16 -e signed-integer -n -t raw - synth 0 pinknoise vol 0.0006 | /usr/bin/aplay -q -D default -f S16_LE -c 2 -r 44100'
always
2
10
[Install]
multi-user.target
Enable it:
Alternative: if you prefer a sub-bass tone that’s usually inaudible:
|
3) Configure Shairport-Sync to use default (dmix), not hw:0,0
Depending on how you installed it, your config is either /etc/shairport-sync.conf or /usr/local/etc/shairport-sync.conf. Mine was /usr/local/etc/shairport-sync.conf.
Minimal working config:
{
"Tulip Speaker";
"avahi";
2;
"alsa";
};
{
"default"; "no"; "S16";
44100; "Headphone";# pick a control that exists on your card
"hw:0";
};
Restart and verify logs reference default (not plughw:0,0):
|
4) Configure librespot (Spotify Connect) for ALSA + hardware mixer
/etc/systemd/system/librespot.service
[Unit]
Spotify Connect (librespot)
network-online.target sound.target
network-online.target
[Service]
spotify
audio
/var/lib/librespot
/usr/local/bin/librespot -n "Jaybird's Jam" -B alsa -d default -m alsa -S hw:0 -T "Headphone" -b 160 -G -C /var/lib/librespot -z 8765 -i -v
always
5
true
[Install]
multi-user.target
5) Verify
aplay -D default -f S16_LE -r 44100 /usr/share/sounds/alsa/Front_Center.wavplays.systemctl status alsa-keepalive→ running (no hum when idle).- AirPlay + Spotify play together without “device busy”.
- Mixer control (
Headphone) adjusts volume correctly.
Final note
This configuration keeps the setup pure ALSA—no PulseAudio, no PipeWire.
Everything shares the same default dmix sink, stays silent when idle, and your ThinkPad’s analog output finally behaves like proper audio gear.