在树莓派上建立Airplay音乐播放器的文章,百度一搜一大堆,比如:
https://appcodelabs.com/7-easy-steps-to-apple-airplay-on-raspberry-pi
https://coldnew.github.io/70c5ffb9/
这里只是做为笔记,记录一下曾经做过的步骤。
我使用的树莓派是 3B+,一下是系统信息:
pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux
编译并安装 shairport-sync
sudo apt-get update
sudo apt-get install build-essential git autoconf libtool \
libdaemon-dev libasound2-dev libpopt-dev libconfig-dev \
avahi-daemon libavahi-client-dev \
libssl-dev automake xmltoman
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
autoreconf -i -f
./configure \
--with-alsa --with-stdout --with-pipe --with-avahi \
--with-ssl=openssl --with-metadata --with-systemd
make
sudo make install
启动并测试 Airplay 到树莓派上
树莓派上启动 shairport-sync
sudo server shairport-sync start
在iphone上,打开音乐播放器APP,点击 Airplay 连接到树莓派上播放。
让树莓派开机时自动启动 shairport-sync
输入如下命令行:
sudo systemctl enable shairport-sync
树莓派返回:
Created symlink /etc/systemd/system/multi-user.target.wants/shairport-sync.service → /lib/systemd/system/shairport-sync.service.
然后重启电脑:
sudo reboot
树莓派启动后,查看 shairport-sync 服务的状态:
sudo systemctl status shairport-sync.service
状态信息如下:
说明 shairport-sync 服务已经启动。