Airplay on RaspberryPi, using shairport-sync

在树莓派上建立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

\color{blue}{安装依赖包}

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

\color{blue}{下载shairport-sync 最新代码}

git clone https://github.com/mikebrady/shairport-sync.git

\color{blue}{配置,编译,安装}

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 连接到树莓派上播放。

image.png

让树莓派开机时自动启动 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

状态信息如下:


image.png

说明 shairport-sync 服务已经启动。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容