关于airplay2的折腾

Lenovo Y1 (Newifi mini R6830)

先刷不死breed
https://breed.hackpascal.net/
找到breed-mt7620-lenovo-y1.bin,下载备用。
路由器插上电源,用网线将路由器和电脑连接在一起(Newifi 的任意一个网口均可);
在「网络和共享中心」(Windows)或者「系统偏好设置 网络」(Mac),找到对应的网络,设置其 IPv4 地址为 192.168.1.2,子网掩码为 255.255.255.0;
设置好后,断开路由器电源,按住 Reset 按键不松,连上电源,Reset 继续按住 5 秒以上。如果看到路由器的部分或全部LED连闪4次,或 ping 通即表明进入 Web 刷机模式;
这时候电脑访问 192.168.1.1 即可进入路由器自带恢复模式;
选择文件 breed-mt7620-lenovo-y1.bin,点击恢复按钮;
等待升级完成

后编译Opnwrt, 选好型号后,勾选
luci-app-airplay2
kmod-usb-audio
然后就结束了,生成固件输入R6830,启动airplay2就结束了。
要么本地编译,要么去github上修改config进行编译
最好本地生成config然后丢github上去编译。
我本地WIN10启动WLS,编译几次后各种报错,还不如github上效率高。

OneCloud

关于刷机

玩客云刷机就不记录了,大致就是第一次需要拆开短接两个触电
刷机过一次后,想更换其他系统,就不需要这么麻烦了,按住reset键再通电就可以刷机了。
https://github.com/hzyitc/armbian-onecloud/releases/tag/ci-20230221-125606-UTC

安装shairport-sync

注意 # 标识root权限运行;$ 标识普通用户权限运行。编译一定要普通用户权限运行。
https://github.com/mikebrady/shairport-sync/blob/master/BUILD.md

1
2
3
4
5
# sudo apt update
# sudo apt upgrade this is optional but recommended
# sudo 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 alsa-utils

刷其中一台玩客云的时候,发现安装alsa几个软件怎么都装不上,反复update和upgrade也不行。换源也不行,最后还是重新刷了一遍才可以。

1
2
3
4
5
6
7
$ git clone https://github.com/mikebrady/shairport-sync.git
$ cd shairport-sync
$ autoreconf -fi
$ ./configure --sysconfdir=/etc --with-alsa \
--with-soxr --with-avahi --with-ssl=openssl --with-systemd --with-airplay-2
$ make
# sudo make install
1
# sudo systemctl enable shairport-sync

安装NQPTP

https://github.com/mikebrady/nqptp

1
2
3
4
5
6
7
$ cd
$ git clone https://github.com/mikebrady/nqptp.git
$ cd nqptp
$ autoreconf -fi
$ ./configure --with-systemd-startup
$ make
# sudo make install
1
2
# sudo systemctl enable nqptp
# sudo systemctl start nqptp

sps-alsa-explore

一个可以帮助我们Shairport Sync的工具,可以很直观的列出当前的音频输出设备,需要手动编译安装。

1
2
3
4
5
6
$ cd
$ git clone https://github.com/mikebrady/sps-alsa-explore.git #下载项目
$ cd sps-alsa-explore #进入项目目录
$ autoreconf -fi #编译
$ ./configure #配置
$ make #构建环境

将音箱连接到树莓派,然后在sps-alsa-explore目录下执行./sps-alsa-explore

安装FFmpeg

sudo apt-get install ffmpeg

To play AirPlay 2 Buffered Audio streams, Shairport Sync needs an AAC decoder capable of decoding Planar Floating Point -- fltp -- AAC material. Unfortunately, not all systems have such a decoder. To troubleshoot this, the idea here is to use the [ffmpeg](https://www.ffmpeg.org/) app, which may already be installed in your system, to list AAC decoders and to check that the default AAC decoder has fplp capability. Here is an example of where the AAC decoder _can_ decode fltp material. The system is a Raspberry Pi running 64-bit Raspberry Pi OS Lite 11 (Bullseye):

1
ffmpeg -decoders | grep -i aa
1
ffmpeg -h decoder=aac

一些设置

设置默认声卡

1
sudo vim /etc/asound.conf

可能系统VIM也没有,还需要安装一下

1
sudo apt-get install vim

defaults.ctl.card 1

defaults.pcm.card 1

defaults.timer.card 1

Shairport Sync的一些设置

cp /etc/shairport-sync.conf /etc/shairport-sync.conf.bak
vim /etc/shairport-sync.conf
name
output_device # 改成./sps-alsa-explore获取到的声卡名字
mixer_control_name # 取消备注
mixer_control_index # 取消备注
mixer_device # 改成./sps-alsa-explore获取到的声卡名字

重启服务器

1
sudo reboot

其他

1
2
# sudo systemctl restart nqptp
# sudo systemctl restart shairport-sync

关于airplay2的折腾
http://yoursite.com/2023/03/14/NAS/关于airplay2的折腾/
作者
五泡哥
发布于
2023年3月15日
许可协议