MusicLounge: Upgrade Server To Editon 2023

Upgrade MusicLounge Server Editon 2021 To Editon 2023

# Important Notice: The image disk of the 2023 edition for Raspberry PI 4, Odroid C4 and amd64 platform are available for download HERE.
#
# follow the instructions below to upgrade your edition 2021 of MusicLounge. The audiophile server must be already installed and operational.
#
# be sure your data partition is resized
# Odroid C4 with Armbian

  1. $ sudo systemctl enable armbian-resize-filesystem
  2. $ sudo reboot

# Raspberry PI 4 with RaspPI OS, simply run raspi-config and select Advanced Options > Expand Filesystem and reboot

  1. $ sudo raspi-config

# expanding your partition during the boot can take a while (depending the size of your SD Card) so be patient,

# at first boot you should see

Usage of /: 71% of 3.7G

# after expansion on 16GB SD Card

Usage of /: 19% of 14G

# for debian amd64 expand your hard drive if needed using gparted on live distro or from desktop PC is easy
# first move the swap sda2 to end and then resize sda1
# click this link to read the tutorial to expand your disk with GParted


# First, ensure your system is up-to-date in it’s current release.
# update unpncli signature
# go to https://www.lesbonscomptes.com/pages/signatures.html
# download lesbonscomptes.gpg and copy to /usr/share/keyrings/

  1. $ cd ~/Downloads/
  2. $ sudo cp lesbonscomptes.gpg /usr/share/keyrings/

# update buster (ed. 2021) pkgs, the distro must be up to date

  1. $ sudo apt update

# now upgrade pkgs, during installation
# keep local smb.conf
# choose the internal hard drive /dev/sda to install grub if needed (and NOT /dev/sda1)
# otherwise select [default=N] reply

  1. $ sudo apt upgrade

# make a full upgrade to be sure

  1. $ sudo apt full-upgrade

# run update again and you should read
# All packages are up to date.

  1. $ sudo apt update

# now update sources list

  1. $ sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list
  2. $ sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*.list

# update to bullseye sources.list with the entries below

  1. $ sudo nano /etc/apt/sources.list
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free
deb http://security.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://security.debian.org/debian-security/ bullseye-security main contrib non-free

# check and update upnpcli source list

  1. $ sudo nano /etc/apt/sources.list.d/*
deb [signed-by=/usr/share/keyrings/lesbonscomptes.gpg] http://www.lesbonscomptes.com/upmpdcli/downloads/debian/ bullseye main
deb-src [signed-by=/usr/share/keyrings/lesbonscomptes.gpg] http://www.lesbonscomptes.com/upmpdcli/downloads/debian/ bullseye main
  1. $ sudo apt clean
  2. $ sudo apt update

# IMPORTANT: on any error fix your sources list before going further

# say YES for restarting services automatically
# for all request (i.e. update conf files) during the upgrade say no
[default=N]

  1. $ sudo apt upgrade

# may require to remove gcc 8 base if the command failed during upgrade because of libc6-dev

  1. $ sudo apt-get remove libgcc-8-dev

# for all request during the upgrade say ‘n’
[default=N] # and obviously keep smb.conf
# make a full upgrade

  1. $ sudo apt full-upgrade

# run update again and you should read
# All packages are up to date.
# otherwise run $ sudo apt full-upgrade AGAIN

  1. $ sudo apt update

# cleanup pkgs

  1. $ sudo apt autoremove -y

# reboot

  1. $ sudo shutdown -r now

# MPD Upgrade
# check the latest release version available on offical website musicpd.org
# for example to download and extract release 0.23.12 in mpd-0.23.12/

  1. $ cd ~/Downloads/
  2. $ sudo wget https://www.musicpd.org/download/mpd/0.23/mpd-0.23.12.tar.xz
  3. $ sudo tar xf mpd-0.23.12.tar.xz

# or get the very latest (unstable dev release) by cloning the MPD git to MPD/

  1. $ sudo git clone https://github.com/MusicPlayerDaemon/MPD.git

# notice: libboost-dev dependency is no longer needed
# read the mpd tutorial to compile and install the latest version of MPD (version 0.23.12 or greater)

# after compilation and installation enable and start the service

  1. $ sudo systemctl enable mpd
  2. $ sudo systemctl start mpd
  3. $ sudo reboot

# check mpd

  1. $ sudo systemctl status mpd

#
# TROUBLESHOUTING
# in case of error (generally occurs within 5s just after playing) :

alsa_output: Decoder is too slow; playing silence to avoid xrun

# adding the following lines to all your audio output in mpd configuration (/etc/mpd.conf) may help
#

buffer_time "200000"
period_time "5084"

#
# edit mpd.conf and scroll to audio output area to add the 2 lines

  1. $ sudo nano /etc/mpd.conf
.
.
.
audio_output {
type "alsa"
name "Default"
device "hw:1,0"
mixer_type "none"
dop "no"
buffer_time "200000"
period_time "5084"
}

audio_output {
type "alsa"
name "ALSA DAC DOP"
device "hw:1,0"
mixer_type "none"
dop "yes"
buffer_time "200000"
period_time "5084"
}
.
.
.

#
# in case of non fatal binding error

server_socket: bind to '0.0.0.0:8000' failed (continuing anyway, because binding to '[::]:8000' succeeded): Failed to bind socket: Address already in use

# a binding already exists due to ipv6, however mpd is running correctly. if you do not need ipv6 support follow these instructions to disable it by using sysctl command and by adding the kernel option ipv6.disable=1 https://www.wikihow.com/Disable-Ipv6-on-Linux
# edit your nginx.conf to remove ipv6 listening by
# commenting listen [::]:80 default_server; on server block

  1. $ sudo nano /etc/nginx/sites-available/default
server {
        listen 80 default_server;
#       listen [::]:80 default_server;

# myMPD Upgrade

  1. $ cd Downloads/

# rename current directory if exists

  1. $ mv myMPD/ myMPD-10.1.7/

# read the myMPD tutorial on website
# to compile and install the latest version of myMPD (version 10.2.0 or greater)
# after compilation and installation generate the config files

  1. $ sudo systemd-run -t -p DynamicUser=yes -p StateDirectory=mympd -p CacheDirectory=mympd /usr/bin/mympd -c

# change port to 8080

  1. $ sudo nano /var/lib/mympd/config/http_port

# deactivate SSL (false)

  1. $ sudo nano /var/lib/mympd/config/ssl

# enable and start service

  1. $ sudo systemctl enable mympd
  2. $ sudo systemctl start mympd
  3. $ sudo reboot

# check

  1. $ sudo systemctl status mympd

# Raspotify Upgrade
# Install latest version of Raspotify on armhf
# before installing purge old version of raspotify

  1. $ sudo apt purge raspotify

# attention on amd64 you need to remove the Raspotify docker image

  1. $ sudo docker stop spot
  2. $ sudo docker rm spot

# list images

  1. $ sudo docker images

# get IMAGE ID and remove it

  1. $ sudo docker rmi IMAGE_ID

# if docker is no longer used you can remove it as well
# for more info see the tutorial on page:
# MusicLounge: Spotify Connect (On amd64 Distro Using Docker)
# docker image is now removed
# to install Raspotify type the following command:

$ sudo apt-get -y install curl && curl -sL https://dtcooper.github.io/raspotify/install.sh | sh

# Edit Raspotify configuration:

  1. $ sudo nano /etc/raspotify/conf

# and change these options only

LIBRESPOT_DEVICE_NAME="MusicLounge"
LIBRESPOT_BITRATE="160"
LIBRESPOT_DEVICE="plughw:1,0"

# CTRL+O to save
# CTRL+X to exit
# now enable and start the service

  1. $ sudo systemctl daemon-reload
  2. $ sudo systemctl enable raspotify
  3. $ sudo systemctl start raspotify
  4. $ sudo reboot

# check the status

  1. $ sudo systemctl status raspotify

#
# TROUBLESHOOTING
#
# in case of warning related to libmdns

WARN  libmdns::fsm] dropping truncated packet from 192.168.x.x:5353

# this error is probably due to a bad implementation of mDNS in your router,
# you may update your router firmware or disable zeroconf (librespot discovery) and
# add your credentials to the Raspotify config
# edit conf and enable credential cache, disable discovery
# add your Spotify username and password

  1. $ sudo nano /etc/raspotify/conf
#LIBRESPOT_DISABLE_CREDENTIAL_CACHE=
...
# Disable zeroconf discovery mode.
LIBRESPOT_DISABLE_DISCOVERY=
...
LIBRESPOT_USERNAME="...."
LIBRESPOT_PASSWORD="...."

# NGINX
# check nginx service

  1. $ sudo systemctl status nginx

# in case of error

nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument

# make the following changes:

  1. $ sudo mkdir /etc/systemd/system/nginx.service.d
  2. $ sudo nano /etc/systemd/system/nginx.service.d/override.conf

# enter these lines

[Service]
ExecStartPost=/bin/sleep 0.1

# CTRL + X and Y to SAVE

  1. $ sudo systemctl daemon-reload
  2. $ sudo reboot

# open the ssh session and check the status

  1. $ sudo systemctl status nginx

# check the status of minidlna service

  1. $ sudo systemctl status minidlna

# in case of error related to autofs

/lib/systemd/system/minidlna.service:4: Failed to add dependency on autofs, ignoring: Invalid argument

# edit service to apply this fix

  1. $ sudo nano /lib/systemd/system/minidlna.service

# and replace autofs by autofs.service
# CTRL + X and Y to SAVE

  1. $ sudo systemctl daemon-reload
  2. $ sudo reboot

# check your fstab entry and journalctl (sudo journalctl -f )
# in case of error type:

CIFS VFS: Server 192.168.x.x has not responded in xxx seconds. Reconnecting...

# read carefully the SAMBA tutorial chapter “CIFS Mounts Disconnecting Issue – Read More…” (end of the page)
# otherwise disable the cron job (comment line)

  1. $ sudo nano /etc/cron.d/smb_v1_fix
#*/10 *   *   *   *   root    /home/pi/scripts/smb_v1_fix.sh >/dev/null 2>&1

# in case of dhcpcd error type

dhcpcd.service: Failed to locate executable /usr/lib/dhcpcd5/dhcpcd: No such file or directory

# check if you have an error in the status of the service

  1. $ sudo systemctl status dhcpcd
Failed to start DHCP Client Daemon.

# edit the service
# to change ExecStart command to /usr/sbin/dhcpcd -q -w

  1. $ sudo nano /etc/systemd/system/dhcpcd.service.d/wait.conf
[Service]
ExecStart=
ExecStart=/usr/sbin/dhcpcd -q -w

# restart service and check again the status

  1. $ sudo systemctl daemon-reload
  2. $ sudo systemctl restart dhcpcd
  3. $ sudo systemctl status dhcpcd

# check the status of all other services ( airplay, roon, etc.) should be okay

# Congrats!
# Your MusicLounge audiophile server is fully updated to edition 2023
# now update the music library (database)
# use DroidMyMPD or MALP Android client
# or open your browser with http://musiclounge:8080 (or IP address)
# Enjoy!

I2S DAC Support

MusicLounge do not support I2S audio dac by default but it’s really easy to add the support of such cards.

Example 1 with Hifiberry DAC Plus RCA and Hiffiberry DAC+ PRO on Raspberry PI 4

Example 2 with Hifi Shield 2 (RCA) on Odriod C4

1- HIFIBERRY DAC And Raspberry PI 4

Make sure the board is correctly connected to the PI 4 and to the power supply (5V 3A)

# edit config.txt

pi@musiclounge:~ $ sudo nano /boot/config.txt

# add at end

dtoverlay=hifiberry-dacplus

CTRL+X to SAVE

List of Hifiberry device tree overlay:

DAC+ Standard/Pro/Amp2

dtoverlay=hifiberry-dacplus

DAC2 HD

dtoverlay=hifiberry-dacplushd

DAC+ ADC

dtoverlay=hifiberry-dacplusadc

DAC+ ADC Pro

dtoverlay=hifiberry-dacplusadcpro

Digi+

dtoverlay=hifiberry-digi

Digi+ Pro

dtoverlay=hifiberry-digi-pro

Reboot and That’s It!

Now check if card number is 1 using aplay -l

pi@musiclounge:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0 [HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

The trick here is to keep dtparam=audio=on (native headphone) to shift Hifiberry DAC to card number 1 to be dirrectly compatible with MusicLounge audio server settings.

if card number is different go HERE to reconfigure MPD and other audio services

and if you use the alsa equalizer plugin do not forget to change the plughw id in .asoundrc, see the tutorial here

here is a basic setup of the mpd output audio for hifiberry dac

audio_output {
type "alsa"
name "Hifiberry"
device "hw:1,0"
mixer_type "hardware"
mixer_control "Digital"
mixer_device "hw:1"
mixer_index "0"
dop "yes"
}

2- HIFI SHIELD 2 AND ODROID C4

Make sure the board is correctly connected to the C4 and to the power supply ( more info available HERE ).

# Edit /media/boot/config.ini to edit the DTBO settings. Open that file and find the part shown below. The below settings different from the default, it adds a new section named overlay_hifishield (C2) or overlay_hifishield2 (C4) and uses that section by the overlay_profile variable.

@musiclounge:~ $ sudo nano /media/boot/config.ini

For C4 Only:

; Device Tree Overlay
overlay_resize=16384
overlay_profile=hifishield2
overlays="spi0 i2c0 i2c1 uart0"
 
[overlay_custom]
overlays="i2c0 i2c1"
 
[overlay_hktft32]
overlays="hktft32"
 
[overlay_hktft35]
overlays="hktft35"
 
[overlay_hifishield2]
overlays="hifishield2"

For C2 only:

; Device Tree Overlay
overlay_resize=16384
overlay_profile=hifishield
overlays="spi0 i2c0 i2c1 uart0"
 
[overlay_custom]
overlays="i2c0 i2c1"
 
[overlay_hktft32]
overlays="hktft32"
 
[overlay_hktft35]
overlays="hktft35"
 
[overlay_hifishield]
overlays="hifishield"

Reboot and That’s It!

Now check if card number is 1 using aplay -l

pi@musiclounge:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ODROIDHDMI [ODROID-HDMI], device 0: SPDIF-dit-hifi dit-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: ODROIDHIFI [ODROID-HIFI], device 0: TDM-B-pcm5102a-hifi multicodec-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

if card number is different go HERE to reconfigure MPD and other audio services


List of other Raspberry PI device tree overlay (untested):

502-dac
dtoverlay= hifiberry-dacplus
502-dac-pro
dtoverlay= hifiberry-dacplus
503hta-hybrid
dtoverlay= hifiberry-dac
adafruit-max98357
dtoverlay= hifiberry-dac
adafruit-uda1334a
dtoverlay= hifiberry-dac,i2s-mmap
allo-boss-dac
dtoverlay= allo-boss-dac-pcm512x-audio
allo-digione
dtoverlay= allo-digione
allo-katana-dac
dtoverlay= allo-katana-dac-audio
applepi-dac
dtoverlay= applepi-dac
audio-injector-isolated
dtoverlay= audioinjector-isolated-soundcard
audio-injector-ultra
dtoverlay= audioinjector-ultra
audiophonics-es9028q2m-dac
dtoverlay= i-sabre-q2m
bassfly
dtoverlay= hifiberry-dac
bassfly-mic
dtoverlay= googlevoicehat-soundcard
bassowl
dtoverlay= bassowl
es90x8q2m-dac
dtoverlay= es90x8q2m-dac
fe-pi-audio
dtoverlay= fe-pi-audio
generic-dac
dtoverlay= hifiberry-dac
hifibox-dac
dtoverlay= hifiberry-dacplus
iqaudio-amp
dtoverlay= iqaudio-dacplus,unmute_amp
iqaudio-dacplus
dtoverlay= iqaudio-dacplus,unmute_amp
iqaudio-digiplus
dtoverlay= iqaudio-digi-wm8804-audio
justboom-amp
dtoverlay= justboom-dac
justboom-dac
dtoverlay= justboom-dac
justboom-digi
dtoverlay= justboom-digi
mamboberry-dac
dtoverlay= hifiberry-dac
merus-amp
dtoverlay= merus-amp
nanosound-dac
dtoverlay= hifiberry-dacplus
osa-dacberry-one-plus
dtoverlay= hifiberry-dacplus
osa-dacberry-pro
dtoverlay= iqaudio-dacplus
phat-beat
dtoverlay= hifiberry-dac
phat-dac
dtoverlay= hifiberry-dac
piano-dac
dtoverlay= allo-piano-dac-pcm512x-audio
piano-dac-plus
dtoverlay= allo-piano-dac-plus-pcm512x-audio
picade-hat
dtoverlay= hifiberry-dac
pisound
dtoverlay= pisound
raspiaudio
dtoverlay= googlevoicehat-soundcard
raspidacv3
dtoverlay= raspidac3
rpi-dac
dtoverlay= rpi-dac
soekris-dac
dtoverlay= hifiberry-dac
speaker-phat
dtoverlay= hifiberry-dac
st400-dac-amp
dtoverlay= iqaudio-dacplus
taudac
dtoverlay= taudac
terraberry-dac2
dtoverlay= i-sabre-q2m

MISC: Tips & Tricks


# RANDOM LINUX TIPS & TRICKS


# Get INFO/VERSION

# 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

127.0.0.1 localhost
127.0.1.1 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

TROUBLESHOOTING: Static IP


# 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

# ON RASPBERRY PI

  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

# ON AMD64 PC

  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/interfaces

# add those lines at end:

  1. auto lo eth0
  2. iface lo inet loopback
  3.  
  4. iface eth0 inet static
  5.     address 192.168.x.x
  6.     netmask 255.255.255.0
  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

# OPTIONAL AND NOT RECOMMENDED
# 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
# and start the NEW SSH SESSION WITH YOUR NEW STATIC IP! đŸ˜‰

TROUBLESHOOTING: GENERAL


# 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/

# UPGRADE or DOWNGRADE YOUR KERNEL


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


# go to
https://github.com/Hexxeh/rpi-firmware/commits/master

# 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

TIDAL Connect Installation

# OPTIONAL: install Tidal Connect For Raspberry PI 4 only,

# for amd64 and odroid platform use an upnp client with Tidal plugin (see upnp renderer tutorial for more info)

# using your DAC to listen music from Tidal

Tidal Connect is a service similar to Spotify Connect. Using the Tidal app to play a song you can easily click the device selector icon (top right) to select the Musiclounge Streamer audio server.

We are going to install it on MusicLounge Audio Server for Raspberry PI 4 as Tidal connect linux binary seems to be only available on arm 32bit (Raspberry PI). This installation is based on https://github.com/shawa github repo.


# if 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

# add stretch repo to sources list
# we need to temporary add it to install old libavformat.so.57

# add line:

deb http://archive.raspbian.org/raspbian stretch main
  1. $ sudo nano /etc/apt/sources.list

CTRL+X and y to save

# update pkgs list

  1. $ sudo apt update

# install dependencies

  1. $ sudo apt install -y libavformat57 libportaudio2* libflac++6v5*

# edit again /etc/apt/sources.list to disable (place # to comment) debian stretch repo after the installation of the libs

  1. $ sudo nano /etc/apt/sources.list
#deb http://archive.raspbian.org/raspbian stretch main

# CTRL+X and Y to Save


# install other dependencies

  1. $ sudo curl -k -O -L http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u12_armhf.deb
  1. $ sudo apt install -y ./libssl1.0.0_1.0.1t-1+deb8u12_armhf.deb
  1. $ sudo curl -k -O -L http://security.debian.org/debian-security/pool/updates/main/c/curl/libcurl3_7.38.0-4+deb8u16_armhf.deb
  1. $ sudo apt install -y ./libcurl3_7.38.0-4+deb8u16_armhf.deb

# create working folder

  1. $ sudo mkdir /usr/ifi

# enter directory

  1. $ cd /usr/ifi

# clone git repo inside the directory

  1. $ sudo git clone https://github.com/shawaj/ifi-tidal-release

# fix file permissions

  1. $ sudo chmod +x /usr/ifi/ifi-tidal-release/play
  1. $ sudo chmod +x /usr/ifi/ifi-tidal-release/bin/tidal_connect_application
  1. $ sudo chmod +x /usr/ifi/ifi-tidal-release/pa_devs/run.sh

# deploy tidal service

  1. $ sudo ./ifi-tidal-release/file-deploy.sh

# get your device name

  1. $ aplay -l

# in this example the USB DAC detected is a Topping D90 MQA on card 1

card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
 ...
card 1: MQA [D90 MQA], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

# edit the tidal connect service to update your device name

# change parameter -f and –model-name with Musiclounge Streamer
# if your DAC supports MQA set parameter –codec-mqa and –enable-mqa-passthrough to true
# and change (or add) parameter –playback-device with your USB DAC name followed by “: USB Audio (hw:x,0)”
# x corresponding to the card number: (hw:1,0) for card 1

  1. $ sudo nano /lib/systemd/system/ifi-streamer-tidal-connect.service
[Unit]
Description=RasPi Streamer Tidal Connect Service
[Service]
Restart=on-failure
ExecStart=/usr/ifi/ifi-tidal-release/bin/tidal_connect_application \
                                --tc-certificate-path "/usr/ifi/ifi-tidal-release/id_certificate/IfiAudio_ZenStream.dat" \
                                -f "Musiclounge Streamer" \
                                --codec-mpegh true \
                                --codec-mqa true \
                                --model-name "Musiclounge Streamer" \
                                --disable-app-security false \
                                --disable-web-security false \
                                --enable-mqa-passthrough true \
                                --log-level 3 \
                                --enable-websocket-log "0"
                                --playback-device "D90 MQA: USB Audio (hw:1,0)"

User=root
Group=root
RestartSec=1
KillMode=control-group
[Install]
WantedBy=multi-user.target

# CTRL+X and Y to Save


# start service and check on status

  1. $ sudo systemctl daemon-reload

# enable service at startup

  1. $ sudo systemctl enable ifi-streamer-tidal-connect.service

# start service

  1. $ sudo systemctl start ifi-streamer-tidal-connect.service

# Check the status

# the status is very important to check if the service is enabled and run correctly

# also useful to get the correct name of valid device(s)
# see the instructions above to change the –playback-device parameter

  1. $ sudo systemctl status ifi-streamer-tidal-connect.service