1 <?xml version='1.0' encoding="utf-8"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "docbook/dtd/xml/4.2/docbookx.dtd">
5 <title>The Music Player Daemon - User's Manual</title>
8 <title>Introduction</title>
11 This document is work in progress. Most of it may be incomplete
16 MPD (Music Player Daemon) is, as the name suggests, a server
17 software allowing you to remotely play your music, handle
18 playlists, deliver music (HTTP STREAMS with various
19 sub-protocols) and organizze playlists.
23 It has been written with minimal resource usage and stability in
24 mind! Infact, it runs fine on a Pentium 75, allowing you to use
25 your cheap old PC to create a stereo system!
29 MPD supports also Gapless playback, buffered audio output, and
34 The separate client and server design allows users to choose a
35 user interface that best suites their tastes independently of
36 the underlying daemon, which actually plays music!
41 <title>Installation</title>
44 We recommend that you use the software installation routines of
45 your distribution to install MPD. Most operating systems have a
46 MPD package, which is very easy to install.
50 <title>Installing on Debian/Ubuntu</title>
53 Install the package <filename>mpd</filename> via APT:
56 <programlisting>apt-get install mpd</programlisting>
59 When installed this way, MPD by default looks for music in
60 /var/lib/mpd/music/; this may not be correct. Look at your
66 <title>Compiling from source</title>
69 Download the source tarball from <ulink
70 url="http://mpd.wikia.com/wiki/Server">the MPD home
71 page</ulink> and unpack it:
74 <programlisting>tar xjf mpd-version.tar.bz
75 cd mpd-version</programlisting>
78 Make sure that all the required libraries and build tools are
79 installed. The <filename>INSTALL</filename> file has a list.
83 Now configure the source tree:
86 <programlisting>./configure</programlisting>
89 The <parameter>--help</parameter> argument shows a list of
90 compile-time options. When everything is ready and
94 <programlisting>make</programlisting>
100 <programlisting>make install</programlisting>
105 <title>Configuration</title>
108 <title>Configuring the music directory</title>
111 When you play local files, you should organize them within a
112 directory called the "music directory". This is configured in
113 MPD with the <varname>music_directory</varname> setting.
117 By default, MPD follows symbolic links in the music directory.
118 This behavior can be switched off:
119 <varname>follow_outside_symlinks</varname> controls whether
120 MPD follows links pointing to files outside of the music
121 directory, and <varname>follow_inside_symlinks</varname> lets
122 you disable symlinks to files inside the music directory.
127 <title>Configuring input plugins</title>
130 To configure an input plugin, add a <varname>input</varname>
131 block to <filename>mpd.conf</filename>:
134 <programlisting>input {
142 The following table lists the <varname>input</varname> options
143 valid for all plugins:
161 <varname>plugin</varname>
164 The name of the plugin.
169 <varname>enabled</varname>
170 <parameter>yes|no</parameter>
173 Allows you to disable a input plugin without
174 recompiling. By default, all plugins are enabled.
183 <title>Configuring decoder plugins</title>
186 Most decoder plugins do not need any special configuration.
187 To configure a decoder, add a <varname>decoder</varname> block
188 to <filename>mpd.conf</filename>:
191 <programlisting>decoder {
193 config_file "/etc/timidity/timidity.cfg"
198 The following table lists the <varname>decoder</varname>
199 options valid for all plugins:
217 <varname>plugin</varname>
220 The name of the plugin.
225 <varname>enabled</varname>
226 <parameter>yes|no</parameter>
229 Allows you to disable a decoder plugin without
230 recompiling. By default, all plugins are enabled.
239 <title>Configuring audio outputs</title>
242 Audio outputs are devices which actually play the audio chunks
243 produced by MPD. You can configure any number of audio output
244 devices, but there must be at least one. If none is
245 configured, MPD attempts to auto-detect. Usually, this works
246 quite well with ALSA, OSS and on Mac OS X.
250 To configure an audio output manually, add an
251 <varname>audio_output</varname> block to
252 <filename>mpd.conf</filename>:
255 <programlisting>audio_output {
257 name "my ALSA device"
263 The following table lists the <varname>audio_output</varname>
264 options valid for all plugins:
282 <varname>type</varname>
285 The name of the plugin.
290 <varname>name</varname>
293 The name of the audio output. It is visible to the
294 client. Some plugins also use it internally, e.g. as
295 a name registered in the PULSE server.
300 <varname>format</varname>
304 Always open the audio output with the specified audio
305 format (samplerate:bits:channels), regardless of the
306 format of the input file. This is optional for most
310 Any of the three attributes may be an asterisk to
311 specify that this attribute should not be enforced,
312 example: <parameter>48000:16:*</parameter>.
313 <parameter>*:*:*</parameter> is equal to not having
314 a <varname>format</varname> specification.
317 The following values are valid for
318 <varname>bits</varname>: <varname>8</varname>
319 (signed 8 bit integer samples),
320 <varname>16</varname>, <varname>24</varname> (signed
321 24 bit integer samples padded to 32 bit),
322 <varname>24_3</varname> (signed 24 bit integer
323 samples, no padding, 3 bytes per sample),
324 <varname>32</varname> (signed 32 bit integer
331 <varname>enabled</varname>
332 <parameter>yes|no</parameter>
335 Specifies whether this audio output is enabled when
336 MPD is started. By default, all audio outputs are
342 <varname>always_on</varname>
343 <parameter>yes|no</parameter>
346 If set to "yes", then MPD attempts to keep this audio
347 output always open. This may be useful for streaming
348 servers, when you don't want to disconnect all
349 listeners even when playback is accidently stopped.
354 <varname>mixer_type</varname>
355 <parameter>hardware|software|none</parameter>
358 Specifies which mixer should be used for this audio
359 output: the hardware mixer (available for ALSA, OSS
360 and PulseAudio), the software mixer or no mixer
361 ("none"). By default, the hardware mixer is used for
362 devices which support it, and none for the others.
367 <varname>replay_gain_handler</varname>
368 <parameter>software|mixer|none</parameter>
371 Specifies how replay gain is applied. The default is
372 "software", which uses an internal software volume
373 control. "mixer" uses the configured (hardware) mixer
374 control. "none" disables replay gain on this audio
384 <title>Configuring filters</title>
387 Filters are plugins which modify an audio stream.
391 To configure a filter, add a <varname>filter</varname> block
392 to <filename>mpd.conf</filename>:
395 <programlisting>filter {
397 name "software volume"
402 The following table lists the <varname>filter</varname>
403 options valid for all plugins:
421 <varname>plugin</varname>
424 The name of the plugin.
429 <varname>name</varname>
432 The name of the filter.
441 <title>Configuring playlist plugins</title>
444 Playlist plugins are used to load remote playlists. This is
445 not related to MPD's playlist directory.
449 To configure a filter, add a
450 <varname>playlist_plugin</varname> block to
451 <filename>mpd.conf</filename>:
454 <programlisting>playlist_plugin {
461 The following table lists the
462 <varname>playlist_plugin</varname> options valid for all
481 <varname>name</varname>
484 The name of the plugin.
489 <varname>enabled</varname>
490 <parameter>yes|no</parameter>
493 Allows you to disable a input plugin without
494 recompiling. By default, all plugins are enabled.
504 <title>Using MPD</title>
507 <title>The client</title>
510 After you have installed, configured and started MPD, you
511 choose a client to control the playback.
515 The most basic client is <filename>mpc</filename>, which
516 provides a command line interface. It is useful in shell
517 scripts. Many people bind specific <filename>mpc</filename>
522 The <ulink url="http://mpd.wikia.com/wiki/Clients">MPD
523 Wiki</ulink> contains an extensive list of clients to choose
529 <title>The music directory and the database</title>
532 The "music directory" is where you store your music files.
533 MPD stores all relevant meta information about all songs in
534 its "database". Whenever you add, modify or remove songs in
535 the music directory, you have to update the database, for
536 example with <filename>mpc</filename>:
539 <programlisting>mpc update</programlisting>
542 Depending on the size of your music collection and the speed
543 of the storage, this can take a while.
547 To exclude a file from the update, create a file called
548 <filename>.mpdignore</filename> in its parent directory. Each
549 line of that file may contain a list of shell wildcards.
554 <title>The queue</title>
557 The queue (sometimes called "current playlist") is a list of
558 songs to be played by MPD. To play a song, add it to the
559 queue and start playback. Most clients offer an interface to
566 <title>Plugin reference</title>
569 <title>Input plugins</title>
572 <title><varname>curl</varname></title>
575 Opens remote files or streams over HTTP.
582 <entry>Setting</entry>
583 <entry>Description</entry>
589 <varname>proxy</varname>
592 Sets the address of the HTTP proxy server.
597 <varname>proxy_user</varname>,
598 <varname>proxy_password</varname>
601 Configures proxy authentication.
610 <title><varname>file</varname></title>
618 <title><varname>mms</varname></title>
621 Plays streams with the MMS protocol.
627 <title>Decoder plugins</title>
630 <title><varname>mikmod</varname></title>
633 Module player based on MikMod.
640 <entry>Setting</entry>
641 <entry>Description</entry>
647 <varname>sample_rate</varname>
650 Sets the sample rate generated by
651 <filename>libmikmod</filename>. Default is 44100.
661 <title>Output plugins</title>
664 <title><varname>alsa</varname></title>
667 The "Advanced Linux Sound Architecture" plugin uses
668 <filename>libasound</filename>. It is recommended if you
676 <entry>Setting</entry>
677 <entry>Description</entry>
683 <varname>device</varname>
684 <parameter>NAME</parameter>
687 Sets the device which should be used. This can be
688 any valid ALSA device name. The default value is
689 "default", which makes
690 <filename>libasound</filename> choose a device. It
691 is recommended to use a "hw" or "plughw" device,
692 because otherwise, <filename>libasound</filename>
693 automatically enables "dmix", which has major
694 disadvantages (fixed sample rate, poor resampler,
700 <varname>use_mmap</varname>
701 <parameter>yes|no</parameter>
704 If set to <parameter>yes</parameter>, then
705 <filename>libasound</filename> will try to use
711 <varname>buffer_time</varname>
712 <parameter>US</parameter>
715 Sets the device's buffer time in microseconds.
716 Don't change unless you know what you're doing.
721 <varname>period_time</varname>
722 <parameter>US</parameter>
725 Sets the device's period time in microseconds.
726 Don't change unless you really know what you're
732 <varname>auto_resample</varname>
733 <parameter>yes|no</parameter>
736 If set to <parameter>no</parameter>, then
737 <filename>libasound</filename> will not attempt to
738 resample, handing the responsibility over to MPD.
739 It is recommended to let MPD resample (with
740 libsamplerate), because ALSA is quite poor at doing
746 <varname>auto_channels</varname>
747 <parameter>yes|no</parameter>
750 If set to <parameter>no</parameter>, then
751 <filename>libasound</filename> will not attempt to
752 convert between different channel numbers.
757 <varname>auto_format</varname>
758 <parameter>yes|no</parameter>
761 If set to <parameter>no</parameter>, then
762 <filename>libasound</filename> will not attempt to
763 convert between different sample formats (16 bit, 24
764 bit, floating point, ...).
773 <title><varname>ao</varname></title>
776 The <varname>ao</varname> plugin uses the portable
777 <filename>libao</filename> library.
782 <title><varname>fifo</varname></title>
785 The <varname>fifo</varname> plugin writes raw PCM data to a
786 FIFO (First In, First Out) file. The data can be read by
792 <title><varname>jack</varname></title>
795 The <varname>jack</varname> plugin connects to a JACK
803 <entry>Setting</entry>
804 <entry>Description</entry>
810 <varname>client_name</varname>
811 <parameter>NAME</parameter>
814 The name of the JACK client. Defaults to "Music
820 <varname>server_name</varname>
821 <parameter>NAME</parameter>
824 Optional name of the JACK server.
829 <varname>autostart</varname>
830 <parameter>yes|no</parameter>
833 If set to <parameter>yes</parameter>, then
834 <filename>libjack</filename> will automatically
835 launch the JACK daemon. Disabled by default.
840 <varname>source_ports</varname>
841 <parameter>A,B</parameter>
844 The names of the JACK source ports to be created.
845 By default, the ports "left" and "right" are
846 created. To use more ports, you have to tweak this
852 <varname>destination_ports</varname>
853 <parameter>A,B</parameter>
856 The names of the JACK destination ports to connect to.
861 <varname>ringbuffer_size</varname>
862 <parameter>NBYTES</parameter>
865 Sets the size of the ring buffer for each channel.
866 Do not configure this value unless you know what
876 <title><varname>mvp</varname></title>
879 The <varname>mvp</varname> plugin uses the proprietary
880 Hauppauge Media MVP interface. We do not know any user of
881 this plugin, and we do not know if it actually works.
886 <title><varname>httpd</varname></title>
889 The <varname>httpd</varname> plugin creates a HTTP server,
890 similar to ShoutCast / IceCast. HTTP streaming clients like
891 <filename>mplayer</filename> can connect to it.
895 You must configure either <varname>quality</varname> or
896 <varname>bitrate</varname>. It is highly recommended to
897 configure a fixed <varname>format</varname>, because a
898 stream cannot switch its audio format on-the-fly when the
906 <entry>Setting</entry>
907 <entry>Description</entry>
913 <varname>port</varname>
914 <parameter>P</parameter>
917 Binds the HTTP server to the specified port (on all
923 <varname>encoder</varname>
924 <parameter>NAME</parameter>
927 Chooses an encoder plugin,
928 e.g. <parameter>vorbis</parameter>.
933 <varname>quality</varname>
934 <parameter>Q</parameter>
937 Configures the encoder quality (for VBR) in the
943 <varname>bitrate</varname>
944 <parameter>BR</parameter>
947 Sets a constant encoder bit rate, in kilobit per
953 <varname>max_clients</varname>
954 <parameter>MC</parameter>
957 Sets a limit, number of concurrent clients. When set
958 to 0 no limit will apply.
967 <title><varname>null</varname></title>
970 The <varname>null</varname> plugin does nothing. It
971 discards everything sent to it.
978 <entry>Setting</entry>
979 <entry>Description</entry>
985 <varname>sync</varname>
986 <parameter>yes|no</parameter>
989 If set to <parameter>no</parameter>, then the timer
990 is disabled - the device will accept PCM chunks at
991 arbitrary rate (useful for benchmarking). The
992 default behaviour is to play in real time.
1001 <title><varname>oss</varname></title>
1004 The "Open Sound System" plugin is supported on most Unix
1012 <entry>Setting</entry>
1013 <entry>Description</entry>
1019 <varname>device</varname>
1020 <parameter>PATH</parameter>
1023 Sets the path of the PCM device. If not specified,
1024 then MPD will attempt to open
1025 <filename>/dev/sound/dsp</filename> and
1026 <filename>/dev/dsp</filename>.
1035 <title><varname>openal</varname></title>
1038 The "OpenAL" plugin uses <filename>libopenal</filename>.
1039 It is supported on many platforms.
1046 <entry>Setting</entry>
1047 <entry>Description</entry>
1053 <varname>device</varname>
1054 <parameter>NAME</parameter>
1057 Sets the device which should be used. This can be
1058 any valid OpenAL device name. If not specified, then
1059 <filename>libopenal</filename> will choose a default device.
1068 <title><varname>osx</varname></title>
1071 The "Mac OS X" plugin uses Apple's CoreAudio API.
1076 <title><varname>pipe</varname></title>
1079 The <varname>pipe</varname> plugin starts a program and
1080 writes raw PCM data into its standard input.
1087 <entry>Setting</entry>
1088 <entry>Description</entry>
1094 <varname>command</varname>
1095 <parameter>CMD</parameter>
1098 This command is invoked with the shell.
1107 <title><varname>pulse</varname></title>
1110 The <varname>pulse</varname> plugin connects to a PulseAudio
1118 <entry>Setting</entry>
1119 <entry>Description</entry>
1125 <varname>server</varname>
1126 <parameter>HOSTNAME</parameter>
1129 Sets the host name of the PulseAudio server. By
1130 default, MPD connects to the local PulseAudio
1136 <varname>sink</varname>
1137 <parameter>NAME</parameter>
1140 Specifies the name of the PulseAudio sink MPD should
1150 <title><varname>recorder</varname></title>
1153 The <varname>recorder</varname> plugin writes the audio
1154 played by MPD to a file. This may be useful for recording
1159 You must configure either <varname>quality</varname> or
1160 <varname>bitrate</varname>.
1167 <entry>Setting</entry>
1168 <entry>Description</entry>
1174 <varname>path</varname>
1175 <parameter>P</parameter>
1183 <varname>encoder</varname>
1184 <parameter>NAME</parameter>
1187 Chooses an encoder plugin,
1188 e.g. <parameter>vorbis</parameter>.
1193 <varname>quality</varname>
1194 <parameter>Q</parameter>
1197 Configures the encoder quality (for VBR) in the
1203 <varname>bitrate</varname>
1204 <parameter>BR</parameter>
1207 Sets a constant encoder bit rate, in kilobit per
1217 <title><varname>shout</varname></title>
1220 The <varname>shout</varname> plugin connects to a ShoutCast
1221 or IceCast server. It forwards tags to this server.
1225 You must set a <varname>format</varname>.
1232 <entry>Setting</entry>
1233 <entry>Description</entry>
1239 <varname>host</varname>
1240 <parameter>HOSTNAME</parameter>
1243 Sets the host name of the Shoutcast/Icecast server.
1248 <varname>port</varname>
1249 <parameter>PORTNUMBER</parameter>
1252 Connect to this port number on the specified host.
1257 <varname>timeout</varname>
1258 <parameter>SECONDS</parameter>
1261 Set the timeout for the shout connection in seconds.
1262 Defaults to 2 seconds.
1267 <varname>mount</varname>
1268 <parameter>URI</parameter>
1271 Mounts the MPD stream in the specified URI.
1276 <varname>user</varname>
1277 <parameter>USERNAME</parameter>
1280 Sets the user name for submitting the stream to the
1281 server. Default is "source".
1286 <varname>password</varname>
1287 <parameter>PWD</parameter>
1290 Sets the password for submitting the stream to the
1296 <varname>name</varname>
1297 <parameter>NAME</parameter>
1300 Sets the name of the stream.
1305 <varname>genre</varname>
1306 <parameter>GENRE</parameter>
1309 Sets the genre of the stream (optional).
1314 <varname>description</varname>
1315 <parameter>DESCRIPTION</parameter>
1318 Sets a short description of the stream (optional).
1323 <varname>public</varname>
1324 <parameter>yes|no</parameter>
1327 Specifies whether the stream should be "public".
1333 <varname>encoder</varname>
1334 <parameter>PLUGIN</parameter>
1337 Sets the name of the encoder plugin. Default is
1338 "vorbis". "vorbis" and "lame" are valid encoder
1339 plugins (provided that you enabled them at compile
1349 <title><varname>solaris</varname></title>
1352 The "Solaris" plugin runs only on SUN Solaris, and plays via
1353 <filename>/dev/audio</filename>.
1360 <entry>Setting</entry>
1361 <entry>Description</entry>
1367 <varname>device</varname>
1368 <parameter>PATH</parameter>
1371 Sets the path of the audio device, defaults to
1372 <filename>/dev/audio</filename>.
1382 <title>Playlist plugins</title>
1385 <title><varname>lastfm</varname></title>
1388 Plays last.fm radio.
1395 <entry>Setting</entry>
1396 <entry>Description</entry>
1402 <varname>user</varname>
1403 <parameter>USERNAME</parameter>
1406 The last.fm user name.
1411 <varname>password</varname>
1412 <parameter>PWD</parameter>
1415 The last.fm password.
1424 <title><varname>m3u</varname></title>
1427 Reads <filename>.m3u</filename> playlist files.
1432 <title><varname>extm3u</varname></title>
1435 Reads extended <filename>.m3u</filename> playlist files.
1440 <title><varname>pls</varname></title>
1443 Reads <filename>.pls</filename> playlist files.
1448 <title><varname>xspf</varname></title>
1451 Reads <ulink url="http://www.xspf.org/">XSPF</ulink>