Setup Belabox modified with Wireguard remote access, wireguard-multipath and BiB Comms audio output working via Pipewire, Pulse and ALSA
DO NOT RUN ON BELABOX: Flash belabox image to SD card (/dev/sdX):
sudo dd if=Downloads/belabox_rock_5b_plus-xxxxxxxx-xxxxxxx.img of=/dev/sdX bs=4M status=progress oflag=syncUpdate the system:
sudo apt update -y && sudo apt upgrade -ySet the correct hostname:
sudo hostnamectl set-hostname <new-hostname>Correct the /etc/hosts file so that the new hostname resolves to 127.0.0.1
Install tools for configuring and debugging:
sudo apt install -y jq nano curl usbutils pciutilsInstall wg:
sudo apt install -y wireguardPaste wg config (make sure to remove IPv6 and adjust the MTU to 1340 and endpoint to 127.0.0.1:59401 if using wireguard-multipath):
sudo nano /etc/wireguard/wg0.confEnable wg connection on boot:
sudo systemctl enable --now wg-quick@wg0Install wireguard-multipath:
sudo wget "$(
curl -s https://api.github.com/repos/blokadainfo/wireguard-multipath/releases/latest \
| jq -r '.assets[] | select(.name | endswith("_linux_arm64")) | .browser_download_url'
)" -O /usr/local/bin/wgmp \
&& sudo chown root:root /usr/local/bin/wgmp \
&& sudo chmod +x /usr/local/bin/wgmpEdit /etc/systemd/system/wgmp-client.service:
[Unit]
Description=Wireguard Multipath Client Service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/wgmp client
Environment="WGMP_CLIENT_SERVER_ADDR=<vpn_domain>:59501"
Environment="WGMP_CLIENT_EXCLUDED_CIDRS=10.42.0.0/16"
Restart=on-failure
RestartSec=1
[Install]
WantedBy=multi-user.target
Reload and enable the service:
sudo systemctl daemon-reload && \
sudo systemctl enable --now wgmp-client.serviceInstall pipewire with pulse and alsa support:
sudo apt install -y pipewire pipewire-pulse pipewire-audio-client-libraries pipewire-media-session- wireplumber dbus-user-session alsa-utils pulseaudio-utilsAdd user to audio group:
sudo usermod -aG audio $USEREnable pipewire session on boot:
sudo systemctl unmask systemd-logind && \
sudo systemctl restart systemd-logind && \
sudo loginctl enable-linger $USER && \
sudo rebootSet default output to 3.5mm jack:
pactl set-default-sink alsa_output.platform-es8316-sound.stereo-fallbackCRUCIAL STEP:
Using alsamixer (press F6, choose rockchip-es8316, press F5 to show all options) fix silence by unmuting "Left Headphone Mixer Left DAC" and "Right Headphone Mixer Right DAC".
Edit /etc/asound.conf:
pcm.!default {
type pipewire
}
ctl.!default {
type pipewire
}
Reboot:
sudo rebootTest alsa:
speaker-test -D default -c 2Test alsa with audio file:
aplay -D default /usr/share/sounds/alsa/Front_Center.wavTest pulseaudio with audio file:
paplay /usr/share/sounds/alsa/Front_Center.wavTest pipewire with audio file:
pw-play /usr/share/sounds/alsa/Front_Center.wavInstall dependencies:
sudo apt install -y libopenal-dev libopus-dev libasound2-dev pkg-config ffmpegInstall bib-comms:
sudo wget "$(
curl -s https://api.github.com/repos/blokadainfo/bib-comms/releases/latest \
| jq -r '.assets[] | select(.name | endswith("_linux_arm64")) | .browser_download_url'
)" -O /usr/local/bin/bib-comms \
&& sudo chown root:root /usr/local/bin/bib-comms \
&& sudo chmod +x /usr/local/bin/bib-commsMake directory for user services:
mkdir -p ~/.config/systemd/user/Edit ~/.config/systemd/user/bib-comms.service:
[Unit]
Description=BiB Comms Service
After=network-online.target wg-quick@wg0.service wgmp-client.service
Wants=network-online.target wg-quick@wg0.service wgmp-client.service
[Service]
Type=simple
ExecStart=/usr/local/bin/bib-comms
Environment="MUMBLE_ADDRESS=172.16.13.2:64738"
Environment="MUMBLE_PASSWORD=<password>"
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
Reload and enable the service:
systemctl --user daemon-reload && \
systemctl --user enable --now bib-comms.service