MPD
MPD copied to clipboard
Playlists in music directory are not present at all times
Bug report
Describe the bug
Hi! I am adding support for playlists located in music directory to my client and I have noticed a werid behavior. There are three playlists in a directory which I am trying to list. First only two will be listed, after a rescan only the third one, after another rescan the first two again, rinse and repeat.
I might be missing something obvious but I cannot explain this behavior.
Expected Behavior
All playlists are listed at all times
Actual Behavior
The behavior is the same via MPC and if I execute protocol commands directly.
MPC log
$ mpc ls test/playlists
test/playlists/radio.m3u
$ mpc rescan test/playlists --wait
Updating DB (#1) ...
volume:100% repeat: off random: off single: off consume: off
$ mpc ls test/playlists
test/playlists/test.m3u
test/playlists/testpls.pls
$ mpc rescan test/playlists --wait
Updating DB (#3) ...
volume:100% repeat: off random: off single: off consume: off
$ mpc ls test/playlists
test/playlists/radio.m3u
$ mpc rescan test/playlists --wait
Updating DB (#5) ...
volume:100% repeat: off random: off single: off consume: off
$ mpc ls test/playlists
test/playlists/test.m3u
test/playlists/testpls.pls
The playlists also load successfully and can be played whenever they are listed.
Additional content
The playlist files in question here:
radio.m3u
#EXTM3U
#EXTINF:-1,TestName
https://media-ssl.musicradio.com/ChillMP3
test.m3u
/home/mrk/Music/Non-Album/鬱P feat. 初音ミク/フューエル.opus
testpls.pls
[playlist]
NumberOfEntries=1
File1=/home/mrk/Music/Foreground Eclipse/Stories That Last Through The Sleepless Nights/02 Dear, Are You Getting Sober.flac
Title1=Test
Length1=-1
Version=2
Version
mpd --version
Music Player Daemon 0.24.4 (v0.24.4)
Copyright 2003-2007 Warren Dukes <[email protected]>
Copyright 2008-2025 Max Kellermann <[email protected]>
This is free software; see the source for copying conditions. There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Database plugins:
simple proxy upnp
Storage plugins:
local udisks nfs curl
Neighbor plugins:
upnp udisks
Decoder plugins:
[mpg123] mp3
[mad] mp3 mp2
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[opus] opus ogg oga
[dsdiff] dff
[dsf] dsf
[faad] aac
[mpcdec] mpc
[wavpack] wv
[openmpt] mptm mod s3m xm it 669 amf ams c67 dbm digi dmf dsm dtm far imf ice j2b m15 mdl med mms mt2 mtm nst okt plm psm pt36 ptm sfx sfx2 st26 stk stm stp ult wow gdm mo3 oxm umx xpk ppm mmcmp
[modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
[mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
[sidplay] sid mus str prg P00
[wildmidi] mid
[fluidsynth] mid
[gme] ay gbs gym hes kss nsf nsfe rsn sap spc vgm vgz
[ffmpeg] 264 265 266 302 3g2 3gp 4xm 669 722 aa aa3 aac aax abc ac3 ac4 ace acm act adf adp ads adx aea afc aiff aix al alias_pix alp amf amr amrnb amrwb ams anm ans apc ape apl apm apng aptx aptxhd aqt argo_asf argo_brp argo_cvg art asc asf asf_o ass ast au avc avi avif avr avs avs2 avs3 bcstm bethsoftvid bfi bfstm bin bink binka bit bitpacked bmp_pipe bmv boa bonk brender_pix brstm c2 c93 caf cdata cdg cdxl cgi cif cine codec2raw concat cri_pipe dash dat data daud dav dbm dds_pipe dfa dff dfpwm dif digi dirac diz dmf dnxhd dpx_pipe dsf dsicin dsm dss dst dtk dtm dts dtshd dv dvbsub dvbtxt dvdvideo dxa ea eac3 ec3 evc exr_pipe f32be f32le f4v f64be f64le fap far ffmetadata film_cpk fits flac flic flm flv frm fsb fwse g722 g723_1 g726 g726le g729 gdm gdv gem_pipe genh gif gif_pipe gsm gxf h261 h263 h264 h265 h266 h26l hca hcom hdr_pipe heic heif hevc hls hnm iamf ice ico idcin idf idx iff ifv ilbc image2 image2pipe imf imx ipmovie ipu ircam ism isma ismv iss it itgz itr itz iv8 ivf ivr j2b j2k j2k_pipe jacosub jpeg_pipe jpegls_pipe jpegxl_pipe jv jxl kux kvag laf lc3 lmlm4 loas lrc lvf lxf m15 m2a m4a m4b m4v mac mca mcc mdgz mdl mdr mdz med mgsts microdvd mid mj2 mjpeg mjpg mk3d mka mks mkv mlp mlv mm mmcmp mmf mms mo3 mod mods moflex mov mp2 mp3 mp4 mpa mpc mpc8 mpeg mpegts mpegtsraw mpegvideo mpl2 mpo mptm msbc msf msnwctcp msp mt2 mtaf mtm mtv musx mv mvi mxf mxg nfo nist nsp nst nsv nut nuv obu ogg okt oma omg osq paf pam_pipe pbm_pipe pcx_pipe pdv pfm_pipe pgm_pipe pgmyuv_pipe pgx_pipe phm_pipe photocd_pipe pictor_pipe pjs plm pmp png_pipe pp_bnk ppm ppm_pipe psd_pipe psm psp psxstr pt36 ptm pva pvf qcif qcp qdraw_pipe qoa qoi_pipe r3d rco rcv rcwt rgb rka rl2 rm roq rpl rsd rso rt rtp rtsp s16be s24be s24le s32be s32le s337m s3gz s3m s3r s3z sami sap sb sbc sbg scc scd sdns sdp sdr2 sds sdx ser sf sfx sfx2 sga sgi_pipe shn sln smi smk smush sol son sox spdif sph srt ss2 st26 stk stl stm stp str sub sunrast_pipe sup svag svg_pipe svs sw swf tak tco tedcaptions thd thp tiertexseq tiff_pipe tmv tta txd txt ty ty+ u16be u24be u24le u32be u32le ub ul ult umx usm uw v v210 vag vapoursynth vb vbn_pipe vc1 vidc viv vividas vmd voc vpk vqe vqf vql vt vtt vvc w64 wa wav way wc3movie webm webm_dash_manifest webp_pipe wma wow wsaud wsd wsvqa wtv wv wve xa xbin xbm_pipe xl xm xmd xmgz xmr xmv xmz xpk xpm_pipe xvag xwd_pipe xwma y4m yop yuv yuv10 rtp:// rtsp:// rtsps://
[sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
[pcm]
Filters:
libsamplerate soxr
Tag plugins:
id3tag
Output plugins:
shout null fifo pipe alsa ao oss openal solaris pipewire pulse jack httpd snapcast recorder
Encoder plugins:
null vorbis opus lame twolame wave flac
Archive plugins:
[bz2] bz2
[zzip] zip
[iso] iso
Input plugins:
file archive alsa qobuz curl ffmpeg nfs mms cdio_paranoia
Playlist plugins:
extm3u m3u pls xspf asx rss flac cue embcue
Protocols:
file:// alsa:// cdda:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mms:// mmsh:// mmst:// mmsu:// nfs:// qobuz:// rtmp:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtmpts:// rtp:// rtsp:// rtsps:// scp:// sftp:// smb:// srtp://
Other features:
avahi dbus udisks epoll icu inotify ipv6 systemd tcp un
Configuration
mpd.conf
music_directory "~/Music"
playlist_directory "~/.config/mpd/playlists"
log_file "/tmp/mpd.log"
sticker_file "~/.config/mpd/sticker.sql"
auto_update "yes"
bind_to_address "127.0.0.1"
bind_to_address "/tmp/mpd_socket"
restore_paused "yes"
playlist_plugin {
name "cue"
enabled "true"
}
playlist_plugin {
name "pls"
enabled "true"
}
audio_output {
type "pipewire"
name "pipewire"
}
audio_output {
type "fifo"
name "my_fifo"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
Log
Output of my mpd log when MPD has been started with --verbose
mpd.log
2025-06-14T11:11:26 event: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
2025-06-14T11:11:26 inotify: initializing inotify
2025-06-14T11:11:26 inotify: watching music directory
2025-06-14T11:11:42 client: [127.0.0.1:37190] client connected
2025-06-14T11:11:42 client: [127.0.0.1:37190] process command list
2025-06-14T11:11:42 client: process command "tagtypes \"clear\""
2025-06-14T11:11:42 client: command returned 0
2025-06-14T11:11:42 client: [127.0.0.1:37190] process command list returned 0
2025-06-14T11:11:42 client: [127.0.0.1:37190] process command "lsinfo \"test/playlists\""
2025-06-14T11:11:42 client: [127.0.0.1:37190] command returned 0
2025-06-14T11:11:42 client: [127.0.0.1:37190] disconnected
2025-06-14T11:11:44 client: [127.0.0.1:37192] client connected
2025-06-14T11:11:44 client: [127.0.0.1:37192] process command list
2025-06-14T11:11:44 client: process command "rescan \"test/playlists\""
2025-06-14T11:11:44 update: spawned thread for update job id 1
2025-06-14T11:11:44 client: command returned 0
2025-06-14T11:11:44 client: process command "rescan \"--wait\""
2025-06-14T11:11:44 client: command returned 0
2025-06-14T11:11:44 client: [127.0.0.1:37192] process command list returned 0
2025-06-14T11:11:44 update: starting: test/playlists
2025-06-14T11:11:44 client: [127.0.0.1:37192] process command list
2025-06-14T11:11:44 client: process command "status"
2025-06-14T11:11:44 client: command returned 0
2025-06-14T11:11:44 client: process command "currentsong"
2025-06-14T11:11:44 client: command returned 0
2025-06-14T11:11:44 client: [127.0.0.1:37192] process command list returned 0
2025-06-14T11:11:44 client: [127.0.0.1:37192] disconnected
2025-06-14T11:11:44 simple_db: removing empty directories from DB
2025-06-14T11:11:44 simple_db: sorting DB
2025-06-14T11:11:44 simple_db: writing DB
2025-06-14T11:11:44 update: finished: test/playlists
2025-06-14T11:11:44 sticker: spawned thread for cleanup job
2025-06-14T11:11:44 sticker: begin cleanup
2025-06-14T11:11:44 update: spawned thread for update job id 2
2025-06-14T11:11:44 update: starting: --wait
2025-06-14T11:11:44 sticker: end cleanup: 0 stickers deleted
2025-06-14T11:11:44 update: finished: --wait
2025-06-14T11:11:48 client: [127.0.0.1:37202] client connected
2025-06-14T11:11:48 client: [127.0.0.1:37202] process command list
2025-06-14T11:11:48 client: process command "tagtypes \"clear\""
2025-06-14T11:11:48 client: command returned 0
2025-06-14T11:11:48 client: [127.0.0.1:37202] process command list returned 0
2025-06-14T11:11:48 client: [127.0.0.1:37202] process command "lsinfo \"test/playlists\""
2025-06-14T11:11:48 client: [127.0.0.1:37202] command returned 0
2025-06-14T11:11:48 client: [127.0.0.1:37202] disconnected
2025-06-14T11:11:52 client: [127.0.0.1:51870] client connected
2025-06-14T11:11:52 client: [127.0.0.1:51870] process command list
2025-06-14T11:11:52 client: process command "rescan \"test/playlists\""
2025-06-14T11:11:52 update: spawned thread for update job id 3
2025-06-14T11:11:52 client: command returned 0
2025-06-14T11:11:52 update: starting: test/playlists
2025-06-14T11:11:52 client: process command "rescan \"--wait\""
2025-06-14T11:11:52 client: command returned 0
2025-06-14T11:11:52 client: [127.0.0.1:51870] process command list returned 0
2025-06-14T11:11:52 client: [127.0.0.1:51870] process command list
2025-06-14T11:11:52 client: process command "status"
2025-06-14T11:11:52 client: command returned 0
2025-06-14T11:11:52 client: process command "currentsong"
2025-06-14T11:11:52 client: command returned 0
2025-06-14T11:11:52 client: [127.0.0.1:51870] process command list returned 0
2025-06-14T11:11:52 client: [127.0.0.1:51870] disconnected
2025-06-14T11:11:52 simple_db: removing empty directories from DB
2025-06-14T11:11:52 simple_db: sorting DB
2025-06-14T11:11:52 simple_db: writing DB
2025-06-14T11:11:52 update: finished: test/playlists
2025-06-14T11:11:52 sticker: spawned thread for cleanup job
2025-06-14T11:11:52 sticker: begin cleanup
2025-06-14T11:11:52 update: spawned thread for update job id 4
2025-06-14T11:11:52 update: starting: --wait
2025-06-14T11:11:52 update: finished: --wait
2025-06-14T11:11:52 sticker: end cleanup: 0 stickers deleted
2025-06-14T11:11:54 client: [127.0.0.1:51878] client connected
2025-06-14T11:11:54 client: [127.0.0.1:51878] process command list
2025-06-14T11:11:54 client: process command "tagtypes \"clear\""
2025-06-14T11:11:54 client: command returned 0
2025-06-14T11:11:54 client: [127.0.0.1:51878] process command list returned 0
2025-06-14T11:11:54 client: [127.0.0.1:51878] process command "lsinfo \"test/playlists\""
2025-06-14T11:11:54 client: [127.0.0.1:51878] command returned 0
2025-06-14T11:11:54 client: [127.0.0.1:51878] disconnected
2025-06-14T11:11:58 client: [127.0.0.1:51886] client connected
2025-06-14T11:11:58 client: [127.0.0.1:51886] process command list
2025-06-14T11:11:58 client: process command "rescan \"test/playlists\""
2025-06-14T11:11:58 update: spawned thread for update job id 5
2025-06-14T11:11:58 client: command returned 0
2025-06-14T11:11:58 client: process command "rescan \"--wait\""
2025-06-14T11:11:58 client: command returned 0
2025-06-14T11:11:58 client: [127.0.0.1:51886] process command list returned 0
2025-06-14T11:11:58 update: starting: test/playlists
2025-06-14T11:11:58 client: [127.0.0.1:51886] process command list
2025-06-14T11:11:58 client: process command "status"
2025-06-14T11:11:58 client: command returned 0
2025-06-14T11:11:58 client: process command "currentsong"
2025-06-14T11:11:58 client: command returned 0
2025-06-14T11:11:58 client: [127.0.0.1:51886] process command list returned 0
2025-06-14T11:11:58 client: [127.0.0.1:51886] disconnected
2025-06-14T11:11:58 simple_db: removing empty directories from DB
2025-06-14T11:11:58 simple_db: sorting DB
2025-06-14T11:11:58 simple_db: writing DB
2025-06-14T11:11:58 update: finished: test/playlists
2025-06-14T11:11:58 sticker: spawned thread for cleanup job
2025-06-14T11:11:58 sticker: begin cleanup
2025-06-14T11:11:58 update: spawned thread for update job id 6
2025-06-14T11:11:58 update: starting: --wait
2025-06-14T11:11:58 update: finished: --wait
2025-06-14T11:11:58 sticker: end cleanup: 0 stickers deleted
2025-06-14T11:12:00 client: [127.0.0.1:46702] client connected
2025-06-14T11:12:00 client: [127.0.0.1:46702] process command list
2025-06-14T11:12:00 client: process command "tagtypes \"clear\""
2025-06-14T11:12:00 client: command returned 0
2025-06-14T11:12:00 client: [127.0.0.1:46702] process command list returned 0
2025-06-14T11:12:00 client: [127.0.0.1:46702] process command "lsinfo \"test/playlists\""
2025-06-14T11:12:00 client: [127.0.0.1:46702] command returned 0
2025-06-14T11:12:00 client: [127.0.0.1:46702] disconnected
Additionally I have noticed that while mpc load test/playlists/test.m3u works the add commands do not. I would expect mpc add test/playlists(as well as the protocol command and maybe with a flag) to load all playlists in the directory.
Is the current behavior correct?
add, by defintion, adds songs to the queue.
Loading a playlist is a different operation called load.
Your expectation is not logically wrong, it just doesn't match the design choices made by MPD.