MPD: Port already in use

MPD and ncmpcpp not working. It show’s port already in use and does nothing. Here is the mpd config. Any help? I’ve tried changing port to or 127.x.x.x but have still same error.

music_directory "~/Music"
playlist_directory "~/.config/mpd/playlists"
db_file "~/.config/mpd/database"
log_file "~/.config/mpd/log"
bind_to_address ""

audio_output {
    type                   "alsa"
    name                   "ALSA [Bit-perfect]"
    device                 "hw:1,0"
    auto_channels          "no"
    auto_format            "no"
    auto_resample          "no"
    dop                    "yes"
    mixer_type             "none"
    replay_gain_handler    "none"
    buffer_time            "100000"

audio_output {
    type                   "pulse"
    name                   "PulseAudio"
    buffer_time            "100000"

audio_output {
    type                   "fifo"
    name                   "Visualizer"
    format                 "44100:16:2"
    path                   "/tmp/mpd.fifo"

audio_output {
	type		"httpd"
	name		"lossless"
	encoder		"flac"
	port		"8000"
	max_client	"8"
	mixer_type	"software"
	format		"44100:16:2"

Welcome to the Forum someone will be along shortly with an answer

Hi! Welcome to the forum :enos_flag:

This is the address. Below the address line, add this line to specify port

port "4444"

(of course, change 4444 to whichever port you want)

On a side note, are you sure there is no other instance of mpd running? You may want to run killall mpd
I generally don’t see other apps occupying port 6600, which is the default MPD port.

1 Like


mpd --kill

Then run this and copy paste the output here

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

output of :

ps aux | grep mpd

Seems like mpd is already running as I suspected.


killall mpd

Then try launching mpd again the way you were doing.


Yes its working; the first time you ran, it gave error. Then you killed all mpd instances.

Second time you ran, - it actually worked

Third time you ran - it failed again because mpd is running.

I hope you realize that mpd is a background daemon that doesn’t really have an interactive frontend. You need to add an extra app for that.

1 Like

I think i got mpd to work… But how do i test it? Ncmpcpp still shows connection refused

I had to create the timidity.cfg file… Idk how that worked

You probably want to remove the port "6666" line; that was only to test.

After that ncmpcpp should be able to connect without any extra effort.

Make sure there is nothing in ~/.ncmpcpp/config that could possibly be making things go haywire. (like explicitly specifying a different port)

1 Like

Ugh. Everything works?.. But the music is not showing up. The audio file (.mp3) is in Music Directory.

Open ncmpcpp and press u to update the database.
ncmpcpp cheat sheat or if you want to use mpc, this cheat sheat

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.