Chris Spiegel | 13 Feb 06:22 2016

Pull request to support OptimFROG files

I've created a plugin for the OptimFROG file format
(  It's available in the branch called
optimfrog in my repository:
mpd-devel mailing list
mpd-devel <at>
Chris Spiegel | 13 Feb 06:15 2016

Pull request to support TAK files

In my git repository:

I've created a branch called tak which adds support for the TAK file
format ( to the FFmpeg plugin.  FFmpeg
already has TAK support, so it was a trivial matter of adding the
extension to the list.
mpd-devel mailing list
mpd-devel <at>
Gavin Kistner | 12 Feb 18:34 2016

idle stored_playlist does not notice filesystem changes

Using the "idle stored_playlist" command works fine when MPD is used to modify a playlist file. However, idle does not notice if the playlist file is edited by a non-MPD source.

Is there a .conf setting (similar to "auto_update" for the music_directory) that can allow MPD to notice when a playlist file is touched? If there is no such setting, is there a good reason not to add one?
-- (-, /\ \/ / /\/
mpd-devel mailing list
mpd-devel <at>
Thomas Petazzoni | 7 Feb 22:11 2016

[PATCH] check if libatomic is needed

The mpd source code uses the C++11 <atomic> functionality, which
internally is implemented using the __atomic_*() gcc built-ins. On
certain architectures, the __atomic_*() built-ins are implemented in
the libatomic library that comes with the rest of the gcc runtime. Due
to this, code using <atomic> might need to link against libatomic,
otherwise one hits build issues such as:

GlobalEvents.cxx:(.text._ZN12GlobalEvents4EmitENS_5EventE+0x14): undefined reference to `__atomic_fetch_or_4'

on an architecture like SPARC.

To solve this, a check is added to know if we need to
link against libatomic or not.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni <at>>
--- | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ b/
index 107b45a..8e6fab7 100644
--- a/
+++ b/
 <at>  <at>  -233,6 +233,8  <at>  <at>  if test x$have_pthread_setname_np = xyes; then
 	AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [Is pthread_setname_np() available?])

+AC_SEARCH_LIBS([__atomic_load_4], [atomic])
 dnl ---------------------------------------------------------------------------
 dnl Event loop selection
 dnl ---------------------------------------------------------------------------


mpd-devel mailing list
mpd-devel <at>
richard lucassen | 27 Dec 18:42 2015

mpd hangs, kill -9 necessary

Hello list,

I run Debian Wheezy with native mpd-0.16.7-2. This has worked fine for
a few years as long as I do not choose a radiostream that is broken. In that case
I need to -SIGKILL mpd. This afternoon I compiled a
vanilla 0.19.12 and the reproducible problem is still there:

Step 1: download the m3u list to the playlist dir, it's this particular playlist:

Step 2: remove the state file:

# rm -f /var/run/mpd/state (this is what I use)
removed `/var/run/mpd/state'

Step 3: start the daemon:

~/mpd/mpd-0.19.12/src>./mpd --no-daemon --stderr --verbose /etc/mpd.conf
config_file: loading file /etc/mpd.conf
server_socket: bind to '' failed: Address already in use (continuing anyway, because
binding to '[::]:6600' succeeded)
path: SetFSCharset: fs charset is: UTF-8
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.2
opus: libopus 0.9.14
sndfile: libsndfile-1.0.25
db: reading DB
curl: version 7.26.0
curl: with GnuTLS/2.12.20
state_file: Loading state file /var/run/mpd/state
errno: Failed to open /var/run/mpd/state: No such file or directory

Step 4:
$ mpc load web

client: [0] opened from
client: [0] process command list
client: process command "load "web""
client: command returned 0
client: [0] process command list returned 0
client: [0] closed

Step 5:
$ mpc play 1 (this works):

client: [1] process command "status"
client: [1] command returned 0
client: [1] process command "play "0""
playlist: play 0:""
client: [1] command returned 0
playlist: queue song 1:""
client: [1] process command list
client: process command "status"
client: command returned 0
client: process command "currentsong"
client: command returned 0
client: [1] process command list returned 0
client: [1] closed
decoder_thread: probing plugin vorbis
decoder: audio_format=48000:f:2, seekable=false
alsa_output: opened default type=PLUG
alsa_output: format=FLOAT_LE (Float 32 bit Little Endian)
alsa_output: buffer: size=26..131072 time=541..2730667
alsa_output: period: size=13..65536 time=270..1365334
alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
alsa_output: buffer_size=24000 period_size=6000
output: opened plugin=alsa name="ALSA1" audio_format=48000:f:2
state_file: Saving state file /var/run/mpd/state

Step 6:
Now, load entry 7 (which does not work, it generates a 404), then mpd skips to the next entry (which doesn't
work either) and now mpd hangs:

client: [2] opened from
client: [2] process command "status"
client: [2] command returned 0
client: [2] process command "play "6""
playlist: play 6:""
player: played ""
client: [2] command returned 0
playlist: queue song 7:"mmsh://"
client: [2] process command list
client: process command "status"
client: command returned 0
client: process command "currentsong"
client: command returned 0
client: [2] process command list returned 0
client: [2] closed
curl: curl failed: The requested URL returned error: 404
player: played ""
playlist: play 7:"mmsh://"
playlist: queue song 8:""

It will somehow react to a command, like "next":

client: [1] opened from
client: [1] process command "next"
playlist: play 8:""

$ mpc next
error: Timeout

Now mpd hangs:

# strace -f -p 16906
Process 16906 attached with 6 threads - interrupt to quit
[pid 16912] read(10,  <unfinished ...>
[pid 16910] futex(0x8b39e60, FUTEX_WAIT_PRIVATE, 9, NULL <unfinished ...>
[pid 16909] futex(0xb2a25bd8, FUTEX_WAIT, 16912, NULL <unfinished ...>
[pid 16908] futex(0x8b2988c, FUTEX_WAIT_PRIVATE, 293, NULL <unfinished ...>
[pid 16907] clock_gettime(CLOCK_MONOTONIC, {26813, 616325802}) = 0
[pid 16907] clock_gettime(CLOCK_MONOTONIC, {26813, 616946386}) = 0
[pid 16907] epoll_wait(4,  <unfinished ...>
[pid 16906] futex(0x8b298bc, FUTEX_WAIT_PRIVATE, 33, NULL

Only a -SIGKILL will stop mpd.

Is this reproducable for you as well?



server_socket: bind to '' failed: Address already in use (continuing anyway, because
binding to '[::]:6600' succeeded)

I have seen this every time mpd starts, but mpd sees this I suppose: 
tcp6       1      1   LAST_ACK


It is better to remain silent and be thought a fool, than to speak
aloud and remove all doubt.

| Richard Lucassen, Utrecht                                        |
mpd-devel mailing list
mpd-devel <at>
Christian Hesse | 1 Dec 08:53 2015

[PATCH 1/1] fix LimitRTTIME in systemd unit file

From: Christian Hesse <mail <at>>

systemd does not understand LimitRTTIME=-1. For no limit we have to use
the string 'infinity' (see systemd.exec(5)).

Signed-off-by: Christian Hesse <mail <at>>
 systemd/ | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/systemd/ b/systemd/
index 6dce7d9..09a5ad2 100644
--- a/systemd/
+++ b/systemd/
 <at>  <at>  -8,7 +8,7  <at>  <at>  ExecStart= <at> prefix <at> /bin/mpd --no-daemon

 # allow MPD to use real-time priority 50

 # disallow writing to /usr, /bin, /sbin, ...


mpd-devel mailing list
mpd-devel <at>
Jörg Krause | 21 Nov 23:54 2015

[PATCH 1/1] fix static build with alsa

Add ALSA_LIBS to MIXER_LIBS, otherwise building mpd in a static context fails
with lot of undefined references to alsa-lib (libasound) required by

Signed-off-by: Jörg Krause <joerg.krause <at>>
--- | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ b/
index 0bcd9ad..25fd41e 100644
--- a/
+++ b/
 <at>  <at>  -1303,6 +1303,7  <at>  <at>  liboutput_plugins_a_SOURCES = \

 	libmixer_plugins.a \
+	$(ALSA_LIBS) \



mpd-devel mailing list
mpd-devel <at>
Gavin Kistner | 8 Nov 22:35 2015

Associating Metadata (ratings, more) with Songs

I’m building an office music player on top of MPD. I need to be able to store extra metadata with each song:
* Last played
* Last skipped
* Play count
* Rating, per user
* Possibly an array of genres

Viable options, in decreasing order of desirability
1. MPD provides a mechanism to directly associate custom metadata with each song, persisted across
reboots and updates.
2. MPD provides me with a unique ID for each song, robust across file system reorganizations and ID3
changes, and I create my own mirror database of metadata.
3. I use something like Echoprint to uniquely identify songs, and I create my own mirror database of metadata.
4. MPD provides me with the file for the song as the unique identifier, I create my own mirror database of
metadata, and I lose information if a song moves on disk.

#3/4 seem to be my only options. Am I correct? Is there any way to associate metadata with songs in mpd?
mpd-devel mailing list
mpd-devel <at>
Andreas Mair | 2 Nov 10:07 2015

MPD fails to build if configured with "--disable-inotify"


the subject says it all.

That's the build log:
g++ -DHAVE_CONFIG_H -I.  -DNDEBUG -I./src -pthread -isystem
/usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include
-I/usr/include -DSYSTEM_CONFIG_FILE_LOCATION='"/usr/local/etc/mpd.conf"'
-D_GNU_SOURCE -std=gnu++0x -pthread -g -O2 -fvisibility=hidden
-fno-threadsafe-statics -fmerge-all-constants -fno-exceptions
-fno-rtti -ffast-math -ftree-vectorize -ffunction-sections
-fdata-sections -Wall -Wextra -Wmissing-declarations -Wshadow
-Wpointer-arith -Wcast-qual -Wwrite-strings -Wsign-compare -MT
src/Main.o -MD -MP -MF $depbase.Tpo -c -o src/Main.o src/Main.cxx &&\
mv -f $depbase.Tpo $depbase.Po
src/Main.cxx: In function 'int mpd_main_after_fork(options)':
src/Main.cxx:633:17: error: 'main_domain' was not declared in this scope
Makefile:13067: recipe for target 'src/Main.o' failed
make[1]: *** [src/Main.o] Error 1

Best regards,
mpd-devel mailing list
mpd-devel <at>
Ben Boeckel | 27 Oct 03:40 2015

[PATCH 1/2] httpd: add a parameter for playing silence

Some clients act weird in the face of silence and buffer it rather thay
"playing" it. This causes severe lag when the stream is unpaused.

Stopping clients on mobile devices is also good since it preserves
battery life by allowing them to power down their wireless components
for more power savings.

Signed-off-by: Ben Boeckel <mathstuf <at>>
 doc/mpdconf.example                            |  1 +
 doc/user.xml                                   | 10 ++++++++++
 src/output/plugins/httpd/HttpdInternal.hxx     |  5 +++++
 src/output/plugins/httpd/HttpdOutputPlugin.cxx |  4 +++-
 4 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/doc/mpdconf.example b/doc/mpdconf.example
index 87d3021..781c3a9 100644
--- a/doc/mpdconf.example
+++ b/doc/mpdconf.example
 <at>  <at>  -275,6 +275,7  <at>  <at>  input {
 #	bitrate		"128"			# do not define if quality is defined
 #	format		"44100:16:1"
 #	max_clients	"0"			# optional 0=no limit
+#	play_silence	"yes"			# optional, play silence when paused
 # An example of a pulseaudio output (streaming to a remote pulseaudio server)
diff --git a/doc/user.xml b/doc/user.xml
index f66f6e3..af6b3af 100644
--- a/doc/user.xml
+++ b/doc/user.xml
 <at>  <at>  -2846,6 +2846,16  <at>  <at>  buffer_size: 16384</programlisting>
                   to 0 no limit will apply.
+              <row>
+                <entry>
+                  <varname>play_silence</varname>
+                  <parameter>PS</parameter>
+                </entry>
+                <entry>
+                  If <literal>true</literal>, silence will be played
+                  while the stream is paused.
+                </entry>
+              </row>
diff --git a/src/output/plugins/httpd/HttpdInternal.hxx b/src/output/plugins/httpd/HttpdInternal.hxx
index 01498df..bb87ed4 100644
--- a/src/output/plugins/httpd/HttpdInternal.hxx
+++ b/src/output/plugins/httpd/HttpdInternal.hxx
 <at>  <at>  -125,6 +125,11  <at>  <at>  private:
 	char const *website;

+	/**
+	 * True if the plugin should play silence when paused.
+	 */
+	bool play_silence;
 	 * A linked list containing all clients which are currently
diff --git a/src/output/plugins/httpd/HttpdOutputPlugin.cxx b/src/output/plugins/httpd/HttpdOutputPlugin.cxx
index 765a72d..78a4088 100644
--- a/src/output/plugins/httpd/HttpdOutputPlugin.cxx
+++ b/src/output/plugins/httpd/HttpdOutputPlugin.cxx
 <at>  <at>  -113,6 +113,8  <at>  <at>  HttpdOutput::Configure(const ConfigBlock &block, Error &error)

 	clients_max = block.GetBlockValue("max_clients", 0u);

+	play_silence = block.GetBlockValue("play_silence", true);
 	/* set up bind_to_address */

 	const char *bind_to_address = block.GetBlockValue("bind_to_address");
 <at>  <at>  -481,7 +483,7  <at>  <at>  httpd_output_pause(AudioOutput *ao)
 	HttpdOutput *httpd = HttpdOutput::Cast(ao);

-	if (httpd->LockHasClients()) {
+	if (httpd->play_silence && httpd->LockHasClients()) {
 		static const char silence[1020] = { 0 };
 		return httpd_output_play(ao, silence, sizeof(silence),
 					 IgnoreError()) > 0;


mpd-devel mailing list
mpd-devel <at>
Mike Abegg | 17 Oct 08:03 2015

Per-Output Volume Control

This is a new feature that allows setting volume on a per-output basis. (mantis feature request reference: Original concept was to have the mixer for each output and the global mixer multiply their volume together. Looking into the source I found it would be easier to implement (and works just as well from a usability point of view) by having each output volume map directly to it's actual output and calculate the global volume as the average, and setting volume by trying to scale everything proportionately.

The implementation does do some degree of compatibility checking as not all outputs can have per-output volume control (only software mixers seem to work) and clients can tell if a given output has a settable volume by if volume is reported from the outputs command. Volume for an output is set with a new outputvolume command. Disabled outputs can have their volumes set, but they do not affect and are not affected by the global volume.

Attached is a patch that implements this feature. I have little experience in the MPD source so this probably needs more work, but it does show that this feature is probably feasible. I have been using this for the last few weeks and it seems to be working well for me, but I probably haven't covered all possible configurations.
Attachment (output_volume.patch): text/x-patch, 8152 bytes
mpd-devel mailing list
mpd-devel <at>