MISC.: Preparing A Minimal Linux Distro (Odriod C4 Example)

# preparing your linux distro
# before following our tutorials and build your audiophile server

# all info below are applicable to Odroid and others boards
# beware official Odroid Linux Kernel version (v3.16.85) is outdated and do not contains the Native DSD patch
# you need version 4.19.64 or greater to play native DSD,
# however selecting DOP MPD audio output will works with limitation

# To build the MusicLounge Audiophile Server we recommended:
# Armbian Focal Linux Distro on Odroid C4,
# RaspiOS lite (Debian) buster for Raspberry PI 4,
# Debian Standard or Ubuntu server for amd64

# before building you audiophile server the software requirements are simple:
# pi user must be set
# ssh must be set
# alsa must be installed and should recognize your usb dac (command: aplay -l )

# get the img from armbian repository
# burn it on SDCARD (8GB is enough) with any tool like Win32DiskImager app on Windows
# connect your usb DAC to Odroid C4
# boot
# and start the ssh session
# default login/pass root/odroid or root/1234

# the root password needed to be changed immediately
# and a new user (non root) must be created (see below)

New root password: ************************
Repeat password: ************************

Choose default system command shell:

1) bash
2) zsh

Shell: BASH

Creating a new user account. Press  to abort

Please provide a username (eg. your forename): pi
Create password: ************************
Repeat password: ************************

Please provide your real name: Pi

Dear Pi, your account pi has been created and is sudo enabled.
Please use this account for your daily work from now on.

# sanity check

  1. $ sudo apt update -y
  2. $ sudo apt upgrade -y

# on armbian ssh is available by default

# on RaspiOS you need to add an empty file named ssh inside the sdcard before booting the OS

# on Ubuntu server amd64 SSH is activated during installation

# on Debian Standard amd64 you need to install openssh-server pkg

# on Debian netinstall you need to install sudo and pi to sudo group

  1. $ su - root
  2. $ apt install sudo
  3. $ usermod -aG sudo pi

# after the first boot add user pi to sudoers on Debian

  1. $ su - root
  2. $ nano /etc/sudoers

# find line root ALL=(ALL:ALL) ALL and add this line


# save
# CTRL+X then type y and enter
# go back to user

  1. exit

# install ssh server
# not needed on debian netinstall distro as you normally install SSH server during the installation process

  1. $ sudo apt install openssh-server -y

# active service

  1. $ sudo systemctl start ssh
  2. $ sudo systemctl enable ssh

# HEADLESS PC Server (boot without monitor on)
# BEWARE: if you install a distro supposed to work with GUI like Ubuntu/Debian
# and EVEN IF YOU DID NOT INSTALL A USER INTERFACE you may not be able to boot without a monitor!
# fortunately we can fix it by changed a few lines in grub bootloader to get our headless audio server

# edit grub conf

  1. $ sudo nano /etc/default/grub

# and modify the parameters of GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX to


# and obviously uncomment this line


# CTRL+X then type y and ENTER key

# now update grub

  1. $ sudo update-grub

that’s it!

# optional: if bash auto-completion (automatically completing of file names, commands and more) is not installed by default

  1. $ sudo apt-get install bash-completion

# audio check
# plug your usb DAC and type the cmd below to list soundcard, your dac must be in the list:

  1. $ aplay -l

# alsa should be already installed (not in ubuntu server no soundcard driver by default)
# if your dac is not visible, install ALSA:

  1. $ sudo apt-get install alsa-utils alsa-tools libasound2

# list devices to see if your DAC is recognized

  1. $ aplay -l
root@odroid:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ODROIDHDMI [ODROID-HDMI], device 0: I2S dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: D90 [D90], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

# your usb DAC should be visible in the list

# if still it’s not visible (no soundcard error)
# list installed alsa pkgs, remove them and reinstall alsa
# alsa-base pkg could be omited if not present in repository

  1. $ sudo dpkg -l alsa*
  2. $ sudo apt --purge remove alsa-base alsa-firmware-loaders alsa-oss alsa-source alsa-tools alsa-tools-gui alsa-topology-conf alsa-ucm-conf alsamixergui alsa-utils
  3. $ sudo apt-get install alsa-base alsa-utils alsa-tools libasound2
  4. $ sudo reboot

# check alsa status

  1. $ sudo systemctl status alsa-utils.service

# if alsa service is masked unmask it

  1. $ sudo rm /lib/systemd/system/alsa-utils.service
  1. $ sudo systemctl daemon-reload
  1. $ sudo systemctl enable alsa-utils
  2. $ sudo systemctl start alsa-utils

# check the status again everything should be okay

  1. $ sudo systemctl status alsa-utils.service

# on a minimal linux distro with only root you need to create a new user ‘pi’ (or other name) which going to be used to build your MusicLounge audiophile server
# if you’re already login as pi user skip the creation below and go to adding groups directly

# create a user pi:

  1. $ adduser pi
root@odroid:~# adduser pi
Adding user `pi' ...
Adding new group `pi' (1000) ...
Adding new user `pi' (1000) with group `pi' ...
Creating home directory `/home/pi' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for pi
Enter the new value, or press ENTER for the default
        Full Name []: PI
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y

# add new user to all default groups

  1. $ sudo usermod -aG adm,dialout,cdrom,sudo,audio,www-data,video,plugdev,games,users,input,netdev pi
  1. $ groups pi

# reboot, login pi (skip this step if you are already logged in as pi user)

  1. $ sudo reboot
login as: pi
pi@'s password:
  ___      _           _     _    ____ _  _
 / _ \  __| |_ __ ___ (_) __| |  / ___| || |
| | | |/ _` | '__/ _ \| |/ _` | | |   | || |_
| |_| | (_| | | | (_) | | (_| | | |___|__   _|
 \___/ \__,_|_|  \___/|_|\__,_|  \____|  |_|

Welcome to Armbian 21.05.2 Focal with Linux 5.10.34-meson64

System load:   45%              Up time:       0 min
Memory usage:  4% of 3.73G      IP:  
CPU temp:      42°C             Usage of /:    10% of 14G
RX today:      31.0 MiB

[ 0 security updates available, 4 updates total: apt upgrade ]

To run a command as administrator (user "root"), use "sudo ".
See "man sudo_root" for details.


# your linux distro is now ready

# click the link below to follow our tutorials and build the MusicLounge Audiophile Server


MISC: Tips & Tricks



# Raspberry PI model / revision / serial

  1. $ cat /proc/device-tree/model
  1. $ cat /proc/cpuinfo

# SN#:

  1. $ cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2

# 10000000XXXXXXXX

  1. $ cat /proc/asound/version
  1. $ dpkg -l alsa*

# Kernel version

  1. $ uname -a

# fedora update kernel/system

  1. $ dnf -y update && dnf -y upgrade

# For example, to add the user linuxize to the sudo group you would run the following command:

  1. $ sudo usermod -a -G sudo linuxize

# Configure to boot into Raspbian Desktop

  1. $ sudo raspi-config

# use your arrow keys to navigate to Enable Boot to Desktop and press enter. Select the Desktop login option and press enter.

# Configure to boot into Raspbian Desktop (without raspi-config)

  1. $ sudo update-rc.d lightdm disable

# Raspberry testing repository

# replace buster by testing in /etc/apt/sources.list

  1. $ sudo nano /etc/apt/sources.list

# # from
# deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# # to
# deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi

  1. $ sudo apt update

# check if process is locked

  1. $ ps aux | grep -i apt

# kill process (replace pid_id by the process ID number)

  1. $ sudo kill pid_id

# check if killed

  1. $ sudo kill -9 pid_id

# Disable DEBIAN 10 GUI:

  1. $ sudo systemctl set-default multi-user.target
  1. $ sudo reboot

To re-enable the GUI:

  1. $ sudo systemctl set-default graphical.target
  1. $ sudo reboot

# activate raspberry pi WIFI

  1. $ sudo raspi-config

# Select “Localisation Options” then select “change WLAN country”

# then enter root

  1. $ sudo su

# generate wpa_passphrase using your SSID and followed by typing the wifi password
# replace YOUR-SSID by the exact name of your wifi network name

  1. $ wpa_passphrase "YOUR-SSID" >> /etc/wpa_supplicant/wpa_supplicant.conf

# check if the configuration is okay

  1. $ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

# should contain something like this:
# the country= must contains a 2 letters ISO 3166-1 of your country code

  1. ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
  2. update_config=1
  3. country=GB
  4. # reading passphrase from stdin
  5. network={
  6. ssid="YOUR-SSID"
  7. psk=47abc8153891372573fc831a0bab0346b07cb900ada28dc52686359cc60ab9e7
  8. }

# network IP info

  1. $ ifconfig

# scan wifi network

  1. $ sudo iwlist wlan0 scan

# power OFF / ON HDMI raspberry pi

# hdmi OFF

  1. $ sudo /opt/vc/bin/tvservice -o

# hdmi ON

  1. $ sudo /opt/vc/bin/tvservice -p

# AMD64 Useful Cmds

# get hostname

  1. $ hostnamectl

# set hostname

  1. $ sudo hostnamectl set-hostname musiclounge
  1. $ sudo nano /etc/hosts localhost musiclounge

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

  1. $ sudo reboot

# Check your current Ethernet connection speed

# install ethtool utility

  1. $ sudo apt-get install ethtool

# determine the name of your ethernet interface usually eth0 or enp3s0

  1. $ ip a

# get the speed

  1. $ sudo ethtool eth0 | grep -i speed

# get current playback info useful to check if current playback is DSD native (DSD_U32_BE)

  1. $ cat /proc/asound/card*/pcm*p/sub*/hw_params

# in case you have to entry commands from the server console and not from remote PC/SSH session
# you may want to change the keyboard layout
# use the followinf cmd on debian

  1. sudo dpkg-reconfigure keyboard-configuration


# TS7

# Static IP not working
# assign IP to eth0 interface

# configure a static IP address by adding the following to /etc/dhcpcd.conf:

  1. $  ip link show


  1. 1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
  2. 2: eth0:  mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
  3. 3: wlan0:  mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000

# eth0 is your default interface (Ethernet connection), do not use wifi for your audio server


  1. 1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
  2. 2: enp3s0:  mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
  3. 3: wlp2s0:  mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000

# enp3s0 is your default interface (Ethernet connection), do not use wifi for your audio server

# type:

  1. $ sudo nano /etc/network/interface

# add those lines at end:

  1. auto lo eth0
  2. iface lo inet loopback
  4. iface eth0 inet static
  5.     address 192.168.x.x
  6.     netmask
  7.     network 192.168.x.x
  8.     gateway 192.168.x.x

# CTRL+O to save
# CTRL+X to exit

  1. $ sudo nano /etc/resolv.conf

# add one or 2 lines (change IP to your DNS address or your router)

  1. nameserver 192.168.x.x
  2. nameserver x.x.x.x

# CTRL+O to save
# CTRL+X to exit

  1. $ sudo reboot

# stop dhcpcd service when the static ip is valid and reachable only

  1. $ sudo systemctl stop dhcpcd

# restart network

  1. $ sudo systemctl restart networking

# get the status (you may lose your ssh session see below)

  1. $ sudo systemctl status networking

# if everything okay reboot your system

  1. $ sudo reboot

# or type this cmd below with interface name (eth0 or enp3s0 ) and reboot manually

  1. $ sudo ifdown enp3s0

# here you’re loosing your SSH session obviously
# see troubbleshooting if static IP not working
# reboot system


# TS6

# if MPD doesn’t start type this to get its status

  1. $ sudo systemctl status mpd

# if the error is related to /libavcodec.so.58: undefined symbol: bcm_host_is_fkms_active
# reinstall libraspberrypi0 pkg

  1. $ sudo apt install --reinstall libraspberrypi0
  1. $ sudo reboot

# NANO return this error (on Armbian / Debian):

Unable to create directory /root/.local/share/nano/: No such file or directory It is required for saving/loading search history or cursor positions.

# check if nano cmd is available using:

  1. sudo /bin/nano .bashrc

# if nano opens the file then you simply need to create the /root/.local/share/nano/ directories
# you can confirm the issue by using:

  1. sudo ls -l /root/.local/


# All information below is for Raspberry PI platform only, does not apply to other devices

# go to

# get the sha1 of the kernel
# for example: 4.19.118-v7 e1050e94821a70b2e4c72b318d6c6c968552e9a2

# then to install this old kernel 4.19.118-v7+ enter:

  1. $ sudo rpi-install e1050e94821a70b2e4c72b318d6c6c968552e9a2
  1. $ sudo reboot

# install pkg ends with error:
# “Failed to start The PHP 7.3 FastCGI Process Manager”
# type the cmd below to create the missing directory:

  1. $ sudo mkdir /var/run/php


# It’s strongly recommended to create your audio server on Raspberry PI 4 2Go
# The raspberry pi 3 share the same controller with USB and Ethernet which is not good for an audiophile server
# do not expect to use native DSD with RPI 3 using an usb dac…

# ALL INFORMATION BELOW ARE FOR RPI 3B + ONLY, does not apply to other devices

# Apply patch one by one in this order, reboot and check before

# TS1

# APPLY IF NEEDED ONLY (sound drop/loss)

# Ethernet drops Fix (Recommended for Raspberry PI 3B+ only do not apply to RPI 4)
# identify the name of your Ethernet connection (usually eth0 or enp3s0)

  1. $ ip a

# edit rc.local to run a cmd at startup

  1. $ sudo nano /etc/rc.local

# enter this cmd below to optimize your ethernet connection
# see the Tips & Tricks section to install ethtool (sudo apt-get install ethtool) if needed
# add this line at end of rc.local

  1. $ sudo ethtool -s eth0 speed 100 duplex full

# CTRL+O to save
# CTRL+X to exit

  1. $ sudo reboot

# TS2


# optimize perf for Raspberry PI 3B+ – cpu gouvernor (not recommended for PI4)

# check cpu governor

  1. $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# set to “performance” at startup

  1. $ sudo mv /etc/init.d/raspi-config /etc/init.d/raspi-config.bak
  1. $ sudo nano /etc/init.d/raspi-config

# copy/paste this script

# Provides: raspi-config
# Required-Start: udev mountkernfs $remote_fs
# Required-Stop:
# Default-Start: S 2 3 4 5
# Default-Stop:
# Short-Description: Switch to performance/ondemand cpu governor based on shift key pressed.
# Description:
# . /lib/lsb/init-functions
case "$1" in
log_daemon_msg "Checking if shift key is held down..."
if [ -x /usr/sbin/thd ] && timeout 1 thd --dump /dev/input/event* | grep -q "LEFTSHIFT\|RIGHTSHIFT"; then
printf "Yes. Switching to ondemand scaling governor."
if [ -e $SYS_CPUFREQ_GOVERNOR ]; then
echo "ondemand" > $SYS_CPUFREQ_GOVERNOR
echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 100000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
log_end_msg 0
printf "No. Switching to performance scaling governor."
if [ -e $SYS_CPUFREQ_GOVERNOR ]; then
echo "performance" > $SYS_CPUFREQ_GOVERNOR
log_end_msg 0
echo "Usage: $0 start" >&2
exit 3

# CTRL+O to save
# CTRL+X to exit

# set permission to exec

  1. $ sudo chmod 755 /etc/init.d/raspi-config
  1. $ sudo reboot

# type to check:

  1. $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

# result must be:

# performance

# TS3


# USB dropped frames Fix (not recommended for PI 4)

  1. $ sudo nano /etc/rc.local

# # USB fix

  1. $ sudo sed -i "s/console=serial0,115200/net.ifnames=0 dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0xF dwc_otg.nak_holdoff=1 console=serial0,115200/" /boot/cmdline.txt

# # revert value

  1. $ sudo sed -i "s/net.ifnames=0 dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0xF dwc_otg.nak_holdoff=1 //" /boot/cmdline.txt

# CTRL+O to save
# CTRL+X to exit

  1. $ sudo reboot

MusicLounge: Introduction



# A minimum knowledge in shell/bash (typing commands on a terminal using a SSH session with putty for example) is required.
# Internet is your friend! the scope of this project is not to teach linux or how to create a bootable SDCARD from an image file or how to use a SSH session to manage your server wiressly or how to type a command in a shell. 😉
# Simply read carefully instructions and double-check them before applying and everything will be fine.

# the MusicLounge Audiophile Server is reliable and daily used since a while now (more than a decade) and works flawlessly.

# the storage must be already done (see previous post if not ready)

# insert the SD card or USB stick inside the device (Raspberry PI 4, NUC, Ordroid C4, …)

# connect the device to your LAN network using the Ethernet cable (NOT WIFI)

# connect your USB cable from your USB DAC to the device
# (Connecting the usb dac to a powered usb hub maybe required)

# connect your power supply (3A minimum for rPI4 – linear regulated if possible)

# Boot your device!

Click the button NEXT below to continue…




Linux Kernel v4.19.64 or greater is needed to play native DSD, check the kernel version of your Linux distro before building our audiophile server.

# for Odroid C4 take the Armbian distro preferably as the Official Hardkernel Ubuntu distro is outdated. Beware take the focal server version not xfce

Download Raspberry Pi OS Lite (Debian 10 Buster 32Bit)
Minimal image based on Debian Buster 10 OS for Raspberry
version 2021-03-04 or greater is recommended

Download Ubuntu 20.04.2 (Focal) live server for amd64 which have a 5.4 kernel version
or Debian 10 Buster Netinst or Standard for amd64 with kernel version 4.19+
Minimal image amd64 (64 Bit) based for INTEL and AMD PC (NUC, PC, BRIX,…)

Download Armbian Focal or Buster (Debian Buster 64Bit based) Lite for arm64
Minimal image based on Debian Buster 10 OS for a lot of boards using ARM
# armbian buster headless

# Our MusicLounge Audiophile server distribution is provided for your convenience. The MusicLounge Audio Server is strictly based on the following distributions on which we have applied all the instructions provided on our website in order to make your job easier, however we strongly suggest to read our tutorials to get a full control on your audio system and customize your installation.

# Edition 2021

# for the Odroid C4
Sour code: https://github.com/armbian

# for the Raspberry PI 4
# Source code: https://github.com/raspberrypi

# for any barebone PC (Intel NUC, Brix, …)
# Source code: http://cdimage.ubuntu.com/releases/20.04/release/source/

# use “Win32 Disk Image” on Windows to create the SDCARD (8GB)

# use rufus for creating a bootable usb stick with amd64 linux (Intel PC/NUC, Brix,…)

# Notepad++ powerful text editor

# on barebone PC with internal SSD use HDD Raw Copy 1.10+ Portable from HDGuru.com to clone the img to the SSD

Before going further, the info below is required:
– your gateway / router (internet box) / DNS IP address are required (192.168.x.x)
– if you’re not planning to store musics locally, the ip of your NAS or server PC with the sharing directory containing the music files is required (192.168.x.x)


# RPI4 only: add a empty file named “ssh” without extension (an empty file created with Notepad++ for example) to activate SSH at startup

# RPI4 only: edit cmdline.txt with notepad++ for example and add net.ifnames=0 at the beginning

# Quick Overview:

# create the SDCard with raspiOS or debian lite or armbian or Odroid Ubuntu minimal distro (see the link above)

# DO NOT INSTALL Any Graphics Desktop Environments (GUI), we are building a HEADLESS server…

# insert the SD card inside the device

# connect device to your LAN network using the Ethernet cable

# connect your USB cable from your USB DAC to the device
(for raspberry pi 3b+ connect the usb dac to a powered usb hub and usb hub to the raspberry pi)

# connect your power supply (3A minimum for rPI 4, linear regulated power supply is better)

# Boot your device, start an ssh session from a remote PC and follow our tutorials to install and setup your audiophile server.

Click the button NEXT below to continue…




  • internet connection (for grabbing/installing packages/updates)
  • a working LAN network with a router/internet-box (gateway)
  • a shared directory on your LAN network with your music files, could be a PC with a shared folder or a NAS with SMB server activated (Windows/Mac file sharing server)
  • PC desktop/Laptop connected to the LAN (all commands are sent to the Raspberry PI from this PC using ssh)
  • a Raspberry PI 4 or Odroid C4 or Intel NUC or Others
    The Raspberry PI 3B+ IS NOT RECOMMENDED, add an external powered USB 2.0 hub if you still want to build it with RPI3). For more info read the Raspberry PI benchmark of USB and Ethernet available here: https://magpi.raspberrypi.org/articles/raspberry-pi-4-specs-benchmarks

    The device must be connected to the LAN with Ethernet cable.
    IMPORTANT: WiFi and Bluetooth are NOT recommended and NOT supported in this server installation, a server must be hard wired to your router with an Ethernet cable
  • USB DAC connected to USB to the device (to the powered usb hub with rPI 3b+)
  • SDCARD, mini SSD or usb stick (8GB is enough)


  • MPD music player software to control your audio server and browse your music library,
    MALP is recommended for Android, MaximumMPD can be used on iOS (untested)
  • putty.exe is required on Windows, terminal on others for the SSH session
  • tool for building SD CARD or USB bootable stick (Win32DiskImager or Rufus on Windows for example)

Optional Features

  • remote control management (including play/stop/go next/prev/random/load default playlist… )
  • real time EQ (ALSAEQ plugin)
  • DLNA (Upnp) Media server music player/server ( control audio from Upnp music player or listen music from upnp media server)
  • Spotify account (listen music from Spotify Connect)
  • Airplay device (listen music from Apple devices)
  • Squeezelite player (squeezelitebox for using with LMS player)
  • Roon system

Click the button NEXT below to continue…



instructions bellow are under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)

Read the terms & conditions of uses here (English):

Neither the author nor any of its providers of information shall have any liability for the accuracy of the information contained in the Service, or for delays or omissions therein. None of the foregoing parties shall be liable for any third-party claims or losses of any nature, including, but not limited to, lost profits, punitive or consequential damages.
The information provided within these pages is not guaranteed to be accurate, nor does the management take responsibility for it. The information comes from other sources and therefore may be wholly unreliable, and the management does not guarantee its suitability for any purpose.
Although the information contained herein may be completely useless, all rights are retained by their respective owners, including, but not limited to, the right of reproduction, the right of distribution, and the right of passage.
the author specifically disclaims any implied warranties or merchantability or fitness for any particular purpose and shall in no event be liable for any loss of profit or any other commercial damage, including but not limited to special, incidental, consequential, or other damages, even if advised of the possibility of such damages.

These instruction are subject to change without notice

by using these instructions below you fully understand and agree with the terms and conditions.

Click the button NEXT below to continue…