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"

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

And change music_directory yo 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.

MPD is not started automatically. It is meant to be socket activated by a client, SMPC is the most obvious candidate for that on you 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

Storage plugins:
local udisks

Neighbor plugins:
udisks

Decoders plugins:
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
[dsdiff] dff
[dsf] dsf
[hybrid_dsd] m4a
[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 t
gv 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 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.22.6-1.aarch64.rpm443.2 KB17/07/2021 - 11:31
File mpd-0.22.9-1.armv7hl.rpm424.64 KB17/07/2021 - 11:31
File mpd-0.22.9-1.i486.rpm516.27 KB17/07/2021 - 11:31
File mpd-0.22.9-1.aarch64.rpm443.38 KB18/07/2021 - 09:57
File mpd-0.22.10-1.aarch64.rpm444.12 KB06/08/2021 - 21:56
File mpd-0.22.10-1.armv7hl.rpm424.07 KB06/08/2021 - 21:56
File mpd-0.22.10-1.i486.rpm517.05 KB06/08/2021 - 21:56
File mpd-0.22.11-1.aarch64.rpm444.76 KB26/08/2021 - 20:06
File mpd-0.22.11-1.armv7hl.rpm424.28 KB26/08/2021 - 20:06
File mpd-0.22.11-1.i486.rpm517.46 KB26/08/2021 - 20:06
File mpd-0.23-1.i486.rpm538.91 KB19/10/2021 - 20:06
File mpd-0.23-1.armv7hl.rpm442.48 KB19/10/2021 - 20:06
File mpd-0.23-1.aarch64.rpm460.2 KB19/10/2021 - 20:06
File mpd-0.23-2.aarch64.rpm460.02 KB23/10/2021 - 00:37
File mpd-0.23-2.armv7hl.rpm442.58 KB23/10/2021 - 00:37
File mpd-0.23-2.i486.rpm538.96 KB23/10/2021 - 00:37
File mpd-0.23-3.armv7hl.rpm444.53 KB01/11/2021 - 01:46
File mpd-0.23-3.aarch64.rpm461.91 KB01/11/2021 - 01:46
File mpd-0.23-3.i486.rpm540.88 KB01/11/2021 - 01:46
File mpd-0.23-4.i486.rpm545.01 KB12/11/2021 - 19:38
File mpd-0.23-4.aarch64.rpm464.76 KB12/11/2021 - 19:38
File mpd-0.23-4.armv7hl.rpm447.85 KB12/11/2021 - 19:38
File mpd-0.23-5.armv7hl.rpm464.44 KB03/12/2021 - 02:27
File mpd-0.23-5.aarch64.rpm484.28 KB03/12/2021 - 02:27
File mpd-0.23-5.i486.rpm563.15 KB03/12/2021 - 02:27

Comments

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