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。
到此这篇airplay2(airplay2如何使用)的文章就 介绍到这了,更多相关内容请继续浏览下面的相关 推荐文章,希望大家都能在 编程的领域有一番成就!版权声明:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权、违法违规、事实不符,请将相关资料发送至xkadmin@xkablog.com进行投诉反馈,一经查实,立即处理!
转载请注明出处,原文链接:https://www.xkablog.com/rfx/30115.html