These are the steps taken to have MPD on piCore 14
Newer version might work as well (or maybe even better), but have not been tested.
- Download the piCore image
- Unpack the
.zipfile and write the.imgfile to the SD-Card (using USB Image Tool for example) - Move the SD-Card to the Pi, plug the Pi into the network and plug in the power source
- SSH into the Pi (using Putty for example)
Login usingtc/piCore - Execute
backupshell command after the first boot to save generated unique SSH keys which will be used during next boots. - Expand the partition:
- Start the partition tool:
sudo fdisk -u /dev/mmcblk0 - List partitions with
pcommand and write down the StartLBA and EndLBA of the second partition - Delete second partition with
dthan recreate it withncommand
SelectpforPrimary Partitionand2forPartition Number
Use the same starting sector as deleted had and use the default value forLast Cylinder
Exit fdisk withwcommand - Reboot the Pi:
sudo reboot - After reboot expand the partition:
sudo resize2fs /dev/mmcblk0p2(may take a while)
- Start the partition tool:
- Optionally install the nano text editor (or keep using vi):
tce-load -wi nano - Install ALSA:
tce-load -wi alsa alsa-utils - Install tools to create extensions
tce-load -wi squashfs-tools
- Configure ALSA:
sudo alsamixer - Save config:
sudo alsactl store - Add the following lines to
/opt/.filetool.lst:
etc/asound.conf - Add
alsactl restoreto/opt/bootlocal.sh - Save changes to ROM:
backup
- Install compiler:
tce-load -wi compiletc meson ninja - Install dependencies:
tce-load -wi boost-dev cmake curl-dev dbus-dev expat2-dev faad2-dev git glib2-dev icu-dev lame-dev libfmt-dev libgcrypt-dev libid3tag-dev libmad-dev libsndfile-dev mpg123-dev sqlite3-dev - Fix
libid3tag:- Create a temporary directory:
mkdir -p /tmp/libid3tagExt/usr/local/lib/pkgconfig - Unpack package:
unsquashfs -d /tmp/libid3tagExt /mnt/mmcblk0p2/tce/optional/libid3tag-dev.tcz - Create
/tmp/libid3tagExt/usr/local/lib/pkgconfig/id3tag.pccontaining:prefix=/usr/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include Name: id3tag Description: ID3 tag reading library Version: 0.17 Requires: Libs: -L${libdir} -lid3tag Cflags: -I${includedir} - Remove exisiting package:
rm /mnt/mmcblk0p2/tce/optional/libid3tag-dev.tcz - Repack new package:
mksquashfs /tmp/libid3tagExt /mnt/mmcblk0p2/tce/optional/libid3tag-dev.tcz
- Create a temporary directory:
- Reboot:
sudo reboot - Install libmpdclient:
- Download the latest tarball for libmpdclient from https://github.com/MusicPlayerDaemon/libmpdclient/tags, for example:
wget https://github.com/MusicPlayerDaemon/libmpdclient/archive/refs/tags/v2.22.tar.gz -O libmpdclient-2.22.tar.gz - Unpack the tarball:
tar -xvzf libmpdclient-*.tar.gz - Go into the unpacked directory:
cd libmpdclient* - Configure the source tree:
meson setup output - Compile:
ninja -C output - Install libmpdclient into temporary directory:
DESTDIR=/tmp/libmpdclientExt ninja -C output install - Create extension:
mksquashfs /tmp/libmpdclientExt /mnt/mmcblk0p2/tce/optional/libmpdclient.tcz - Add
libmpdclient.tczto/mnt/mmcblk0p2/tce/onboot.lst
- Download the latest tarball for libmpdclient from https://github.com/MusicPlayerDaemon/libmpdclient/tags, for example:
- Install MPD:
- Download a tarball from https://www.musicpd.org/download/mpd, for example:
wget https://www.musicpd.org/download/mpd/0.23/mpd-0.23.15.tar.xz -O mpd-0.23.15.tar.xz - Unpack the tarball:
tar -Jxvf mpd-*.tar.xz - Go into the unpacked directory:
cd mpd* - Configure the source tree:
meson setup output/release --buildtype=release --prefix=/usr/local -Dlibmpdclient=enabled -Dadplug=disabled -Dao=disabled -Dbzip2=disabled -Ddsd=false -Dffmpeg=disabled -Dfluidsynth=disabled -Dgme=disabled -Did3tag=enabled -Dipv6=disabled -Djack=disabled -Dmikmod=disabled -Dmms=disabled -Dmodplug=disabled -Dmpcdec=disabled -Dnfs=disabled -Dopenal=disabled -Dopus=disabled -Doss=disabled -Dpipe=false -Dpulse=disabled -Drecorder=false -Dshine=disabled -Dshout=disabled -Dsidplay=disabled -Dsmbclient=disabled -Dsoundcloud=disabled -Dsoxr=disabled -Dtwolame=disabled -Dupnp=disabled -Dwavpack=disabled -Dwave_encoder=false -Dwildmidi=disabled -Dzzip=disabled -Dzeroconf=disabled - Compile:
ninja -C output/release - Create a temporary directory:
mkdir -p /tmp/mpdExt/usr/local/etc - Install mpd into temporary directory:
DESTDIR=/tmp/mpdExt ninja -C output/release install - Copy config:
cp doc/mpdconf.example /tmp/mpdExt/usr/local/etc/mpd.conf - Create extension:
mksquashfs /tmp/mpdExt /mnt/mmcblk0p2/tce/optional/mpd.tcz - Add
mpd.tczto/mnt/mmcblk0p2/tce/onboot.lst
- Download a tarball from https://www.musicpd.org/download/mpd, for example:
- Reboot:
sudo reboot - Create config directory:
mkdir ~/.mpd - Copy over config:
cp /usr/local/etc/mpd.conf ~/.mpd/mpd.conf, or to another filename if you're going to run multiple MPD instances - Make some changes to the config:
- Enable the
log_file&pid_file(remove the#at the start of the line) - Change the name of the log_file and the pid_file if you're going to run multiple MPD instances
- Enable
userandgroupand set it totcandstaffrespectively - Change port if necessary
- Add as many
audio_outputas locations you want to stream to:audio_output { type "snapcast" # outpouts in a way SnapClients can connect to the audio stream name "location" # name of the location this stream will be used port "1704" # unique port number format "44100:16:2" mixer_type "software" } - Run mpd once to test and to create a database file:
mpd ~/.mpd/mpd.conf(andmpd --killafter a little while) - Enable the
db_filein the config (remove the#at the start of the line)
- Enable the
- Have MPD auto start on boot:
sudo nano /opt/bootlocal.sh, addmpd /home/tc/.mpd/mpd.confto the end - Save the changes:
backup - Reboot:
sudo reboot
-
Install cifs:
tce-load -wi cifs-utils samba4 filesystems-KERNEL -
Create a file containing the login credentials of the share
/home/tc/.smb:user=username password=xxxxxx -
Add a line to
/etc/fstab://192.168.x.xxx/sharedfolder /mnt/shared cifs credentials=/home/tc/.smb,vers=1.0 0 0 -
Make fstab saved by adding
etc/fstabto/opt/.filetool.lst -
Create a script for mounting
/opt/mount.sh:#!/bin/sh mkdir /mnt/shared until cat /etc/fstab | grep shared do sleep 1 done sleep 5 mount /mnt/shared -
Give the script execution rights:
sudo chmod +x /opt/mount.sh -
Add the script to
/opt/bootlocal.sh:/opt/mount.sh & -
Save the changes:
backup -
Reboot:
sudo reboot
- Set the correct library location in
~/.mpd/mpd.conf:music_directory "/mnt/shared"
- Add some lines to
/opt/.xfiletool.lst:
home/tc/.mpd/log*
home/tc/.mpd/pid*
Used a lot of info from http://bz31.tuxfamily.org/dokuwiki/doku.php?id=core:picore and also from https://mpd.readthedocs.io/en/stable/user.html