Music Player Daemon (MPD)

Rating: 
5
Your rating: None Average: 5 (4 votes)

Music Player Daemon (MPD) is a flexible, powerful, server-side application for playing music. Through plugins and libraries it can play a variety of sound files while being controlled by its network protocol.

MPD sources on github

Warning: you will need a bit of terminal voodoo to configure stuff, so only install if you are comfortable with that.

Terminal (defaultuser or nemo) steps before installation (we choose ~/.config/mpd as mpd config location):

cd ~/.config
mkdir mpd
cd mpd

Now create the config file mpd.conf over here, with the following content:

music_directory         "/path/to/your/music"
playlist_directory      "~/.config/mpd/playlists"
db_file                 "~/.config/mpd/database"
log_file                "~/.config/mpd/log"
pid_file                "~/.config/mpd/pid"
state_file              "~/.config/mpd/state"
sticker_file            "~/.config/mpd/sticker.sql"
bind_to_address         "127.0.0.1"
port                    "6600"
auto_update "yes"

decoder { 
   plugin "wildmidi"
   config_file "/etc/wildmidi/wildmidi.cfg"
}

audio_output {
type        "pulse"
name        "PulseAudio"
}
filesystem_charset      "UTF-8"

And change music_directory to you music location (~/Music/ for example) or make other tweaks if desired.

Now start with installing MPD itself. MPD needs the liburing library, which is in my repository. Starting from mpd 0.23.5, libpcre2-8 is also needed and not to be found in the jolla repos, so this is also added. -> pcre2 is added in SFOS 4.6.

MPD is not started automatically. It is meant to be socket activated by a client, SMPC is the most obvious candidate for that on your SailfishOS device itself, but you could also control it by another device with another MPD client. MPC is the default command line client.

I added an option in SMPC to stop the MPD service when closing smpc. Normally it stays active after a socket activation.
SMPC would need a new server entry using 127.0.0.1 as ip address and 6600 (default) as the port to control MPD on your device.

Troubleshooting:
If the socket was not started because of some issue:
Status:

systemctl --user status mpd.socket

Start:

systemctl --user start mpd.socket

Start MPD manually if desired:

systemctl --user start mpd.service

 

MPD features compiled (remark: wma is one of  the formats not supported):

Database plugins: 
simple upnp

Storage plugins:
local udisks

Neighbor plugins:
upnp udisks

Decoders plugins:
[mad] mp3 mp2 
[mpg123] mp3
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[opus] opus ogg oga
[sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
[dsdiff] dff
[dsf] dsf
[hybrid_dsd] m4a
[faad] aac
[wavpack] wv
[mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
[sidplay] sid mus str prg P00
[wildmidi] mid
[gme] ay gbs gym hes kss nsf nsfe rsn sap spc vgm vgz
[ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve rtp:// rtsp:// rtsps://
[pcm]

Filters:


Tag plugins:
id3tag

Output plugins:
null fifo pipe alsa openal solaris pulse httpd snapcast recorder

Encoder plugins:
null opus wave flac

Archive plugins:
[bz2] bz2

Input plugins:
file io_uring archive alsa curl ffmpeg

Playlist plugins:
extm3u m3u pls xspf asx rss flac cue embcue

Protocols:
file:// alsa:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mmsh:// mmst:// rtmp:// rtmpt:// rtp:// rtsp:// rtsps:// smb:// srtp://

Other features:
dbus udisks epoll icu inotify ipv6 systemd tcp un



Keywords:

Application versions: 
AttachmentSizeDate
File mpd-0.23-6.i486.rpm587.06 KB15/03/2022 - 01:03
File mpd-0.23-6.aarch64.rpm503.49 KB15/03/2022 - 01:03
File mpd-0.23-6.armv7hl.rpm483.62 KB15/03/2022 - 01:03
File mpd-0.23-7.i486.rpm587.05 KB10/05/2022 - 10:55
File mpd-0.23-7.aarch64.rpm503.7 KB10/05/2022 - 10:55
File mpd-0.23-7.armv7hl.rpm483.86 KB10/05/2022 - 10:55
File mpd-0.23-8.aarch64.rpm520.69 KB09/07/2022 - 16:03
File mpd-0.23-8.i486.rpm605.51 KB09/07/2022 - 16:03
File mpd-0.23-8.armv7hl.rpm499.56 KB09/07/2022 - 16:03
File mpd-0.23-9.armv7hl.rpm499.84 KB19/08/2022 - 00:26
File mpd-0.23-9.i486.rpm605.83 KB19/08/2022 - 00:26
File mpd-0.23-9.aarch64.rpm520.8 KB19/08/2022 - 00:26
File mpd-0.23-10.aarch64.rpm522.99 KB15/10/2022 - 16:53
File mpd-0.23-10.armv7hl.rpm501.22 KB15/10/2022 - 16:53
File mpd-0.23-11.aarch64.rpm522.88 KB29/11/2022 - 01:34
File mpd-0.23-11.armv7hl.rpm501.76 KB29/11/2022 - 01:34
File mpd-0.23-12.i486.rpm655.85 KB05/02/2023 - 18:32
File mpd-0.23-12.aarch64.rpm598.44 KB05/02/2023 - 18:55
File mpd-0.23-12.armv7hl.rpm553.84 KB05/02/2023 - 18:55
File mpd-0.23-13.armv7hl.rpm558.72 KB23/05/2023 - 01:41
File mpd-0.23-13.aarch64.rpm599.15 KB23/05/2023 - 01:41
File mpd-0.23-13.i486.rpm656.29 KB23/05/2023 - 01:41
File mpd-0.23-14.armv7hl.rpm524.34 KB08/10/2023 - 18:33
File mpd-0.23-14.aarch64.rpm563.59 KB08/10/2023 - 18:33
File mpd-0.23-14.i486.rpm624.04 KB08/10/2023 - 18:33
File mpd-0.23-15.i486.rpm624.33 KB21/12/2023 - 02:32
File mpd-0.23-15.aarch64.rpm563.53 KB21/12/2023 - 02:32
File mpd-0.23-15.armv7hl.rpm531.38 KB21/12/2023 - 02:32
File mpd-0.23-15.1.armv7hl.rpm549.3 KB08/01/2024 - 00:23
File mpd-0.23-15.1.aarch64.rpm580.83 KB08/01/2024 - 01:04
File mpd-0.23-15.1.i486.rpm642.88 KB08/01/2024 - 01:31
File mpd-0.23-15.2.i486.rpm646.89 KB11/01/2024 - 01:41
File mpd-0.23-15.2.aarch64.rpm583.94 KB11/01/2024 - 01:41
File mpd-0.23-15.2.armv7hl.rpm546.22 KB11/01/2024 - 01:41
File mpd-0.23-15.3.aarch64.rpm584.86 KB14/01/2024 - 00:08
File mpd-0.23-15.3.i486.rpm648.31 KB14/01/2024 - 00:08
File mpd-0.23-15.3.armv7hl.rpm546.62 KB14/01/2024 - 00:08
File mpd-0.23-15.4.i486.rpm654.96 KB17/01/2024 - 14:11
File mpd-0.23-15.4.aarch64.rpm591.69 KB17/01/2024 - 14:11
File mpd-0.23-15.4.armv7hl.rpm561.51 KB17/01/2024 - 14:11
File mpd-0.23-15.5.i486.rpm628.38 KB19/06/2024 - 22:05
File mpd-0.23-15.5.aarch64.rpm570.82 KB19/06/2024 - 22:05
File mpd-0.23-15.5.armv7hl.rpm531.56 KB19/06/2024 - 22:05
File mpd-0.23-16.armv7hl.rpm537.28 KB03/12/2024 - 22:25
File mpd-0.23-16.i486.rpm629.99 KB03/12/2024 - 22:25
File mpd-0.23-16.aarch64.rpm572.14 KB03/12/2024 - 22:25
Changelog: 

https://github.com/MusicPlayerDaemon/MPD/blob/master/NEWS

0.23.15.5 Compiled for SFOS 4.6
0.23.15.4 added mad mp3 decoder and enabled mpg123 mp3 decoder
0.23.15.3 added wildmidi decoder for midi file -> see config above!
0.23.15.2 added sidplay decoder for C64 SID file.
[sidplay] sid mus str prg P00
0.23.15.1 added the following decoders:
[opus] opus ogg oga
[faad] aac
[wavpack] wv
[mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
[gme] ay gbs gym hes kss nsf nsfe rsn sap spc vgm vgz

Comments

Ezreal's picture

There is a problem that when using usb dac there is too much noise playing dsd audio

ade's picture

Does the problem also manifest itself on other non sailfish devices? Even if it looks SailfishOS related I don't think there is much I can do, besides sending you to the github develop site of mpd (https://github.com/MusicPlayerDaemon/MPD/issues)

Ezreal's picture

Yes. This problem only exists on Sailfish devices. Dsd audio playback works fine on raspberry pi.

levone1's picture

Small issue - I set music path for local server in mpd.conf, and worked fine. Then, later, I wanted to change the path, but it still reads from the same path. How to force it to forget? Also, I've been mainly using it with SMPC, and I set SMPC settings to kill server on exit, but whenever I try to run mpd from command line, it says address in use, even afyer reboot, when SMPC shows disconnected...

ade's picture

You should choose "Update server database" after changing your path.
Does SMPC display a notification that the local MPD service is stopped after closing the app? Check if mpd is running and/or the port is in use, is the mpd services services enabled for some reason? Please check chose basic things first.

kan's picture

I get "ffmpeg: Unsupported audio codec" for wma. Does it work?

ade's picture

No, it does not seem to support it, sorry. It is not MPD's fault, but most likely related to the used ffmpeg-devel package of SFOS, which has disabled support.
The few WMA files I had I have converted to MP3 some time ago, as WMA is so poorly supported in general.

Ezreal's picture

The audio can bypass all resampling and be output to a USB dac, which is really great.

Thanks a lot for bringing it to SailfishOS and letting us hear HIFI music!

 

razcampagne's picture

Yes! I was looking for mpd on sfos for a long time, thank you very much!
Although... It fails to install on aarch64 because it needs libicui18n.so.66 but version installed is 68

ade's picture

I did not notice I uploaded an older aarch64 MPD build I created in april. Updated version now uploaded for aarch64!

razcampagne's picture

Great, I confirm it is working fine now, thanks for your quick handling