NOTE Unfortunately all link are broken because message: Sorry, new users can only put 2 links in a post
. See Create a home NAS, gaming and video streaming client using Armbian / Radxa 5B+ (rx3588) in my gist for wokring link.
I have removed my personal experience here, beacuse It doesn’t add to the discussion.
Create a home NAS, gaming and video streaming client using Armbian / Radxa 5B+ (rx3588)
First steps
Install and update the OS
- Install Armbian OS
In my case I used the [onboard eMMC via USB](https:// docs.radxa .com/en/rock5/rock5b/low-level-dev/maskrom/windows) and the [latest Armbian image for Rock 5b](https:// www.armbian .com/rock-5b-plus/). - Update the system
sudo apt-get update sudo apt-get upgrade
Adjust the fan control
Initially I thought the FAN was not working. Then, I realized it was starting at 60+ deg.
This is a problem for me, because I also have 2 NVMe SSD drives on the bottom and the board becomes hot, fast. So, I have change the FAN control:
By looking in my Armbian device tree (dtc -I fs -O dts /sys/firmware/devicetree/base
) I see the values are:
- soc-thermal -> trips -> 60°C - 85°C - 115°C
- cooling-levels -> 0 64 128 192 255 (converted from hex)
temperature | Fan |
---|---|
0 - 60 | 0 |
60 - 85 | 64 (25%) |
85 - 115 | 128 (50%) |
115+ | 192 (75%) |
I have created new cooling-levels
values: 19% - 50% - 100% - 100% = 48 - 128 - 255 = 0x30 0x80 0xff 0xff 0xff
temperature | Fan |
---|---|
0 - 60 | 48 (19%) |
60 - 85 | 128 (50%) |
85+ | 255 (100%) |
- Create
pwm-fan.dts
file:/dts-v1/; /plugin/; / { fragment@0 { target = <&fan0>; __overlay__ { cooling-levels = <0x30 0x80 0xff 0xff 0xff>; }; }; };
- Apply the overlay:
sudo armbian-add-overlay pwm-fan.dts
- Reboot
- NOTE: I plan to also use FAN controlled by the GPIO pins and will post my update here.
Adjust the UI (install packages and extensions)
- Install packages
# GNOME extensions & manager # GNOME software that I will use (Startup Apps Manager, Gnome Software) sudo apt install \ gnome-shell-extensions gnome-shell-extension-manager \ gnome-startup-applications \ gnome-software
- Show the
minimize
andmaximize
buttons in the windowsgsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"
- Instal the desktop icons extension
Gtk4 Desktop Icons NG
from theExtensions Manager
. I will need this because I will use the Desktop as application launcher.
Then I change the extension settings:- Make Size of the icons = Large
- Action to open items = Single click (so it’s easier to open with controller, see [Enable game controller support](#enable-game-controller-support ))
- Install the extension
Caffeine
and set it to never suspend.
Remove apps I will not use
As I will not use this board as regular PC I don’t need some of this app.
It may be different for you:
- midnight commander:
sudo apt purge mc mc-data
- Meld (a diff tool, vscode can do it):
sudo apt purge meld
- HexChat (some kind of ICQ? Really?):
sudo apt purge hexchat hexchat-common
- FileZilla (a good FTP app, but I will not need it):
sudo apt purge filezilla filezilla-common
- regexxer (search files by Regex, not needed):
sudo apt purge regexxer
- Remmina (remote desktop client):
sudo apt purge remmina remmina-common
- Emacs (text editor/terminal):
sudo apt purge emacs emacs-gtk emacs-el
- Firefox (it won’t even start for me):
sudo apt purge firefox
- LibreOffice:
sudo apt purge libreoffice libreoffice-gtk3 libreoffice-common
- Thunderbird (mail client)
sudo apt purge thunderbird
NAS
Create RAID 1 from 2 NVMe drives
I have 2x1GB NVMe PCIe 3.0 drives that like to setup as RAID 1 to store my phone photos and family albums.
- Install ZFS:
Openarmbian-config
and install: System -> Storage -> ZFS filesystem - Identify your drives
lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT
- Create RAID array
sudo zpool create nas mirror /dev/nvme0n1 /dev/nvme1n1
- Open Files (Nautilus) go to /nas and bookmark it so it’s always visible
- Add the
/nas
drive to the Desktop icons as well as other folders you may need
Setup firewall
# install ufw firewall
sudo apt-get install ufw
# enable it
sudo ufw enable
# allow samba access over TCP and UDP only for my local network 192.168.0.0 to 192.168.0.255
sudo ufw allow proto udp to any port 137 from 192.168.0.0/24
sudo ufw allow proto udp to any port 138 from 192.168.0.0/24
sudo ufw allow proto tcp to any port 139 from 192.168.0.0/24
sudo ufw allow proto tcp to any port 445 from 192.168.0.0/24
Add user to access the NAS drive from outside
- Create
media
directory to hold the sync filessudo mkdir /nas/media
- Create a group (
storage
) and user (syncuser
) to access the/nas/media
foldersudo useradd --system syncuser sudo groupadd storage sudo usermod -aG storage syncuser sudo usermod -aG storage my_user # add myself # set the user and group as owners of the folder sudo chown -R syncuser:storage /nas/media/ # set owner rwx access sudo chmod 775 /nas/media
- Check group and access
# check group users sudo getent group storage # check folder access ls -l /nas/
Share the NAS in Samba
- Install samba
sudo apt install samba
- Edit file
/etc/samba/smb.conf
and add:[media] path = /nas/media writeable = yes browseable = yes create mask = 0775 force create mode = 0775 directory mask = 0775 force directory mode = 0775 force user = syncuser
- add samba password for syncuser
sudo smbpasswd -a syncuser
- restart samba
sudo systemctl restart smbd
Sync from Android phones
Network access Galaxy phones
- Open
My Files
- Go to
Network storage
- Add
Network drive (SMBv2/SMBv3)
- Enter
syncuser
/password
Auto sync photos
- Check your ip
ip addr
- Install
FolderSync
in Adroid - In
FolderSync
go to Accounts -> Add account -> SMB -> enter your IP, user=syncuser, password=yourpassword,SMB=SMB3,Enable DFS,Require encryption - Create a folderPair left=your photos right the SMB account
Stream Games (Moonlight)
First install [Sunshine](https:// app.lizardbyte .dev/Sunshine/?lng=en) on your streaming PC
Install Moonlight
- Download Moonlight
git clone https:// github .com/moonlight-stream/moonlight-qt.git cd moonlight-qt git submodule update --init --recursive
- Update the source to use the Rockchip rx3588 libs
echo 'LIBS += -L/usr/lib -lavcodec -lavutil -lavformat -lswscale' >> app/app.pro echo 'LIBS += -L/usr/lib -lavcodec -lavutil -lavformat -lswscale' >> moonlight-qt.pro
- Install build dependencies
sudo apt-get install libegl1-mesa-dev libgl1-mesa-dev libopus-dev libsdl2-dev libsdl2-ttf-dev libssl-dev \ libavcodec-dev libavformat-dev libswscale-dev libva-dev libvdpau-dev libxkbcommon-dev wayland-protocols \ libdrm-dev qt6-base-dev qt6-declarative-dev libqt6svg6-dev qml6-module-qtquick-controls qml6-module-qtquick-templates \ qml6-module-qtquick-layouts qml6-module-qtqml-workerscript qml6-module-qtquick-window qml6-module-qtquick
- Build it
qmake6 moonlight-qt.pro make release -j$(nproc)
- Make it visible by GNOME
# create a folder in the /usr/lib for moonlight sudo mkdir /usr/lib/moonlight/ # copy the app and icons to the new folder sudo cp app/moonlight* /usr/lib/moonlight # make a symbolic links for the app and icon sudo ln -s /usr/lib/moonlight/moonlight /usr/bin/moonlight sudo ln -s /usr/lib/moonlight/moonlight_wix.png /usr/share/pixmaps/moonlight.png # update gnome sudo desktop-file-install --dir=/usr/share/applications app/deploy/linux/com.moonlight_stream.Moonlight.desktop
- Now the moonlight app is in the GNOME apps and the ~/moonlight-qt folder can be removed
- Add Moonlight app to the desktop icons
cp /usr/share/applications/com.moonlight_stream.Moonlight.desktop ~/Desktop/Moonlight.desktop # make it trusted gio set ~/Desktop/Moonlight.desktop metadata::trusted true # make it executable chmod a+x ~/Desktop/Moonlight.desktop
- Open
Moonlight
. It should be hardware accelarated with the Rockchip hardware. I made the following option changes:- Set resolution to Native / 30FPS (it’s based on preference and network connection
- GUI Dysplay = Fullscreen (for open in fullscreen mode)
Make GNOME TV friendly
Enable game controller support (AntiMicroX)
I have old XBox 360 USB controller that works really well for controling GNOME:
- First install [FlatHub](https:// flathub .org/setup/Debian) if you don’t have it:
I recommend to restartsudo apt install flatpak sudo apt install gnome-software-plugin-flatpak flatpak remote-add --if-not-exists flathub https:// dl.flathub .org/repo/flathub.flatpakrepo
- Install the [AntiMicroX](https:// github .com/AntiMicroX/antimicrox) controller app
flatpak install flathub io.github.antimicrox.antimicrox
- AntiMiroX fix for Wayland problem “access to unpiut file”:
cd /usr/lib/udev/rules.d/ sudo wget https:// raw.githubusercontent .com/AntiMicroX/antimicrox/master/other/60-antimicrox-uinput.rules cd ~/
- You may need to reboot
- Open AntiMiroX and configure your controller. I use old XBox 360 USB Controller that I set:
- Pad is bound to Keyboard UP,LEFT,DOWN,RIGHT
- Left Joistick is Mouse UP,LEFT,DOWN,RIGHT
- B is ESC
- A is ENTER
- X is TAB
- Y is CAPSLOCK
- XBox center (Guide) button is Super L
- Hold the Back btn for 2 sec is ALT + F4
- RB is Menu
- Name the profile and save it in Home folder
- Make it start as Hidden at the login.
- Open Startup Applications app and add:
- Name: Controller Support
- Command: flatpak run io.github.antimicrox.antimicrox --hidden
- Comment: Start AntiMiroX for game controller support
- Open Startup Applications app and add:
Enable HDMI CEC
Lets install the CEC tools and test communication is working:
- install
v4l-utils
sudo apt install v4l-utils
- Check devices
cec-ctl --list-devices
/dev/cec0 # - HDMI 1 /dev/cec1 # - HDMI 2 # ...
- Register as playback
cec-ctl -d1 --playback -o Rock5B+
see the address - Test CEC communication
sudo cec-ctl -d1 \ # device /dev/cec1 -t0 \ # to address 0.0.0.0 (the TV itself) --playback -o Rock5B+ \ # register as playback device with name -T -M # monitor and trace (log debug info) --active-source phys-addr=3.0.0.0 \ # auto set the HDMI-CEC input in the TV --report-power-status pwr-state=on # autoreport the powers tatus of the Rock to on (Samsuns TV required it)
- I have writthen a python deamon that start the
cec-ctl
as a sub-process and track for stdout for keys [Python CEC Control](https:// github .com/rosenkolev/python-cec-control).
This is not great as a solution and will try another approach but the existing [cecdeamon](https:// github .com/simons-public/cecdaemon) don’t work.
I also tried usinglibcec
directly and it’s not working as well.
Add Shutdown/Reboot action to Desktop
[Desktop Entry]
Name=Shutdown
Comment=Shutdown
Exec=sudo shutdown -r now
Icon=/usr/share/icons/ubuntu-mono-light/actions/24/system-shutdown-panel.svg
Terminal=false
Type=Application
Multimedia
Jellyfin
Install Jellyfin
IMPORTANT Don’t follow [the Rockchip VPU tutorial](https:// jellyfin
.org/docs/general/administration/hardware-acceleration/rockchip)
- Just run the install script.
curl -s https:// repo.jellyfin .org/install-debuntu.sh | sudo bash
- Enable harware accelaration.
- Open WEB UI -> Profile -> Administration -> Dashboard -> Playback -> Transcoding -> Hardware Acceleration = Rockchip MPP
- Check all ckeckboxes
- Validate acceleration works by:
- run
sudo watch -n 1 cat /sys/kernel/debug/rkrga/load
- Play some content on reduced qulity and look at the terminal
- run
Make Jellyfin TV Friendly
- Enable TV Mode: WEB UI -> Profile -> Display -> Display Mode = TV
- Add a launch button on the Desktop to start the Jellyfin Web UI as and application in fullscreen (kiosk mode) with
- Create
Jellyfin.desktop
file:[Desktop Entry] Name=Jellyfin Comment=Jellyfin Exec=/usr/bin/chromium --kiosk --disable-session-crashed-bubble --disable-infobars --disable-features=TabRestore --load-extension=~/jellyfin_close_ext http:// localhost:8096 Icon=/usr/share/jellyfin/web/touchicon512.png Terminal=false Type=Application Categories=Media;
- Make it trusted and executable:
gio set ~/Desktop/Jellyfin.desktop metadata::trusted true chmod a+x ~/Desktop/Jellyfin.desktop
- Create
- Create a Chromium extension to add an Exit button (needed to exit kiosk by TV remote)
If you don’t need it remove--load-extension=~/jellyfin_close_ext
flag above!-
Create a folder
jellyfin_close_ext
-
Create a file
manifest.json
:{ "manifest_version": 3, "version": "1.0", "name": "jellyfin-close-button", "description": "Jellyfin close button", "permissions": ["scripting", "activeTab"], "host_permissions": ["*://localhost:8096/*"], "content_scripts": [ { "matches": ["http:// localhost:8096/web/"], "js": ["content-script.js"] } ] }
-
Create a file
content-script.js
:(function() { setTimeout(function () { const btn = document.querySelector('button[title=SyncPlay]'); const icon = btn.querySelector('.material-icons'); icon.classList.remove('groups'); icon.classList.add('close'); btn.addEventListener('click', function(event){ event.preventDefault(); event.stopPropagation(); window.close(); }, false); }, 1500); })();d
NOTE That I am replacing the groups button in the UI.
-