Turn your Pine64 into a music server with mpd - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4) +--- Forum: Pine A64 Projects, Ideas and Tutorials (https://forum.pine64.org/forumdisplay.php?fid=19) +--- Thread: Turn your Pine64 into a music server with mpd (/showthread.php?tid=4387) |
Turn your Pine64 into a music server with mpd - JulianM - 03-22-2017 Hi together! This topic is structured into a few categories. • Prepare your Pine64 • Installing and setup MPD • Fix sound problems with alsamixer • Installing und setup Samba • Control your MPD via IR remote control • My own setup » Prepare your Pine64 What do you need? - Pine64 board. - Speakers via audiojack. - Install the latest Ubuntu image by longsleep. What you'll get? - A music server which can be controlled via Windows, Linux and Android. First of all: Download the latest Ubuntu image by longsleep. - Overview of all Ubuntu images powered by longsleep I downloaded the following image: - xenial-pine64-bspkernel-20161218-1 After you have downloaded and burned the image on your micro sdcard you need to apply some pre requirements. If you just downloaded the Ubuntu image you have to resize the partitions of your microsd card. Just enter this command: Code: resize_rootfs.sh Next step: Update the software of Pine64. Code: pine64_fix_whatever.sh Ok, all pre requirements are given now. » Installing und setup MPD Let's install mpd! Code: apt-get install mpc mpd Fix permissions of mpd directories: Code: chmod 770 /var/lib/mpd/music/ /var/lib/mpd/playlists/ Apply my config for mpd: Code: cat <<EOF >/etc/mpd.conf Now activate audio output via 3.5 audiojack! But please note: The 3.5 audiojack will be the default device for all audio output with these configs! Code: cat <<EOF >/etc/modules-load.d/pine64-audiojack.conf Code: cat <<EOF >/etc/asound.conf Reboot your Pine64 to apply changes of sound cards. Code: reboot Just copy all your music files into the following directory: Code: /var/lib/mpd/music Take note that ownerships are correct! If not, apply them. Code: chown -R mpd:audio /var/lib/mpd/music/ Update the music database of mpd with mpc. Code: mpc update Alright, you're done! Feel free to manage your mpd server with different mpd clients! These are my favourites: • Linux & Windows: Gnome Music Player Client • Android: MPD Control, Droid MPD Client » Fix sound problems with alsamixer Normally there should be no problems with sound if you are using the latest Ubuntu image by longsleep. So, you are advised to check the following settings in alsamixer. Code: alsamixer Code: Unmute "Headphone" with toogling "m" » Installing und setup Samba How to copy your files from your Windows machine to your Pine64 - Use SFTP or... Let's install Samba! Code: apt-get install samba-common samba Create a Samba user to manage your files: Code: smbpasswd -a mpd Apply my config to login via Samba with mpd user: Code: cat <<EOF >/etc/samba/smb.conf Restart Samba. Code: /etc/init.d/samba restart Just add a "Network ressource" on Windows with the following path: Code: \\ip-address-of-pine64\mpd Password: You have choosen it with "smbpasswd -a mpd" » Control your MPD via IR remote control Control your MPD server with the official IR remote control by Pine64! You need to install "keybinder", to re-mapping the keys of your IR remote control to execute commands. Code: apt-get install unzip gcc make Use "evtest" to determine the event input of IR receiver: Code: apt-get install evtest The event number depends of the plugged in usb devices!!! Code: root@pine64:~# evtest Now press a few buttons on your IR remote control. You should see some entries like... Code: Testing ... (interrupt to exit) Now we can work with keybinder Code: keybinder /dev/input/eventX You got the number by evtest. Feel free to apply my config or create your own. Code: cat <<EOF >/etc/keybinder.conf Start keybinder automatically on boot. Code: (crontab -l ; echo "@reboot /usr/bin/screen -dmS keybinder /usr/local/bin/keybinder /dev/input/eventX")| crontab - » My own setup Have fun with it Best regards Julian RE: Turn your Pine64 into a music server with mpd - Luke - 03-22-2017 Great post Julian! RE: Turn your Pine64 into a music server with mpd - tllim - 03-23-2017 Thanks on the good post. |