_                    _
  ___ | |__   __ _ _______ | |_
 / _ \| '_ \ / _` |_  / _ \| __|
| (_) | | | | (_| |/ / (_) | |_
 \___/|_| |_|\__,_/___\___/ \__|

mpdmusic player daemon - usage, config, clients and tips

MPD is a music daemon which can be crontrolled through different clients.

back to top

MPD provides a sample config file which can be found at /etc/mpd.conf. Uncomment and edit the following lines as needed.

music_directory MUSIC_DIR
playlist_directory      "PLAYLIST_DIR"
db_file                 "DATABASE_FILE"
log_file                        "LOG_FILE"
pid_file                        "PID_FILE"
state_file                      "STATE_FILE"
sticker_file                    "SQL_FILE"
port                            "6600"

Multiple outputs can be enabled.

audio_output {
        type            "alsa"
        name            "My ALSA Device"
        mixer_type      "software"              # optional
}
audio_output {
        type            "pulse"
        name            "My Pulse Output"
}

An httpd streaming output can be configured to be played using the url http://HOST:PORT.

audio_output {
        type            "httpd"
        name            "My HTTP Stream"
        encoder         "vorbis"                # optional, vorbis or lame
        port            "8000"
        bind_to_address "0.0.0.0"               # optional, IPv4 or IPv6
        bitrate         "128"                   # do not define if quality is defined
        format          "44100:16:1"
        max_clients     "0"                     # optional 0=no limit
}

MPD_HOST
MPD_PORT

mpd [CONFIG_FILE] | start mpd. CONFIG_FILE can be specified.
mpd --kill [CONFIG_FILE] | kill mpd session. If CONFIG_FILE is given, kill session running from CONFIG_FILE

back to top

mpc | command line client.
ncmpc | ncurses client.
ncmpcpp | ncurses client inspired by ncmpc (written in c++).
vimpc | ncurses client with vi-like bindings.

mpc [COMMAND]

Format to display songs in playlist:

ENV | MPC_FORMAT | MPC_FORMAT="%position% - %file%"
command line | | mpc -f "%position% - %file%" playlist

toggle , next , prev , clear , shuffle

random , single , repeat , consume

playlist | | display queue.
lsplaylist | | display available playlists.
update | [MPD_DIR] | update database, if directory is given, only that directory will be updated.
vol | [+-]N | mpc vol +10 | mpc vol 50.
save | PLAYLIST | save playlist.
load | PLAYLIST | load playlist.
rm | PLAYLIST | remove playlist.
seek | [+-]N | seek position in song, eg.: seek -20.
del | QUEUE_ID | delete song in given position, if position is 0, delete the current song.
search | TYPE QUERY | search song in database, eg.: search filename "SEARCH_TERM".
searchplay | TYPE QUERY | play song in queue matching the query, eg.: searchplay filename "SEARCH TERM".
add | FILEPATH | add file to the end of the queue (can read input from pipes).
insert | FILEPATH | add file to the queue after the current song (can read input from pipes).
outputs | | display available outputs.
disable | OUTPUT_ID | disable output.
enable | OUTPUT_ID | enable output.

mpc search filename "SEARCH" | mpc add
mpc search filename "SEARCH" | mpc insert

back to top

mpd has the requirement fmt from slackbuilds which conflicts with the core fmt, editing this requirement should avoid the conflict. The version 0.23.16 on the repository does not build, the version can be changed to 0.24.6 which works fine.

back to top

slackware

- ArchLinux manpages: mpd(1) , mpd.conf(5) , mpc(1) , ncmpc(1) , ncmpcpp(1)

- mpd
- vimpc

back to top

ohazot | about | ohazot.com <admin@ohazot.com>

linux , OpenBSD | Created:2025-11-23|Updated:2025-11-23