1. SSH连接上锐角云,安装准备包
# apt update
# apt install --no-install-recommends build-essential git autoconf automake libtool
libpopt-dev libconfig-dev libasound2-dev avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev
libplist-dev libsodium-dev libavutil-dev libavcodec-dev libavformat-dev uuid-dev libgcrypt-dev xxd
2. 安装 nqptp
$ git clone https://github.com/mikebrady/nqptp.git
$ cd nqptp
$ autoreconf -fi
$ https://www.bilibili.com/read/configure --with-systemd-startup
$ make
# make install
# systemctl enable nqptp
# systemctl start nqptp
3. 安装Mqtt client
apt install libmosquitto-dev
4. 安装Shairport-Sync,这里没有使用Apple的解码包 --with-apple-alac
$ git clone https://github.com/mikebrady/shairport-sync.git
$ cd shairport-sync
$ autoreconf -fi
$ https://www.bilibili.com/read/configure --sysconfdir=/etc --with-alsa
--with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-airplay-2
--with-stdout --with-pipe --with-metadata
--with-mqtt-client
$ make
# make install
5. 配置文件
#/etc/shairport-sync.conf
general = {
name = "惠威音箱";
output_backend = "alsa";
port = 7100; #7000
#alac_decoder = "hammerton"; #apple
};
alsa =
{
output_device = "default";
};
metadata =
{
enabled = "yes";
include_cover_art = "yes";
cover_art_cache_directory = "/tmp/shairport-sync/.cache/coverart";
pipe_name = "/tmp/shairport-sync-metadata";
pipe_timeout = 5000;
};
mqtt =
{
enabled = "yes";
hostname = "192.168.1.xx";
port = 1883;
username = "mqtt";
password = "xxxx";
topic = "player/shairport";
publish_parsed = "yes";
empty_payload_substitute = "--";
publish_cover = "yes";
enable_remote = "yes";
};
sessioncontrol =
{
active_state_timeout = 30.0;
allow_session_interruption = "yes";
session_timeout = 120;
};
6. 启动
# systemctl enable shairport-sync
# systemctl restart shairport-sync
7. 日志
systemctl enable shairport-sync
8. 接入Home-assistant
# Shairport Sync media player for Home Assistant
# https://github.com/parautenbach/hass-shairport-sync
# https://www.home-assistant.io/integrations/universal/
media_player:
- platform: shairport_sync
name: shairport
topic: player/shairport
二、测试播放
三、加入苹果家庭APP,HomeKit。
今天的文章 2026年airplay2(airplay2如何使用)分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/bian-cheng-ri-ji/54035.html