HTPC Experiments - Part 3

I could a tale unfold whose lightest word
Would harrow up thy soul, freeze thy young blood,
Make thy two eyes, like stars, start from their spheres,
Thy knotted and combinèd locks to part
And each particular hair to stand on end,
Like quills upon the fearful porpentine 
-Hamlet, William Shakespeare

That tale has nothing on getting Arch + MPD + DSD playback working. Rather than bore you with the details and frustration of the many false starts and shimmying up wrong trees, let me quickly give you the config that works for me. You can get a little more context from reading parts 1 and 2 of HTPC experiments.

Since the stock mpd in the pacman Arch repos wasn't honoring DSD related settings in the configuration file, I had to compile mpd from source and patch it with a DSD patch.

As of this writing, I don't know if the patch has been merged. If you use pacman to get mpd (v 0.19), DSD playback does not work. The iFI micro IDSD card only gets PCM streams at either 41k or 48k and the decoder LEDs light up green (PCM signal input). The iFI cards LEDs should light up cyan or other colors.


  • Grab mpd MPD 0.19.18
  • Grab the DSD patch from here. MPD-DSD Patch ( I used the .14 version. Try newer ones if available)
  • Patch the MPD source like so 
    • tar xzf mpd*19*xz
    • tar xzf mpd-dsd*
    • cd mpd-0.19.18
    • patch --dry-run -Np1 < ../mpd-dsd/*.patch
  • Check the output of the patch command to make sure it applies cleanly. If it looks good, run the command again like so
    • patch -Np1 < ../mpd-dsd/*.patch
  • Now build mpd and install mpd with
    • ./configure && make && sudo make install

That should get mpd in /usr/local/bin; Adjust the --prefix and other options to configure to suit your setup.

At this stage, I spent a lot of time trying to get MPD + PulseAudio + ALSA to work to output a bit perfect stream. The ALSA asound documentation is comprehensive and powerful but is a nightmare to get right for non-default setups. In the end, I ripped out PulseAudio and only used MPD+ALSA. With this setup, Kodi uses ALSA direct to output to the HDMI output when playing videos etc. When I want to listen to HiRes Audio, I fire up MPDroid (on my phone) or Cantata for DSD/DSF/DFF/FLAC files.

So, ended with the below config file for mpd in /etc/mpd.conf and running mpd as a systemd unit. Make sure to enable and start the service with systemctl start (to test) and when it is all working, enable it with systemctl enable.

My mpd.conf file

pid_file "/var/lib/mpd/mpd.pid"
db_file "/var/lib/mpd/mpd.db"
state_file "/var/lib/mpd/mpdstate"
playlist_directory "/var/lib/mpd/playlists"
user  "mpd"
group "mpd"
music_directory "/mnt/"
log_file "/var/log/mpd/mpd.log"
bind_to_address "any"
port "6600"
zeroconf_enabled "yes"
follow_outside_symlinks  "yes"
follow_inside_symlinks  "yes"
zeroconf_name "Mediacenter MPD"
samplerate_converter           "Best Sinc Interpolator"
audio_output {
        type            "alsa"
        name            "surround21"
device "hw:2,0"
auto_resample "no"
auto_format "no"
dsd_usb "no"
dop "no"
dsd_native "yes"
dsd_native_type "2"

}
#####

Of course, you need to have the mpd user and group created, along with the directories list in the conf file. Also change ownership of those files and directories to the mpd user.

Now, there's plenty of minor niggles on this box that I will try and fix over the next few weeks and post updates if I find anything interesting.

Happy listening!!

Comments

Popular posts from this blog

Quick and Dirty WiFi-Ethernet Bridge - Arch Linux - ASUS Router and Apple Airport Extreme

Android File Transfer and Samsung SmartSwitch Conflict