Help with Mpd

Hi, I want to use mpd but I’m having 2 problems

  1. When I try to run mpd it gives the next output:

exception: Failed to bind to ‘[::]:6600’; Failed to bind socket: Address already in use

And;
2) When I try to run mpd --kill

execption: unable to read the pid from file “/home/username/.mpd/pid” No such file or directory

You need to create a folder .mpd in your home/username and create the files and folder inside it like this: use any editor or the filemanager to create theese files and playlists folder.
copy an example of mdp.conf :

cp /usr/share/doc/mpd/mpdconf.example ~/.mpd/mpd.conf

Edit your config mpd.conf to fit your needs:

music_directory        "/home/user/music/"
playlist_directory             "/home/user/.mpd/playlists"
db_file                              "/home/user/.mpd/mpd.db"
log_file                             "/home/user/.mpd/mpd.log"
pid_file                             "/home/user/.mpd/mpd.pid"
state_file                          "/home/user/.mpd/mpdstate"
bind_to_address 		"0.0.0.0"
port 					"6600"
auto_update	"yes"
audio_output {
        type            "pipewire"
        name            "PipeWire Sound Server"
}
audio_output {
    type                    "fifo"
    name                    "my_fifo"
    path                    "/tmp/mpd.fifo"
    format                  "44100:16:2"
}

Adjust according to your preferences . This is a working mpd.conf.

Add mpd to your group sudo gpasswd -a mpd user in order to read/write your files in .mpd/

Then put some music files in the music folder defined in mpd.conf and do mpc rescan “your musicfolder” in terminal to see if it works. You can also use mpc update

I dont use systemd service for mpd . My mpd is autostartet in i3, bspwm and openbox like this in configs: exec mpd &

You can test your settings/config with this in terminal:

mpd --no-daemon --stdout --verbose

If it has no errors and are playing a song then kill mpd and start it again and use a client like mpc or ncmpcpp to play music.

1 Like
killall mpd
1 Like

I did almost everything except for setting “fifo” but it gave the next output .
Also, this showed up when I used gpasswd
Edit: Before copying the example config to ~/.config/mpd I created the ~/.mpd/ folder In my home directory

Well, somehow I fixed it. Now I just need to set ncmpcpp

fifo is visualisation. Not important to make mpd work but nice to have . You need to add some lines to ncmpcpp config to enable it.
This is mine:

visualizer_data_source = /tmp/mpd.fifo
visualizer_output_name = “mpd_visualizer”
visualizer_in_stereo = “yes”
visualizer_look = " "
visualizer_type = “ellipse”

And the correct command in terminal is:

sudo gpasswd -a mpd gudurana

wich will make mpd part of your group gudurana .

Ohh, is that visual effect. Ok, got it. I’ll add it later then. Thanks