1. SSH连接上锐角云,安装准备包
</p><p> # apt update</p><p> # apt install --no-install-recommends build-essential git autoconf automake libtool </p><p> libpopt-dev libconfig-dev libasound2-dev avahi-daemon libavahi-client-dev libssl-dev libsoxr-dev </p><p> libplist-dev libsodium-dev libavutil-dev libavcodec-dev libavformat-dev uuid-dev libgcrypt-dev xxd</p><p>
2. 安装 nqptp
</p><p> $ git clone https://github.com/mikebrady/nqptp.git</p><p> $ cd nqptp</p><p> $ autoreconf -fi</p><p> $ https://www.bilibili.com/read/configure --with-systemd-startup</p><p> $ make</p><p> # make install</p><p>
</p><p> # systemctl enable nqptp</p><p> # systemctl start nqptp</p><p>
3. 安装Mqtt client
</p><p> apt install libmosquitto-dev</p><p>
4. 安装Shairport-Sync,这里没有使用Apple的解码包 –with-apple-alac
</p><p> $ git clone https://github.com/mikebrady/shairport-sync.git</p><p> $ cd shairport-sync</p><p> $ autoreconf -fi</p><p> $ https://www.bilibili.com/read/configure --sysconfdir=/etc --with-alsa </p><p> --with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-airplay-2 </p><p> --with-stdout --with-pipe --with-metadata </p><p> --with-mqtt-client</p><p> $ make</p><p> # make install</p><p>
5. 配置文件
</p><p> #/etc/shairport-sync.conf</p><p> </p><p> general = {</p><p> name = "惠威音箱";</p><p> output_backend = "alsa"; </p><p> port = 7100; #7000</p><p> #alac_decoder = "hammerton"; #apple</p><p> };</p><p> </p><p> alsa =</p><p> {</p><p> output_device = "default";</p><p> };</p><p> </p><p> metadata =</p><p> {</p><p> enabled = "yes";</p><p> include_cover_art = "yes"; </p><p> cover_art_cache_directory = "/tmp/shairport-sync/.cache/coverart"; </p><p> pipe_name = "/tmp/shairport-sync-metadata";</p><p> pipe_timeout = 5000; </p><p> </p><p> };</p><p> </p><p> mqtt =</p><p> {</p><p> enabled = "yes"; </p><p> hostname = "192.168.1.xx"; </p><p> port = 1883; </p><p> username = "mqtt"; </p><p> password = "xxxx"; </p><p> topic = "player/shairport"; </p><p> publish_parsed = "yes"; </p><p> empty_payload_substitute = "--"; </p><p> publish_cover = "yes";</p><p> enable_remote = "yes"; </p><p> };</p><p> </p><p> </p><p> sessioncontrol =</p><p> {</p><p> active_state_timeout = 30.0;</p><p> allow_session_interruption = "yes"; </p><p> session_timeout = 120; </p><p> };</p><p>
6. 启动
</p><p> # systemctl enable shairport-sync</p><p> # systemctl restart shairport-sync</p><p>
7. 日志
</p><p> systemctl enable shairport-sync</p><p>
8. 接入Home-assistant
</p><p> # Shairport Sync media player for Home Assistant</p><p> # https://github.com/parautenbach/hass-shairport-sync</p><p> # https://www.home-assistant.io/integrations/universal/</p><p> media_player:</p><p> - platform: shairport_sync</p><p> name: shairport</p><p> topic: player/shairport</p><p>
二、测试播放
三、加入苹果家庭APP,HomeKit。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/189648.html