shairport-sync安装笔记

安装

测试环境:ubuntu 26.04.1

bash 复制代码
sudo apt install shairport-sync alsa-utils

配置服务

需要配置到user session,否则pipewire会冲突。

bash 复制代码
ethan@G5000:~$ cat ~/.config/systemd/user/shairport-sync.service 
[Unit]
Description=Shairport Sync - AirPlay Audio Receiver (User)
After=pipewire-pulse.service
Requires=pipewire-pulse.service

[Service]
Type=simple
Restart=on-failure
ExecStart=/usr/bin/shairport-sync -c /etc/shairport-sync.conf

[Install]
WantedBy=default.target
ethan@G5000:~$ sudo systemctl disable shairport-sync.service

否则pipewire冲突,出现如下LOG

复制代码
ethan@G5000:~$ sudo journalctl -u shairport-sync -f 
9月 02 17:02:22 G5000 shairport-sync[19826]: fatal error: failed to connect to the pulseaudio context -- the error message is "Connection refused".
9月 02 17:02:22 G5000 systemd[1]: shairport-sync.service: Main process exited, code=exited, status=1/FAILURE

修改配置文件,使用pa后端,适应pipewire。

bash 复制代码
ethan@G5000:~$ cat /etc/shairport-sync.conf | grep Ethan 
	output_backend = "pa"; // Added by Ethan

启动(开机启动)

bash 复制代码
sudo systemctl daemon-reload 
systemctl --user enable --now shairport-sync.service

常见问题

WiFi环境,播放卡顿

bash 复制代码
ethan@G5000:~$ cat /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf 
[connection]
wifi.powersave = 2

wifi.powersave = 3改成wifi.powersave = 2

相关推荐
飞雪20077 个月前
局域网服务发现技术, DNS-SD和mDNS具体有什么区别, 什么不同?
开发语言·局域网·mdns·airplay·dns-sd·airprint
zhoujiazhao2 年前
【001_音频开发-基础篇-专业术语】
音视频·嵌入式·dlna·audio·airplay·qplay·spotify