- Shell 100%
| mpd-jeos-setup.sh | ||
| README.md | ||
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:
- Phase 1 (live CD) — installs Alpine to disk, then reboots.
- 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.shto 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
- Creates a
setup-alpineanswer file targeting the selected disk. - Runs
setup-alpine -eto perform an unattended sys-mode install. - Remounts the root partition after
setup-alpineunmounts it. - Writes the Phase 2 script, a marker file, and an OpenRC one-shot service onto the installed system.
- 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-openrcmympd+mympd-openrcnfs-utils+nfs-utils-openrcalsa-utils,alsa-ucm-conf
Configures:
- MPD bound to
0.0.0.0:6600with 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 to44100:16:2or another rate in/etc/mpd.confif 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.
Recommended USB controller cards
| Chipset | Notes |
|---|---|
| Renesas uPD720201 | Gold standard for VFIO. Resets cleanly, stable MSI-X, isolates into its own IOMMU group. ~$20–30. |
| 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
- Install the card in a PCIe slot.
- 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. - Edit your MPD VM, add the controller under Other PCI Devices.
- Plug your DAC into the passed-through card's ports.
- 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.