Building a linux based music server, decision tree and installation recepie

I recently bought an ASUS Mini PC PN40 to replace the noisy laptop I have been using a couple of years for this purpose.

Initially I installed Ubuntu Studio as I had been using on the laptop. However I didn't like the clunky user interface of Ubuntu Studio, so I tried some other flavor of Ubuntu with a low latency kernel.

But when I got to install MPD, I found this:

Note Debian and Ubuntu are infamous for shipping heavily outdated software. The MPD version in their respective stable releases are usually too old to be supported by this project. Ironically, the MPD version in Debian “unstable” is more stable than the version in Debian “stable”.

I gave the alternate repository a quick try but gave up.

I started googling and found Audiophile Linux, but gave up before starting because of the low level installation.

Audiophile Linux is based on Arch Linux, so I briefly gave it a try. The Audiophile Linux installation is based on Arch installation. I have better use of my time.

I pondered using an RPM-based linux like CentOS or Suse, but I could not overcome my dislike for all things Redhat. I simply cannot forgive them for PulseAudio. I have enough of their crap at work. Vade retro satana!

I though of FreeBSD, but my experience is that they are lagging linux when it comes to driver support. My soundcard is probably not supported.

Gentoo has an old version of MPD so I had to givw it up as well.

In desperation I turned to google and realized that there are other pacman based distributions beside Arch.

I am installing Manjaro KDE and it looks very promising. As soon as I get it running I will post the recepie.
 
Do you want to have a headless server, or do you need a GUI based server? How do you want to „use“ your server?

BTW, I use a headless Debian server/player with MOPIDY and CamillaDSP as a convolver, based on ALSA.

If you want to go headless with MOPIDY-MPD, I can provide a „recipe“.

Kr
J
 
You don't need an x86 box. You can use a Raspberry Pi, install PiCore Player and Logitech Media Server, attach an USB HDD or network storage. You will need a a DAC hat but it works brilliantly, all controlled, including volume, from a phone or tablet.
Easier, cheaper, and, for me, better. Always on too.
 
Thanks for all replies. I have done some work with Raspberry Pi, I hate when the sdcard breaks.

This is a headed server (not a headless 🙂 ).

I will use MPD and cantata. There is an excellent MPD client for Kodi, I am using it on RPI for TV stuff
 
Thanks for all replies. I have done some work with Raspberry Pi, I hate when the sdcard breaks.

I know what you mean. I have been there more than once. Take a look at piCorePlayer, which avoids reading / writing to / from the SD card. It's all done in RAM, so the SD card will live "forever".

That said, MPD in Debian is fine. The term "stable" is sometimes not easy to interpret in the Linux world. Volumio and the gang are derived from Debian, and people have no issues with MPD.
 
You don't need an x86 box. You can use a Raspberry Pi, install PiCore Player and Logitech Media Server, attach an USB HDD or network storage. You will need a a DAC hat but it works brilliantly, all controlled, including volume, from a phone or tablet.
Easier, cheaper, and, for me, better. Always on too.

How does it handle 10000+ albums? The size of my music collection drove my processor choice and i've not kept up to date since.
 
If you have issues with the SD card, try this with whatever you decide to use as your player...

sudo raspi-config
Advanced Options > Overlay FS

As of late, it is built into the raspi-config and easy to enable. It will ask you if you want to write-protect the /boot partition when you enable/disable the overlay, and you can actually leave the /boot partition alone as read/write and use it or link to it sparingly if you need or would like to for whatever reason. Whenever you want to change the system, just go through the same procedure to toggle it. It will appear as if it is still writeable with the overlay enabled, but upon reboot, any files you create while the overlay is enabled will be gone. I've done similar actions to make the system read only, but I am trying this out now as it stands, it's just easier to do the process this way.

S
 
I pondered using an RPM-based linux like CentOS or Suse, but I could not overcome my dislike for all things Redhat. I simply cannot forgive them for PulseAudio. I have enough of their crap at work. Vade retro satana!

Amen to that. I use devuan on my main dev machine for the same reason. I only launch pulseaudio when i want to listen to a video using firefox. Not sure i'll forgive the mozilla team for that decision. Anyway, not quite the latest version of MPD, but close.

root@bugs:~# apt-cache show mpd
Package: mpd
Version: 0.21.5-3
Installed-Size: 2255
Maintainer: mpd maintainers <pkg-mpd-maintainers@lists.alioth.debian.org>
Architecture: amd64
Depends: <SNIP>
Pre-Depends: init-system-helpers (>= 1.54~)
Breaks: avahi-daemon (<< 0.6.31-3)
Homepage: Music Player Daemon
Built-Using: sphinx (= 1.8.4-1)
Description: Music Player Daemon
Description-md5: f318c4a927bba8215d5caa973656c5e7
Suggests: avahi-daemon, icecast2, mpd-client, pulseaudio
Tag: implemented-in::c, interface::daemon, role:😛rogram, scope::application,
uitoolkit::ncurses, use:😛laying, works-with::audio
Section: sound
Priority: optional
Filename: pool/DEBIAN/main/m/mpd/mpd_0.21.5-3_amd64.deb
Size: 687880
MD5sum: 52f2d42864b3db780b071d5b50a1eb8a
SHA256: d7f4aeac7d1a0cafef3c7496ae93ee6d567b8060a16122a5905c99a2d4b8d03a

root@bugs:~# uname -a
Linux bugs 4.19.0-5-amd64 #1 SMP Debian 4.19.37-3 (2019-05-15) x86_64 GNU/Linux

It works just fine.

If you want a less primitive installer, try Antix (it too is systemd free) and seems to work OK on the 2 installs i've done.

Best of luck.
 
I use a Raspberry Pi 3B+ and an IQaudIO DAC Pro and I play music and sound tracks using a terminal although lately I had to install icewm to run VLC. Everything is saved in the SDCard. If that breaks, I have fsarchiver backups of the entire SDCard which I can restore from an external hard-disk.
 
Recepie

:cop: Warning, the below contains a typo. Please see post #18 for the correct text.


1. Download Manjaro-KDE full
Manjaro KDE Plasma
Choose Download button
Create a boot USB stick

2. Boot
Boot from the created USB stick

3. In Manjaro live system, connect to internet

4. Launch installation

5. Reboot

6. In you Manjaro installation, connect to internet

7. Update
Either:
"Update software installed on the system", run repeatedly until "Your system is up to date"
Or:
Start Konsole and become root:
Code:
$ sudo su
# pacman -Syu

8. Install RT-kernel
Start Konsole and become root:
Code:
$ sudo su
Show current kernel:
Code:
 # mhwd-kernel -li
 Currently running: 5.4.23-1-MANJARO (linux54)
 The following kernels are installed in your system:
   * linux54
List available kernels:
Code:
# mhwd-kernel -l
available kernels:
   * linux316
   * linux414
   * linux419
   * linux44
   * linux49
   * linux54
   * linux55
   * linux56
   * linux419-rt
   * linux54-rt
Install the one named linux<version>-rt with the largest <version> :
Code:
# mhwd-kernel -i linux54-rt

9. Allow grub to display the new kernel
Code:
# mkdir -p ~/backup/etc/default  
# cp /etc/default/grub ~/backup/etc/default
# echo "GRUB_TIMEOUT_STYLE=menu" >> /etc/default/grub
# update-grub

10. Reboot

11. Choose the RT-kernel in grub advanced options

12. Check running kernel
Code:
$ mhwd-kernel -li
 Currently running: 5.4.26-rt17-MANJARO (linux54)
 The following kernels are installed in your system:
   * linux54
   * linux54-rt

13. Check installation for some packages
Code:
$ pacman -Qe | grep -E "mpd|cantata|nfs-utils"
 cantata 2.4.1-1
 mpd 0.21.21-1
 nfs-utils 2.4.3-2

14. Connect to nfs music share
Precondition is that you have set up a network server with an exported share named /mnt/music. I run FreeNAS and love it.
Code:
$ sudo su
# mkdir -p /mnt/nfs/music
MPD needs these permissions, lets assign them now before mounting:
Code:
# chmod -R  o+rX /mnt
Test you nfs share:
Code:
# mount <ipaddress-of-nfs-server>:/mnt/music /mnt/nfs/music/
# mount | grep music
<ipaddress-of-nfs-server>:/mnt/music on /mnt/nfs/music type nfs (rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=<ipaddress-of-nfs-server>,mountvers=3,mountport=776,mountproto=udp,local_lock=none,addr=<ipaddress-of-nfs-server>)
# ls /mnt/nfs/music/ | wc
1625    3416   23045
# umount /mnt/nfs/music/
I am using autofs because it mounts the nfs share without a hick at boot.
Code:
# pacman -S autofs
# mkdir ~/backup/etc/autofs 
# cp /etc/autofs/auto.master ~/backup/etc/autofs
# ls ~/backup/etc/autofs 
auto.master
# echo "/mnt/nfs   /etc/autofs/auto.<ipaddress-of-nfs-server> --timeout 60" >> /etc/autofs/auto.master
# echo "music  -rw,soft,intr,rsize=8192,wsize=8192 192.168.72.146:/mnt/music" > /etc/autofs/auto.<ipaddress-of-nfs-server>
# systemctl start autofs
# systemctl enable autofs
# ls /mnt/nfs/music/ | wc
1625    3416   23045

15. Uninstall pulseaudio
This is essential since those german bastards will overwrite your alsa configuration without blinking 😛 They invented pulse audio as revenge for you know what.😡
Code:
# pacman -R manjaro-pulse
# pacman -R pulseaudio-alsa

16. Check your soudcard
Figure out the hardware address of your card:
Code:
# aplay -l | grep card
 card 0: PCH [HDA Intel PCH], device 0: ALC255 Analog [ALC255 Analog]
 card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
 card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
 card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
 card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
 card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
 card 1: USB [Scarlett 2i2 USB], device 0: USB Audio [USB Audio]

17. Configure Alsa
Choose your preffered card in the asound.conf, swap <card-number> for the number shown in aplay -l
Code:
# cp /etc/asound.conf ~/backup/etc/
# cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xa1210000 irq 131
 1 [USB            ]: USB-Audio - Scarlett 2i2 USB
                      Focusrite Scarlett 2i2 USB at usb-0000:00:15.0-3, high speed
# echo "defaults.pcm.card <card-number>" > /etc/asound.conf 
# echo "defaults.ctl.card <card-number>" >> /etc/asound.conf

18. Reboot
Maybe not necessary. The purpose was to make alsa changes stick.

19. Configure MPD
Figure out the group owning the nfs share:
Code:
# ls -al /mnt/nfs
total 237
drwxr-xr-x    3 root   root      0 27 mar 17.48 .
drwxr-xr-x    3 root   root   4096 25 mar 20.57 ..
drwxrwx--- 1627 <user> <group> 1628  6 mar  2018 music
Add mpd to the group owning the nfs files:
Code:
# gpasswd -a mpd <group>
Adding user mpd to group <group>
Change the MPD configuration:
Code:
# cp /etc/mpd.conf ~/backup/etc/
# echo 'music_directory "/mnt/nfs/music"' >> /etc/mpd.conf 
# echo 'audio_output {' >> /etc/mpd.conf 
# echo '  type "alsa"' >> /etc/mpd.conf 
# echo '}' >> /etc/mpd.conf  
# systemctl start mpd
# systemctl status mpd
# systemctl enable mpd

20. Start cantata
Enjoy the music!
 
1. Download Manjaro-KDE full
Manjaro KDE Plasma
Choose Download button
Create a boot USB stick

2. Boot
Boot from the created USB stick

3. In Manjaro live system, connect to internet

4. Launch installation

5. Reboot

6. In you Manjaro installation, connect to internet

7. Update
Either:
"Update software installed on the system", run repeatedly until "Your system is up to date"
Or:
Start Konsole and become root:
Code:
$ sudo su
# pacman -Syu

8. Install RT-kernel
Start Konsole and become root:
Code:
$ sudo su
Show current kernel:
Code:
 # mhwd-kernel -li
 Currently running: 5.4.23-1-MANJARO (linux54)
 The following kernels are installed in your system:
   * linux54
List available kernels:
Code:
# mhwd-kernel -l
available kernels:
   * linux316
   * linux414
   * linux419
   * linux44
   * linux49
   * linux54
   * linux55
   * linux56
   * linux419-rt
   * linux54-rt
Install the one named linux<version>-rt with the largest <version> :
Code:
# mhwd-kernel -i linux54-rt

9. Allow grub to display the new kernel
Code:
# mkdir -p ~/backup/etc/default  
# cp /etc/default/grub ~/backup/etc/default
# echo "GRUB_TIMEOUT_STYLE=menu" >> /etc/default/grub
# update-grub

10. Reboot

11. Choose the RT-kernel in grub advanced options

12. Check running kernel
Code:
$ mhwd-kernel -li
 Currently running: 5.4.26-rt17-MANJARO (linux54)
 The following kernels are installed in your system:
   * linux54
   * linux54-rt

13. Check installation for some packages
Code:
$ pacman -Qe | grep -E "mpd|cantata|nfs-utils"
 cantata 2.4.1-1
 mpd 0.21.21-1
 nfs-utils 2.4.3-2

14. Connect to nfs music share
Precondition is that you have set up a network server with an exported share named /mnt/music. I run FreeNAS and love it.
Code:
$ sudo su
# mkdir -p /mnt/nfs/music
MPD needs these permissions, lets assign them now before mounting:
Code:
# chmod -R  o+rX /mnt
Test you nfs share:
Code:
# mount <ipaddress-of-nfs-server>:/mnt/music /mnt/nfs/music/
# mount | grep music
<ipaddress-of-nfs-server>:/mnt/music on /mnt/nfs/music type nfs (rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=<ipaddress-of-nfs-server>,mountvers=3,mountport=776,mountproto=udp,local_lock=none,addr=<ipaddress-of-nfs-server>)
# ls /mnt/nfs/music/ | wc
1625    3416   23045
# umount /mnt/nfs/music/
I am using autofs because it mounts the nfs share without a hick at boot.
Code:
# pacman -S autofs
# mkdir ~/backup/etc/autofs 
# cp /etc/autofs/auto.master ~/backup/etc/autofs
# ls ~/backup/etc/autofs 
auto.master
# echo "/mnt/nfs   /etc/autofs/auto.<ipaddress-of-nfs-server> --timeout 60" >> /etc/autofs/auto.master
# echo "music  -rw,soft,intr,rsize=8192,wsize=8192 <ipaddress-of-nfs-server>:/mnt/music" > /etc/autofs/auto.<ipaddress-of-nfs-server>
# systemctl start autofs
# systemctl enable autofs
# ls /mnt/nfs/music/ | wc
1625    3416   23045

15. Uninstall pulseaudio
This is essential since those german bastards will overwrite your alsa configuration without blinking 😛 They invented pulse audio as revenge for you know what.😡
Code:
# pacman -R manjaro-pulse
# pacman -R pulseaudio-alsa

16. Check your soudcard
Figure out the hardware address of your card:
Code:
# aplay -l | grep card
 card 0: PCH [HDA Intel PCH], device 0: ALC255 Analog [ALC255 Analog]
 card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
 card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
 card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
 card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
 card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
 card 1: USB [Scarlett 2i2 USB], device 0: USB Audio [USB Audio]

17. Configure Alsa
Choose your preffered card in the asound.conf, swap <card-number> for the number shown in aplay -l
Code:
# cp /etc/asound.conf ~/backup/etc/
# cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xa1210000 irq 131
 1 [USB            ]: USB-Audio - Scarlett 2i2 USB
                      Focusrite Scarlett 2i2 USB at usb-0000:00:15.0-3, high speed
# echo "defaults.pcm.card <card-number>" > /etc/asound.conf 
# echo "defaults.ctl.card <card-number>" >> /etc/asound.conf

18. Reboot
Maybe not necessary. The purpose was to make alsa changes stick.

19. Configure MPD
Figure out the group owning the nfs share:
Code:
# ls -al /mnt/nfs
total 237
drwxr-xr-x    3 root   root      0 27 mar 17.48 .
drwxr-xr-x    3 root   root   4096 25 mar 20.57 ..
drwxrwx--- 1627 <user> <group> 1628  6 mar  2018 music
Add mpd to the group owning the nfs files:
Code:
# gpasswd -a mpd <group>
Adding user mpd to group <group>
Change the MPD configuration:
Code:
# cp /etc/mpd.conf ~/backup/etc/
# echo 'music_directory "/mnt/nfs/music"' >> /etc/mpd.conf 
# echo 'audio_output {' >> /etc/mpd.conf 
# echo '  type "alsa"' >> /etc/mpd.conf 
# echo '}' >> /etc/mpd.conf  
# systemctl start mpd
# systemctl status mpd
# systemctl enable mpd

20. Start cantata

Enjoy the music!
 
Last edited:
Note Debian and Ubuntu are infamous for shipping heavily outdated software. The MPD version in their respective stable releases are usually too old to be supported by this project. Ironically, the MPD version in Debian “unstable” is more stable than the version in Debian “stable”.
This quote uses false logic. It also uses dramatic wording. I would not use this to make a decision on a distribution.