DIY: Hi-Res Music Player based on Intel NUC + Ubuntu Linux + Fiio E10K USB DAC

Recently I built a Hi-Res Music Player with support for FLAC/WAV/MP. I just used all old hardware lying idle with me. It is on top of Intel NUC, Linux, 1TB Hard disk drive and Fiio USB DAC. I have given my complete console logs to get it done as reference for others and myself too for future.

hi-res-music-playe.jpg

Hardware components:

1. Intel NUC5i3RYH with 8GB RAM and 1TB Hard disk drive. HDD should have a small 30GB partition for / file system and rest goes to /home to store Hi-Res music files.
2. Fiio E10K USB DAC
3. Pen drive with Ubuntu Server 18.04 Linux Installation image. I don’t use Ubuntu desktop. It is a headless server without Monitor/KBD/Mouse.

Installation Steps:

1. OS Installation:

Install Ubuntu Server 18.04 using pen drive image and ethernet connected.

2. Wireless configuration:

$ networkctl 
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 enp0s25 ether routable configured
3 wlp2s0 wlan off unmanaged
$ networkctl status
● State: routable
Address: 192.168.1.20 on enp0s25
fe80::xxxx:edff:xxxx:xxxx on enp0s25
Gateway: 192.168.1.1 (NETGEAR) on enp0s25
DNS: 192.168.1.1 

Only ethernet configured in above console log. So wireless to be configured

$ sudo apt install network-manager
$ nmcli dev wifi

IN-USE SSID MODE CHAN RATE SIGNAL BARS SECURITY
— Infra 2 65 Mbit/s 74 ▂▄▆_ —
ssid1-5G Infra 36 270 Mbit/s 44 ▂▄__ WPA2
ssid1 Infra 2 130 Mbit/s 25 ▂___ WPA2 

Now configure
$ sudo nmcli dev wifi connect <SSID> password ‘<Password>’
Device ‘wlp2s0’ successfully activated with ‘abcdefgh-32bd-xyzx0-89ac-5e4ff1630a8f’.

$ networkctl status
State: routable
Address: 192.168.1.20 on enp0s25
192.168.1.25 on wlp2s0
fe80::XXXX:edff:XXXX:XXXX on enp0s25
YYYY::f57b:YYYY:3803:YYYY on wlp2s0
Gateway: 192.168.1.1 (NETGEAR) on enp0s25
192.168.1.1 on wlp2s0
DNS: 192.168.1.1

Wireless Done!

3. SAMBA server for File sharing (to copy Music files over network):- assuming you have a normal user called “audiouser”

$ sudo apt install samba
$ sudo smbpasswd -a <linux_user_name>

Append below snippet in /etc/samba/smb.conf
——– start ——–
[Music]
path = /home/audiouser/Music
valid users = audiouser
read only = no
——— end ———
$ sudo service smbd restart
Below cmd to check if any error in smb.conf
$ testparm 

4. ALSA audio base installlation:

$ sudo apt install ubuntu-restricted-extras => installing media codecs
$ sudo apt install alsa alsa-utils

Note down
$ cat /proc/asound/cards
0 [HDMI ]: HDA-Intel – HDA Intel HDMI
HDA Intel HDMI at 0xaa124000 irq 46
1 [Audio ]: USB-Audio – DigiHug USB Audio
FiiO DigiHug USB Audio at usb-0000:00:1d.0-1.3, full speed

2 [PCH ]: HDA-Intel – HDA Intel PCH
HDA Intel PCH at 0xaa120000 irq 47

Test from cmd line:
$ speaker-test -Dhw:1,0 -c2

Make the device default:
$ sudo vi /etc/asound.conf
defaults.pcm.card 1
defaults.ctl.card 1

$ alsamixer => adjust all volume for your card
$ sudo alsactl store

5. Hi-Res Music Player Daemon installation:

$ sudo apt install mpd
Edit /etc/mpd.conf => Here change media path directory as your music files and HW ID as DAC.
copy all Music files under /home/audiouser/Music => use same path in above mpd.conf file too
$ sudo service mpd restart

6. Install MPD client in Android/iOS and enjoy

7. Configure as AirPlay receiver for iOS devices:

$ sudo apt install shairport-sync => Install AirPlay receiver daemon service

$ sudo vi /etc/shairport-sync.conf   => Configure to use USB DAC as device
// Back End Settings
// These are parameters for the “alsa” audio back end.
alsa =
{
output_device = “hw:1,0”; // the name of the alsa output device. Use “alsamixer” or “aplay” to find out the names of devices, mixers, etc.
# mixer_control_name = “PCM”; // the name of the mixer to use to adjust output volume. If not specified, volume in adjusted in software.
# mixer_device = “default”; // the mixer_

$ sudo service shairport-sync restart
$ sudo systemctl status shairport-sync.service => make sure that it is running
shairport-sync.service – ShairportSync AirTunes receiver
Loaded: loaded (/lib/systemd/system/shairport-sync.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-07-23 17:34:48 UTC; 7min ago
Docs: man:shairport-sync(7)
file:///usr/share/doc/shairport-sync/README.md.gz
https://github.com/mikebrady/shairport-sync
Process: 3317 ExecStart=/usr/bin/shairport-sync –daemon $DAEMON_ARGS (code=exited
Main PID: 3319 (shairport-sync)
Tasks: 3 (limit: 4915)
Memory: 1.6M
CGroup: /system.slice/shairport-sync.service
└─3319 /usr/bin/shairport-sync –daemon

Jul 23 17:34:48 ksunaudio systemd[1]: Starting ShairportSync AirTunes receiver…
Jul 23 17:34:48 ksunaudio systemd[1]: Started ShairportSync AirTunes receiver.

Now Play any music player on iPhone/iPad and cast to AirPlay device. You should see this new AirPlay device.

 

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *