No description
Find a file
2026-06-01 11:41:42 -06:00
mpd-jeos-setup.sh Remove noauto from fstab NFS template; strip noauto in setup-music.sh 2026-06-01 11:33:41 -06:00
README.md Add comprehensive README with install guide and troubleshooting 2026-06-01 11:41:42 -06:00

MPD JeOS — Alpine Linux MPD appliance for Unraid VMs

A single-script automated installer that turns a blank VM into a working MPD server with the myMPD web UI, ready to stream from an Unraid NFS music share to a USB DAC.

Quick start

Boot your VM from the Alpine Linux live ISO, then run:

wget -O- https://git.martlet.lol/Martlet/mpd-jeos/raw/branch/main/mpd-jeos-setup.sh | sh

The script runs in two phases:

  1. Phase 1 (live CD) — installs Alpine to disk, then reboots.
  2. Phase 2 (first boot) — runs automatically, installs MPD + myMPD, configures everything, and starts services. Takes ~2 minutes.

After Phase 2 completes:

  • Web UI: http://<ip>
  • SSH: ssh root@<ip> (password: mpdjeos)
  • Music: run /root/setup-music.sh to point it at your Unraid NFS share

Choosing the target disk

The script prompts you interactively to pick a disk. To skip the prompt (e.g. for automated installs), set the environment variable:

TARGET_DISK=/dev/vda wget -O- ... | sh

Customising the music share path

The default Unraid music share is /mnt/user/music. To use a different path, set UNRAID_MUSIC_PATH before piping the script:

UNRAID_MUSIC_PATH=/mnt/user/other_share wget -O- ... | sh

This carries through to setup-music.sh, which uses it as the default when prompting for the path.

Architecture

Phase 1

  1. Creates a setup-alpine answer file targeting the selected disk.
  2. Runs setup-alpine -e to perform an unattended sys-mode install.
  3. Remounts the root partition after setup-alpine unmounts it.
  4. Writes the Phase 2 script, a marker file, and an OpenRC one-shot service onto the installed system.
  5. Reboots.

Phase 2

Runs via an OpenRC init script (/etc/init.d/mpd-jeos-phase2) that depends on net, so networking is guaranteed to be up. Installs:

  • mpd + mpd-openrc
  • mympd + mympd-openrc
  • nfs-utils + nfs-utils-openrc
  • alsa-utils, alsa-ucm-conf

Configures:

  • MPD bound to 0.0.0.0:6600 with USB DAC auto-detection
  • myMPD on port 80
  • NFS mount template in /etc/fstab
  • Root password set to mpdjeos

Then removes its own init script and marker so it never runs again.

MPD audio configuration

The generated /etc/mpd.conf uses these defaults:

audio_output {
    type           "alsa"
    name           "USB DAC"
    device         "plughw:<card>,0"
    mixer_type     "software"
    format         "48000:16:2"
}
  • plughw: — uses ALSA's plug layer for automatic sample rate and format conversion between source material and hardware capabilities.
  • format 48000:16:2 — outputs 48 kHz / 16-bit / stereo. Most USB DACs support this natively. Change to 44100:16:2 or another rate in /etc/mpd.conf if your DAC needs something different.
  • mixer_type "software" — safe default. Change to "hardware" if your DAC has a hardware mixer.

Troubleshooting

NFS share doesn't mount at boot

The fstab template intentionally omits noauto so the nfsmount OpenRC service mounts it automatically. If your system was installed with an older version of the script that included noauto, fix it with:

sed -i 's/,noauto//' /etc/fstab
reboot

Audio crackling / popping / static

This is a universal problem with USB audio devices in virtual machines. The hypervisor cannot deliver USB isochronous packets with consistent timing, causing the DAC's hardware buffer to underrun. Software buffer tweaks can reduce but never fully eliminate it.

Software workaround (try first):

echo "options snd-usb-audio nrpackets=8" > /etc/modprobe.d/usb-audio.conf
mkinitfs && reboot

This increases the USB audio buffer size to tolerate more timing jitter.

Hardware fix (definitive):

Pass through a dedicated PCIe USB controller to the VM via VFIO and plug your DAC into that controller. The VM gets direct hardware ownership, and USB timing is handled by real silicon instead of hypervisor emulation.

Chipset Notes
Renesas uPD720201 Gold standard for VFIO. Resets cleanly, stable MSI-X, isolates into its own IOMMU group. ~$2030.
Renesas uPD720202 Same family, fewer ports. Also excellent.
ASMedia ASM1142 / ASM2142 Good alternative. Widely available.
Fresco Logic FL1100 Common in Inateck cards but has known reset bugs. May need firmware updates. Use Renesas if possible.

Avoid motherboard-integrated USB controllers for passthrough — they often share an IOMMU group with other devices (SATA controller, chipset devices) and can't be isolated.

Unraid setup steps

  1. Install the card in a PCIe slot.
  2. Tools → System Devices — find the controller (look for "Renesas" or vendor ID 1912), tick the checkbox to bind it to VFIO at boot, then reboot Unraid.
  3. Edit your MPD VM, add the controller under Other PCI Devices.
  4. Plug your DAC into the passed-through card's ports.
  5. Start the VM — the crackling will be gone.

Wrong disk selected / VM uses virtio

If the VM uses virtio block devices, the disk appears as /dev/vda instead of /dev/sda. The interactive prompt will list available disks so you can pick the right one. For non-interactive use, pass TARGET_DISK=/dev/vda.

Phase 2 didn't run after reboot

Phase 2 is triggered by a proper OpenRC one-shot init script (/etc/init.d/mpd-jeos-phase2) with depend() { need net }. This is more reliable than local.d scripts. If networking takes unusually long to come up, Phase 2 may be delayed but should still run.

Volume too loud

Use mpc to adjust MPD volume:

mpc volume 50

MPD's volume setting persists across restarts.

Credentials

Service User Password
SSH root mpdjeos
myMPD none

Change the root password after first login.