Play music with MPD from USB drive

Now you can plug in USB block devices and they are mounted automatically we need a player. Let’s install mpd.

sudo apt-get install mpd

You may have seen, that mpd immediately starts up after its installation. Stop it and create symbolic links to the auto-mount directories. I do it just for a few, because I will not have more than 3 USB disks connected. Then we configure our mpd.

sudo service mpd stop
sudo ln -s /media/usb0/  /var/lib/mpd/music/usb0
sudo ln -s /media/usb1/  /var/lib/mpd/music/usb1
sudo ln -s /media/usb2/  /var/lib/mpd/music/usb2
sudo nano /etc/mpd.conf

My mpf.conf file follows. Only uncommented lines are shown here. How? Well with egrep.

egrep -v '(^#|^\s*$|^\s*\t*#)' /etc/mpd.conf

music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/playlists"
db_file "/var/lib/mpd/tag_cache"
log_file "/var/log/mpd/mpd.log"
pid_file "/var/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
user "root"
bind_to_address "any"
log_level "default"
gapless_mp3_playback "yes"
metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
auto_update "yes"
follow_inside_symlinks "yes"
input {
 plugin "curl"
}
audio_output {
 type "alsa"
 name "HDMI"
}
mixer_type "hardware"
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"

Well. Uhm. Yes. User is root. root. Again: root. I know. But I played around a while and whenever I’ve plugged in an EXTx formatted disk, I had problems with file and directory permission. So if you know a solution how MPD runs as ordinary user mpd or similar without problems with permissions, please let me know.

So for now you can start mpd and try to connect with your favorite client for MPD.

sudo service mpd start

Next step.

Advertisements

2 thoughts on “Play music with MPD from USB drive

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s