https://wiki.archlinux.org/api.php?action=feedcontributions&user=AdamGernhard&feedformat=atomArchWiki - User contributions [en]2024-03-28T14:58:41ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=274153Music Player Daemon2013-09-02T17:30:19Z<p>AdamGernhard: /* See also */ Added the MPD User Manual</p>
<hr />
<div>[[Category:Player]]<br />
[[de:Music Player Daemon]]<br />
[[es:Music Player Daemon]]<br />
[[fr:MPD]]<br />
[[it:Music Player Daemon]]<br />
[[nl:Music Player Daemon]]<br />
[[pl:Music Player Daemon]]<br />
[[ru:Music Player Daemon]]<br />
[[sr:Music Player Daemon]]<br />
[[tr:Music_Player_Daemon]]<br />
[[zh-CN:Music Player Daemon]]<br />
{{Article summary start}}<br />
{{Article summary text|Installation, configuration and basic troubleshooting of MPD.}}<br />
{{Article summary heading|Related Articles}}<br />
{{Article summary wiki|MPD/Tips and Tricks}}<br />
{{Article summary wiki|MPD/Troubleshooting}}<br />
{{Article summary heading|Other sources}}<br />
{{Article summary text|[[Wikipedia:Music Player Daemon|Wikipedia article]]}}<br />
{{Article summary end}}<br />
<br />
'''[http://www.musicpd.org/ MPD]''' ('''m'''usic '''p'''layer '''d'''aemon) is an audio player that has a server-client architecture. It plays audio files, organizes playlists and maintains a music database all while using very few resources. In order to interface with it, a separate [[#Clients|client]] is needed.<br />
<br />
== Installation ==<br />
<br />
The latest stable version of {{Pkg|mpd}} is available in the [[official repositories]].<br />
<br />
Should users wish to run an experimental version, the [[AUR]] offers several from which to choose. For example, {{AUR|mpd-git}}.<br />
<br />
== Setup ==<br />
<br />
MPD is able to run locally (per user settings), globally (settings apply to all users), and in multiple instances. The way of setting up mpd depends on the way it is intended to be used: a local configuration may prove more useful on a desktop system, for example.<br />
<br />
For a proper MPD operation these are the necessary files and directories:<br />
<br />
* database - The music database<br />
* pid - The file where mpd stores its process ID<br />
* log - MPD logs here<br />
* state - MPD's current state is noted here<br />
* playlists - The folder where playlists are saved into<br />
* sticker.sql - The sticker database<br />
<br />
In order for MPD to be able to play back audio, [[ALSA]], [[PulseAudio]] or [[OSS]] needs to be setup and working.<br />
<br />
=== Local configuration (per user) ===<br />
<br />
MPD can be configured per user (rather than the typical method of configuring MPD globally). Running MPD as a normal user has the benefits of:<br />
<br />
* A single directory {{ic|~/.mpd}} (or any other directory under {{ic|/home/$USER/}}) that will contain all the MPD configuration files.<br />
* Easier to avoid unforeseen read/write permission errors.<br />
<br />
To setup: create a directory for the required files and the playlists; copy the example configuration locally; create all of the requisite files:<br />
<br />
$ mkdir -p ~/.mpd/playlists<br />
$ cp /usr/share/doc/mpd/mpdconf.example ~/.mpdconf<br />
$ touch ~/.mpd/{database,log,state,pid,sticker.sql}<br />
<br />
Edit {{ic|~/.mpdconf}} and specify the requisite files:<br />
<br />
{{hc|~/.mpdconf|<br />
music_directory "~/music" # Can keep commented if XDG music dir.<br />
playlist_directory "~/.mpd/playlists"<br />
db_file "~/.mpd/database"<br />
log_file "~/.mpd/log"<br />
pid_file "~/.mpd/pid"<br />
state_file "~/.mpd/state"<br />
sticker_file "~/.mpd/sticker.sql"<br />
}}<br />
<br />
MPD can now be started by typing {{ic|mpd}} on the command line (mpd first searches for {{ic|~/.mpdconf}}, then {{ic|~/etc/mpd.conf}} [there is no support for XDG-config directory {{ic|~/.config/mpd/mpd.conf}}]). To specify the location of the configuration file :<br />
<br />
mpd /path/to/mpd.conf<br />
<br />
To start MPD on login add to {{ic|~/.profile}} (or another [[Autostarting#Shells|Autostart file]]):<br />
<br />
# MPD daemon start (if no other user instance exists)<br />
[ ! -s ~/.mpd/pid ] && mpd<br />
<br />
To start with the X.org server add to either [[xprofile]] or [[xinitrc]]. Some DEs ignore these files (GNOME does) and a desktop file must be placed in {{ic|~/.config/autostart/mpd.desktop}}:<br />
<br />
{{bc|<nowiki><br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=Music Player Daemon<br />
Comment=Server for playing audio files<br />
Exec=mpd<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=false<br />
</nowiki>}}<br />
<br />
==== Autostart with systemd ====<br />
<br />
{{Note|It is assumed that you already have systemd user-session manager running. See the [[systemd/User]] page for details.}}<br />
<br />
The package {{Pkg|mpd}} provides user service file in {{ic|/usr/lib/systemd/user/mpd.service}}. Though it is a symlink to {{ic|/usr/lib/systemd/system/mpd.service}}, the difference is that the process is not started as root. The configuration file {{ic|~/.mpdconf}} is expected to exist (otherwise the global {{ic|/etc/mpd.conf}} is used). You should not use the {{ic|user}} and {{ic|group}} variables in the configuration file.<br />
<br />
{{Tip|If you don't like the configuration file being in {{ic|~/.mpdconf}}, copy {{ic|/usr/lib/systemd/system/mpd.service}} to {{ic|~/.config/systemd/user/mpd.service}} and edit it to contain the path of your configuration file:<br />
{{hc|~/.config/systemd/user/mpd.service|2=<br />
...<br />
ExecStart=/usr/bin/mpd --no-daemon /path/to/your/mpd.conf<br />
...<br />
}}}}<br />
<br />
All you have to do is enable and start the user service:<br />
<br />
$ systemctl --user enable mpd<br />
$ systemctl --user start mpd<br />
<br />
{{Note|Also make sure to disable every other method of starting mpd you used before.}}<br />
<br />
==== Scripted configuration ====<br />
<br />
Rasi has written a script that will create the proper directory structure, configuration files and prompt for the location of the user's Music directory; it can be downloaded [http://53280.de/dl/mpdsetup.sh here].<br />
<br />
=== Global configuration ===<br />
<br />
{{Warning|Users of PulseAudio with a local mpd have to implement a [[Music Player Daemon/Tips and Tricks#Local (with separate mpd user)|workaround]] in order to run mpd as its own user!}}<br />
<br />
The default Arch install keeps the setup in {{ic|/var/lib/mpd}} and uses ''mpd'' as default user.<br />
<br />
Edit {{ic|/etc/mpd.conf}} to reflect as such:<br />
{{hc|/etc/mpd.conf|<br />
music_directory "/path/to/music/dir"<br />
playlist_directory "/var/lib/mpd/playlists"<br />
db_file "/var/lib/mpd/mpd.db"<br />
log_file "syslog"<br />
pid_file "/run/mpd/mpd.pid"<br />
state_file "/var/lib/mpd/mpdstate"<br />
user "mpd"<br />
}}<br />
<br />
We just configured MPD to run as the ''mpd'' user, but {{ic|/var/lib/mpd}} is owned by ''root'' by default, we need to change this so ''mpd'' can write here:<br />
# chown -R mpd /var/lib/mpd<br />
<br />
==== Music directory ====<br />
<br />
MPD needs to have {{ic|+x}} permissions on ''all'' parent directories to the music collection (ie. if it's located outside of {{ic|/var/lib/mpd}}). Thus users will most likely need to remount the music directory under a directory that mpd has access to -- this only applies if running as the 'mpd' user.<br />
<br />
# mkdir /var/lib/mpd/music<br />
# echo "/path/to/music/dir /var/lib/mpd/music none bind" >> /etc/fstab<br />
# mount -a<br />
Also see [https://bbs.archlinux.org/viewtopic.php?id=86449 this forum thread].<br />
<br />
An additional solution would be to just create a symbolic link into {{ic|/var/lib/mpd/music}}.<br />
# mkdir /var/lib/mpd/music<br />
# ln -s /path/to/music/dir /var/lib/mpd/music/<br />
<br />
If the music collection is contained under multiple directories, create symbolic links under the main music directory in {{ic|/var/lib/mpd}}. Remember to set permissions accordingly on the directories being linked.<br />
<br />
==== Start MPD ====<br />
<br />
MPD can be controlled with the ''mpd'' [[daemon]]. The first startup can take some time as MPD will scan your music directory.<br />
<br />
Test everything by starting a client application ({{Pkg|ncmpc}} is a light and easy to use client), and play some music!<br />
<br />
==== Configure audio ====<br />
<br />
To change the volume for mpd independent from other programs, uncomment or add this switch in mpd.conf:<br />
{{hc|/etc/mpd.conf|<br />
mixer_type "software"<br />
}}<br />
<br />
Users of [[ALSA]] will want to have the following device definition, which allows software volume control in the MPD client to control the volume separately from other applications.<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "alsa"<br />
name "My Sound Card"<br />
mixer_type "software" # optional<br />
}<br />
}}<br />
<br />
Users of [[PulseAudio]] will need to make the following modification:<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "pulse"<br />
name "pulse audio"<br />
}<br />
}}<br />
<br />
==== Changing user ====<br />
<br />
{{Note|This is only required if you change the user!}}<br />
Changing the group that MPD runs as may result in errors like "output: Failed to open "My ALSA Device"" "[alsa]: Failed to open ALSA device "default": No such file or directory" "player_thread: problems opening audio device while playing "Song Name.mp3""<br />
<br />
This is because by default MPD runs as member of '''audio''' group and the sound devices under {{Ic|/dev/snd/}} are owned by this group, so add user {{Ic|mpd}} to group {{Ic|audio}}:<br />
# gpasswd -a mpd audio<br />
<br />
==== Timeline of MPD startup ====<br />
<br />
To depict when MPD drops its superuser privileges and assumes those of the user set in the configuration, the timeline of a normal MPD startup is listed here:<br />
<br />
# Since MPD is started as root by systemd, it first reads the {{ic|/etc/mpd.conf}} file.<br />
# MPD reads the user variable in the {{ic|/etc/mpd.conf}} file, and changes from root to this user.<br />
# MPD then reads the contents of the {{ic|/etc/mpd.conf}} file and configures itself accordingly.<br />
<br />
Notice that MPD changes the running user from root to the one named in the {{ic|/etc/mpd.conf}} file. <br />
This way, uses of {{ic|~}} in the configuration file point correctly to the home user's directory, and not root's directory. <br />
It may be worthwhile to change all uses of {{ic|~}} to {{ic|/home/username}} to avoid any confusion over this aspect of MPD's behavior.<br />
<br />
=== Multi-mpd setup ===<br />
<br />
'''Useful if running an icecast server.'''<br />
<br />
For a second MPD (e.g., with icecast output to share music over the network) using the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., {{ic|/home/username/.mpd/config-icecast}}), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., {{ic|mpd-icecast.log}}, {{ic|mpd-icecast.error}}, and so on); using the same directory paths for the music and playlist directories would ensure that this second mpd would use the same music collection as the first one e.g., creating and editing a playlist under the first daemon would affect the second daemon as well. Users do not have to create the same playlists all over again for the second daemon. Call this second daemon the same way from {{ic|~/.xinitrc}} above. (Just be sure to have a different port number, so as to not conflict with the first mpd daemon).<br />
<br />
== Clients ==<br />
<br />
A separate client is needed to control mpd. See a long list of clients at the [http://mpd.wikia.com/wiki/Clients mpd wiki]. Popular options are:<br />
<br />
=== Console ===<br />
<br />
*{{App|mpc|Simple KISS client. All basic functionality available|http://mpd.wikia.com/wiki/Client:Mpc|{{Pkg|mpc}}}}<br />
*{{App|ncmpc|Ncurses client for mpd|http://mpd.wikia.com/wiki/Client:Ncmpc|{{Pkg|ncmpc}}}}<br />
*{{App|[[ncmpcpp]]|Almost exact clone of ncmpc with some new features written in C++ (tag editor, search engine)|http://unkart.ovh.org/ncmpcpp/|{{Pkg|ncmpcpp}}}}<br />
*{{App|pms|Highly configurable and accessible ncurses client|http://pms.sourceforge.net/|{{AUR|pmus}}}}<br />
*{{App|vimpc|Ncurses based MPD client with vi-like key bindings|http://sourceforge.net/projects/vimpc/|{{AUR|vimpc}}}}<br />
<br />
=== Graphical ===<br />
<br />
*{{App|Ario|Very feature-rich GTK2 GUI client for mpd, inspired by Rhythmbox|http://ario-player.sourceforge.net/|{{Pkg|ario}}}}<br />
*{{App|QmpdClient|GUI client written with Qt 4.x|http://bitcheese.net/wiki/QMPDClient|{{Pkg|qmpdclient}}}}<br />
*{{App|Sonata|Elegant Python GTK+ client|http://sonata.berlios.de/|{{Pkg|sonata}}}}<br />
*{{App|gmpc|GTK2 frontend for Music Player Daemon. It is designed to be lightweight and easy to use, while providing full access to all of MPD's features. Users are presented with several different methods to browse through their music. It can be extended by plugins, of which many are available.|http://gmpc.wikia.com/wiki/Gnome_Music_Player_Client|{{Pkg|gmpc}}}}<br />
*{{App|Dmpc|Dmenu-based MPC client with a playlist manager and state-saving on playlist changes|http://wintervenom.mine.nu/|{{AUR|dmpc}}}}<br />
*{{App|Cantata|High-feature, Qt4/KDE4 client for MPD with very configurable interface|https://code.google.com/p/cantata/|{{AUR|cantata-qt}}}}<br />
<br />
=== Web ===<br />
<br />
*{{App|Patchfork|Web client for MPD written in PHP and Ajax|http://mpd.wikia.com/wiki/Client:Pitchfork|{{AUR|patchfork-git}}}}.<br />
<br />
== See also ==<br />
<br />
* [http://forum.musicpd.org/ MPD Forum]<br />
* [http://www.musicpd.org/doc/user/ MPD User Manual]</div>AdamGernhardhttps://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=274152Music Player Daemon2013-09-02T17:26:23Z<p>AdamGernhard: /* See also */ Updated the URL for the MPD forum</p>
<hr />
<div>[[Category:Player]]<br />
[[de:Music Player Daemon]]<br />
[[es:Music Player Daemon]]<br />
[[fr:MPD]]<br />
[[it:Music Player Daemon]]<br />
[[nl:Music Player Daemon]]<br />
[[pl:Music Player Daemon]]<br />
[[ru:Music Player Daemon]]<br />
[[sr:Music Player Daemon]]<br />
[[tr:Music_Player_Daemon]]<br />
[[zh-CN:Music Player Daemon]]<br />
{{Article summary start}}<br />
{{Article summary text|Installation, configuration and basic troubleshooting of MPD.}}<br />
{{Article summary heading|Related Articles}}<br />
{{Article summary wiki|MPD/Tips and Tricks}}<br />
{{Article summary wiki|MPD/Troubleshooting}}<br />
{{Article summary heading|Other sources}}<br />
{{Article summary text|[[Wikipedia:Music Player Daemon|Wikipedia article]]}}<br />
{{Article summary end}}<br />
<br />
'''[http://www.musicpd.org/ MPD]''' ('''m'''usic '''p'''layer '''d'''aemon) is an audio player that has a server-client architecture. It plays audio files, organizes playlists and maintains a music database all while using very few resources. In order to interface with it, a separate [[#Clients|client]] is needed.<br />
<br />
== Installation ==<br />
<br />
The latest stable version of {{Pkg|mpd}} is available in the [[official repositories]].<br />
<br />
Should users wish to run an experimental version, the [[AUR]] offers several from which to choose. For example, {{AUR|mpd-git}}.<br />
<br />
== Setup ==<br />
<br />
MPD is able to run locally (per user settings), globally (settings apply to all users), and in multiple instances. The way of setting up mpd depends on the way it is intended to be used: a local configuration may prove more useful on a desktop system, for example.<br />
<br />
For a proper MPD operation these are the necessary files and directories:<br />
<br />
* database - The music database<br />
* pid - The file where mpd stores its process ID<br />
* log - MPD logs here<br />
* state - MPD's current state is noted here<br />
* playlists - The folder where playlists are saved into<br />
* sticker.sql - The sticker database<br />
<br />
In order for MPD to be able to play back audio, [[ALSA]], [[PulseAudio]] or [[OSS]] needs to be setup and working.<br />
<br />
=== Local configuration (per user) ===<br />
<br />
MPD can be configured per user (rather than the typical method of configuring MPD globally). Running MPD as a normal user has the benefits of:<br />
<br />
* A single directory {{ic|~/.mpd}} (or any other directory under {{ic|/home/$USER/}}) that will contain all the MPD configuration files.<br />
* Easier to avoid unforeseen read/write permission errors.<br />
<br />
To setup: create a directory for the required files and the playlists; copy the example configuration locally; create all of the requisite files:<br />
<br />
$ mkdir -p ~/.mpd/playlists<br />
$ cp /usr/share/doc/mpd/mpdconf.example ~/.mpdconf<br />
$ touch ~/.mpd/{database,log,state,pid,sticker.sql}<br />
<br />
Edit {{ic|~/.mpdconf}} and specify the requisite files:<br />
<br />
{{hc|~/.mpdconf|<br />
music_directory "~/music" # Can keep commented if XDG music dir.<br />
playlist_directory "~/.mpd/playlists"<br />
db_file "~/.mpd/database"<br />
log_file "~/.mpd/log"<br />
pid_file "~/.mpd/pid"<br />
state_file "~/.mpd/state"<br />
sticker_file "~/.mpd/sticker.sql"<br />
}}<br />
<br />
MPD can now be started by typing {{ic|mpd}} on the command line (mpd first searches for {{ic|~/.mpdconf}}, then {{ic|~/etc/mpd.conf}} [there is no support for XDG-config directory {{ic|~/.config/mpd/mpd.conf}}]). To specify the location of the configuration file :<br />
<br />
mpd /path/to/mpd.conf<br />
<br />
To start MPD on login add to {{ic|~/.profile}} (or another [[Autostarting#Shells|Autostart file]]):<br />
<br />
# MPD daemon start (if no other user instance exists)<br />
[ ! -s ~/.mpd/pid ] && mpd<br />
<br />
To start with the X.org server add to either [[xprofile]] or [[xinitrc]]. Some DEs ignore these files (GNOME does) and a desktop file must be placed in {{ic|~/.config/autostart/mpd.desktop}}:<br />
<br />
{{bc|<nowiki><br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Type=Application<br />
Name=Music Player Daemon<br />
Comment=Server for playing audio files<br />
Exec=mpd<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
X-GNOME-Autostart-enabled=false<br />
</nowiki>}}<br />
<br />
==== Autostart with systemd ====<br />
<br />
{{Note|It is assumed that you already have systemd user-session manager running. See the [[systemd/User]] page for details.}}<br />
<br />
The package {{Pkg|mpd}} provides user service file in {{ic|/usr/lib/systemd/user/mpd.service}}. Though it is a symlink to {{ic|/usr/lib/systemd/system/mpd.service}}, the difference is that the process is not started as root. The configuration file {{ic|~/.mpdconf}} is expected to exist (otherwise the global {{ic|/etc/mpd.conf}} is used). You should not use the {{ic|user}} and {{ic|group}} variables in the configuration file.<br />
<br />
{{Tip|If you don't like the configuration file being in {{ic|~/.mpdconf}}, copy {{ic|/usr/lib/systemd/system/mpd.service}} to {{ic|~/.config/systemd/user/mpd.service}} and edit it to contain the path of your configuration file:<br />
{{hc|~/.config/systemd/user/mpd.service|2=<br />
...<br />
ExecStart=/usr/bin/mpd --no-daemon /path/to/your/mpd.conf<br />
...<br />
}}}}<br />
<br />
All you have to do is enable and start the user service:<br />
<br />
$ systemctl --user enable mpd<br />
$ systemctl --user start mpd<br />
<br />
{{Note|Also make sure to disable every other method of starting mpd you used before.}}<br />
<br />
==== Scripted configuration ====<br />
<br />
Rasi has written a script that will create the proper directory structure, configuration files and prompt for the location of the user's Music directory; it can be downloaded [http://53280.de/dl/mpdsetup.sh here].<br />
<br />
=== Global configuration ===<br />
<br />
{{Warning|Users of PulseAudio with a local mpd have to implement a [[Music Player Daemon/Tips and Tricks#Local (with separate mpd user)|workaround]] in order to run mpd as its own user!}}<br />
<br />
The default Arch install keeps the setup in {{ic|/var/lib/mpd}} and uses ''mpd'' as default user.<br />
<br />
Edit {{ic|/etc/mpd.conf}} to reflect as such:<br />
{{hc|/etc/mpd.conf|<br />
music_directory "/path/to/music/dir"<br />
playlist_directory "/var/lib/mpd/playlists"<br />
db_file "/var/lib/mpd/mpd.db"<br />
log_file "syslog"<br />
pid_file "/run/mpd/mpd.pid"<br />
state_file "/var/lib/mpd/mpdstate"<br />
user "mpd"<br />
}}<br />
<br />
We just configured MPD to run as the ''mpd'' user, but {{ic|/var/lib/mpd}} is owned by ''root'' by default, we need to change this so ''mpd'' can write here:<br />
# chown -R mpd /var/lib/mpd<br />
<br />
==== Music directory ====<br />
<br />
MPD needs to have {{ic|+x}} permissions on ''all'' parent directories to the music collection (ie. if it's located outside of {{ic|/var/lib/mpd}}). Thus users will most likely need to remount the music directory under a directory that mpd has access to -- this only applies if running as the 'mpd' user.<br />
<br />
# mkdir /var/lib/mpd/music<br />
# echo "/path/to/music/dir /var/lib/mpd/music none bind" >> /etc/fstab<br />
# mount -a<br />
Also see [https://bbs.archlinux.org/viewtopic.php?id=86449 this forum thread].<br />
<br />
An additional solution would be to just create a symbolic link into {{ic|/var/lib/mpd/music}}.<br />
# mkdir /var/lib/mpd/music<br />
# ln -s /path/to/music/dir /var/lib/mpd/music/<br />
<br />
If the music collection is contained under multiple directories, create symbolic links under the main music directory in {{ic|/var/lib/mpd}}. Remember to set permissions accordingly on the directories being linked.<br />
<br />
==== Start MPD ====<br />
<br />
MPD can be controlled with the ''mpd'' [[daemon]]. The first startup can take some time as MPD will scan your music directory.<br />
<br />
Test everything by starting a client application ({{Pkg|ncmpc}} is a light and easy to use client), and play some music!<br />
<br />
==== Configure audio ====<br />
<br />
To change the volume for mpd independent from other programs, uncomment or add this switch in mpd.conf:<br />
{{hc|/etc/mpd.conf|<br />
mixer_type "software"<br />
}}<br />
<br />
Users of [[ALSA]] will want to have the following device definition, which allows software volume control in the MPD client to control the volume separately from other applications.<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "alsa"<br />
name "My Sound Card"<br />
mixer_type "software" # optional<br />
}<br />
}}<br />
<br />
Users of [[PulseAudio]] will need to make the following modification:<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "pulse"<br />
name "pulse audio"<br />
}<br />
}}<br />
<br />
==== Changing user ====<br />
<br />
{{Note|This is only required if you change the user!}}<br />
Changing the group that MPD runs as may result in errors like "output: Failed to open "My ALSA Device"" "[alsa]: Failed to open ALSA device "default": No such file or directory" "player_thread: problems opening audio device while playing "Song Name.mp3""<br />
<br />
This is because by default MPD runs as member of '''audio''' group and the sound devices under {{Ic|/dev/snd/}} are owned by this group, so add user {{Ic|mpd}} to group {{Ic|audio}}:<br />
# gpasswd -a mpd audio<br />
<br />
==== Timeline of MPD startup ====<br />
<br />
To depict when MPD drops its superuser privileges and assumes those of the user set in the configuration, the timeline of a normal MPD startup is listed here:<br />
<br />
# Since MPD is started as root by systemd, it first reads the {{ic|/etc/mpd.conf}} file.<br />
# MPD reads the user variable in the {{ic|/etc/mpd.conf}} file, and changes from root to this user.<br />
# MPD then reads the contents of the {{ic|/etc/mpd.conf}} file and configures itself accordingly.<br />
<br />
Notice that MPD changes the running user from root to the one named in the {{ic|/etc/mpd.conf}} file. <br />
This way, uses of {{ic|~}} in the configuration file point correctly to the home user's directory, and not root's directory. <br />
It may be worthwhile to change all uses of {{ic|~}} to {{ic|/home/username}} to avoid any confusion over this aspect of MPD's behavior.<br />
<br />
=== Multi-mpd setup ===<br />
<br />
'''Useful if running an icecast server.'''<br />
<br />
For a second MPD (e.g., with icecast output to share music over the network) using the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., {{ic|/home/username/.mpd/config-icecast}}), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., {{ic|mpd-icecast.log}}, {{ic|mpd-icecast.error}}, and so on); using the same directory paths for the music and playlist directories would ensure that this second mpd would use the same music collection as the first one e.g., creating and editing a playlist under the first daemon would affect the second daemon as well. Users do not have to create the same playlists all over again for the second daemon. Call this second daemon the same way from {{ic|~/.xinitrc}} above. (Just be sure to have a different port number, so as to not conflict with the first mpd daemon).<br />
<br />
== Clients ==<br />
<br />
A separate client is needed to control mpd. See a long list of clients at the [http://mpd.wikia.com/wiki/Clients mpd wiki]. Popular options are:<br />
<br />
=== Console ===<br />
<br />
*{{App|mpc|Simple KISS client. All basic functionality available|http://mpd.wikia.com/wiki/Client:Mpc|{{Pkg|mpc}}}}<br />
*{{App|ncmpc|Ncurses client for mpd|http://mpd.wikia.com/wiki/Client:Ncmpc|{{Pkg|ncmpc}}}}<br />
*{{App|[[ncmpcpp]]|Almost exact clone of ncmpc with some new features written in C++ (tag editor, search engine)|http://unkart.ovh.org/ncmpcpp/|{{Pkg|ncmpcpp}}}}<br />
*{{App|pms|Highly configurable and accessible ncurses client|http://pms.sourceforge.net/|{{AUR|pmus}}}}<br />
*{{App|vimpc|Ncurses based MPD client with vi-like key bindings|http://sourceforge.net/projects/vimpc/|{{AUR|vimpc}}}}<br />
<br />
=== Graphical ===<br />
<br />
*{{App|Ario|Very feature-rich GTK2 GUI client for mpd, inspired by Rhythmbox|http://ario-player.sourceforge.net/|{{Pkg|ario}}}}<br />
*{{App|QmpdClient|GUI client written with Qt 4.x|http://bitcheese.net/wiki/QMPDClient|{{Pkg|qmpdclient}}}}<br />
*{{App|Sonata|Elegant Python GTK+ client|http://sonata.berlios.de/|{{Pkg|sonata}}}}<br />
*{{App|gmpc|GTK2 frontend for Music Player Daemon. It is designed to be lightweight and easy to use, while providing full access to all of MPD's features. Users are presented with several different methods to browse through their music. It can be extended by plugins, of which many are available.|http://gmpc.wikia.com/wiki/Gnome_Music_Player_Client|{{Pkg|gmpc}}}}<br />
*{{App|Dmpc|Dmenu-based MPC client with a playlist manager and state-saving on playlist changes|http://wintervenom.mine.nu/|{{AUR|dmpc}}}}<br />
*{{App|Cantata|High-feature, Qt4/KDE4 client for MPD with very configurable interface|https://code.google.com/p/cantata/|{{AUR|cantata-qt}}}}<br />
<br />
=== Web ===<br />
<br />
*{{App|Patchfork|Web client for MPD written in PHP and Ajax|http://mpd.wikia.com/wiki/Client:Pitchfork|{{AUR|patchfork-git}}}}.<br />
<br />
== See also ==<br />
<br />
* [http://forum.musicpd.org// MPD forum]</div>AdamGernhard