Playing Music

From SingletonMillerWiki
Revision as of 10:31, 5 June 2012 by Martin (Talk | contribs)

Jump to: navigation, search


Resources

Enable Sound

http://www.techdrivein.com/2011/05/mpd-ncmpc-music-nirvana-for-command.html

Sound via Command Line

mpd is a music playing daemon [mpd.wikia.com], this means its a server side service that runs on your RPi in the background. mpd builds and maintains a database of all your music so you can access it with a client for anywhere on our network.

Once properly configured mpd can be controlled via the command line utilities using a client tool such as mpc [1] or a console client like ncmpcpp. Graphical clients also exist.

sudo apt-get install mpd mpc ncmpcpp

This command will install the tools we need and automatically resolve a stack of dependencies. On my system it took about 10m to install everything.

Configuring mpd

By default the mpd install creates a conf file for you owned by user 'mpd' in group 'audio'.

sudo ls -all /etc/mpd.conf
-rw-r----- 1 mpd audio 12240 Jun  2 22:48 /etc/mpd.conf

Check that your user is in the 'audio' group using

cat /etc/group | grep audio

On my system this gave, which didn't have my user

audio:x:29:pulse,pi

If necessary add yourself to the group using;

sudo usermod -G audio <username>

With the correct permissions the audio group can read the conf file, therefore its still necessary to use root to modify it.

Modify the mpd config to point to your music folder

sudo nano /etc/mpd.conf

find the line that begins music_directory "~/music" and alter the location in "".

For example

music_directory         "/home/jack/music"