本帖最后由 中关村东路 于 2022-7-19 18:28 编辑
4. 在HQPlayer OS中安装Roon Server
4.1 设置hqos的ssh登录
安装了hqos的x86主机启动之后应该有个登录提示符,输入root回车即可。差一下这台机器的ip,输入:
之后按提示修改一下root密码:
我比较保守,另外新建了一个用户用来ssh,你可以修改下面的username为你自己的用户名:
- useradd username
- passwd username
复制代码 至此就可以拔掉键盘显示器从远程登录了,例如在笔记本上打开终端模拟器,我用的是iTerm2,用户名,密码,ip就是本小节录入的:
- ssh username@hqos_ip_address
复制代码
4.2 安装roon
远程ssh登录之后我们首先下载并解压缩roon:
- cd /opt
- wget https://download.roonlabs.net/builds/RoonServer_linuxx64.tar.bz2
- tar xvf *.bz2
- rm *.bz2
复制代码 看看能不能执行:
- cd /opt/RoonServer
- ./start.sh
复制代码 本以为这样应该安装成功的,结果这时候会提示:
- /opt/RoonServer/Server/RoonServer: line 71: /opt/RoonServer/RoonDotnet/RoonServer: No such file or directory
- ./start.sh: line 34: kill: (1602) - No such process
复制代码 看一下错误信息,定位到问题所在是“/opt/RoonServer/RoonDotnet/RoonServer”不存在,但是执行:
- ls /opt/RoonServer/RoonDotnet/RoonServer
复制代码 发现是有这个文件的。再看看这个文件:
- file /opt/RoonServer/RoonDotnet/RoonServer
复制代码 原来是链接到了dotnet的runtime:
- /opt/RoonServer/RoonDotnet/RoonServer: symbolic link to /opt/RoonServer/RoonDotnet/dotnet
复制代码 再看看被链接的原文件:
- file /opt/RoonServer/RoonDotnet/dotnet
复制代码 显示结果:
- /opt/RoonServer/RoonDotnet/dotnet: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ce34c3793740b6d65dd1c38dcee5f1941932139f, for GNU/Linux 2.6.32, stripped
复制代码 这就找到问题了,根目录下没有这个动态链接“/lib64/ld-linux-x86-64.so.2”
再尝试一下,
- root@hqplayer:~# /opt/RoonServer/RoonDotnet/dotnet --info
- Host (useful for support):
- Version: 6.0.6
- Commit: 7cca709db2
- .NET SDKs installed:
- No SDKs were found.
- .NET runtimes installed:
- Microsoft.NETCore.App 6.0.6 [/opt/r/RoonServer/RoonDotnet/shared/Microsoft.NETCore.App]
- To install additional .NET runtimes or SDKs:
- https://aka.ms/dotnet-download
复制代码 现在基本上就搞定了。来试试
- root@hqplayer:/opt/RoonServer# ./check.sh
- Checking to see if RoonServer can run on this machine
- Checking for Binary Compatibility [ OK ]
- Checking for ALSA Libraries [ OK ]
- Checking for ffmpeg or avconv [ FAILED ]
- Checking for the mount.cifs command [ OK ]
- Checking for libicu [ OK ]
- Testing ulimit -n 8192 [ OK ]
- STATUS: FAILED
- These issues must be addressed before RoonServer will run on this machine.
- For more information on how to address this, see:
- http://kb.roonlabs.com/LinuxInstall
复制代码 说本机没安装ffmpeg/avconv,因为我们用hqplayer来做转码,不需要管。启动试试:
- root@hqplayer:/opt/RoonServer# ./start.sh
- 00:00:00.002 Warn: get lock file path: /tmp/.rnsgem0-
- 00:00:00.130 Debug: PathForResource, filename: ../.update
- 00:00:00.140 Debug: PathForResource, candidate: /opt/RoonServer/Server/../.update
- 00:00:00.144 Debug: PathForResource, filename: ../Appliance/RoonAppliance
- 00:00:00.144 Debug: PathForResource, candidate: /opt/RoonServer/Server/../Appliance/RoonAppliance
- Initializing
- Started
复制代码 成功了!
4.3 更新dotnet(可选)
强迫症患者会发现,“/opt/RoonServer/RoonDotnet/dotnet”的版本是6.0.6版本,看看官网吧,稳定版已经更新到6.0.7了。想更新就顺手更新一下吧,
【7】https://dotnet.microsoft.com/en-us/download/dotnet
- wget https://download.visualstudio.microsoft.com/download/pr/bd828687-1706-4041-a804-5e93631fe256/d4ec75936459a7e8c772c929edcbfeda/dotnet-runtime-6.0.7-linux-x64.tar.gz
- rm /opt/RoonServer/RoonDotnet/* -rf
- tar xvf dotnet-runtime-6.0.7-linux-x64.tar.gz -C /opt/RoonServer/RoonDotnet/
复制代码 记得恢复roon的三个链接,他家代码写的挺糙的。
- ln -s /opt/RoonServer/RoonDotnet/dotnet RAATServer
- ln -s /opt/RoonServer/RoonDotnet/dotnet RoonAppliance
- ln -s /opt/RoonServer/RoonDotnet/dotnet RoonServer
复制代码
4.4 设置自动启动
可能这一步是最重要的一步之一吧,否则即便是命令行狂热者,每次开机都要ssh进去启动也实在太麻烦了。
- nano /lib/systemd/system/roonserver.service
复制代码 把下面内容粘贴进去,千万别粘错了:
- [Unit]
- Description=RoonServer
- After=network-online.target sound.target
- Wants=network-online.target
- [Service]
- Type=simple
- User=root
- Environment=ROON_DATAROOT=/var/roon
- Environment=ROON_ID_DIR=/var/roon
- ExecStart=/opt/RoonServer/start.sh
- Restart=on-abort
- [Install]
- WantedBy=multi-user.target
复制代码 还要创建roon数据目录,
好了,设置roonserver自动启动了:
- systemctl --enable now roonserver.service
复制代码 大功告成!
|