Mpd server / Cantata

i am trying to get a mpd server running with cantata using this EOS guide. something does not work.
❯ journalctl -xeu mpd.service

Mär 11 13:54:06 ryzen systemd[1]: Starting Music Player Daemon...
░░ Subject: A start job for unit mpd.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit mpd.service has begun execution.
░░ 
░░ The job identifier is 2296.
Mär 11 13:54:06 ryzen mpd[15315]: Ignoring the 'pid_file' setting in systemd mode
Mär 11 13:54:06 ryzen mpd[15315]: exception: Failed to bind to '[::]:6600'; Failed to bind socket: Address already in use
Mär 11 13:54:06 ryzen systemd[1]: mpd.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit mpd.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Mär 11 13:54:06 ryzen systemd[1]: mpd.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit mpd.service has entered the 'failed' state with result 'exit-code'.
Mär 11 13:54:06 ryzen systemd[1]: Failed to start Music Player Daemon.
░░ Subject: A start job for unit mpd.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit mpd.service has finished with a failure.
░░ 
░░ The job identifier is 2296 and the job result is failed.

❯ systemctl start mpd.service

Job for mpd.service failed because the control process exited with error code.
See "systemctl status mpd.service" and "journalctl -xeu mpd.service" for details.

❯ systemctl status mpd.service

× mpd.service - Music Player Daemon
     Loaded: loaded (/usr/lib/systemd/system/mpd.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/mpd.service.d
             └─00-arch.conf
     Active: failed (Result: exit-code) since Sat 2023-03-11 13:49:45 CET; 4min 17s ago
       Docs: man:mpd(1)
             man:mpd.conf(5)
    Process: 14915 ExecStart=/usr/bin/mpd --systemd (code=exited, status=1/FAILURE)
   Main PID: 14915 (code=exited, status=1/FAILURE)
        CPU: 62ms

Mär 11 13:49:45 ryzen systemd[1]: Starting Music Player Daemon...
Mär 11 13:49:45 ryzen mpd[14915]: Ignoring the 'pid_file' setting in systemd mode
Mär 11 13:49:45 ryzen mpd[14915]: exception: Failed to bind to '[::]:6600'; Failed to bind socket: Address already in use
Mär 11 13:49:45 ryzen systemd[1]: mpd.service: Main process exited, code=exited, status=1/FAILURE
Mär 11 13:49:45 ryzen systemd[1]: mpd.service: Failed with result 'exit-code'.
Mär 11 13:49:45 ryzen systemd[1]: Failed to start Music Player Daemon.

any suggestions?

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

Something else is using port 6600

Try this:
netstat -tulpn | grep 6600

❯ netstat -tulpn | grep 6600
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)

Tried with sudo, nothing shown.

Kill all instances of mpd

mpd --kill
killall mpd

Then try starting mpd via a terminal.

mpd --verbose
1 Like
❯ mpd --kill
exception: unable to read the pid from file "/home/swh/.mpd/pid": No such file or directory
❯ mpd --verbose
config_file: loading file /home/swh/.config/mpd/mpd.conf
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.7
opus: libopus 1.3.1
sndfile: libsndfile-1.2.0
hybrid_dsd: The Hybrid DSD decoder is disabled because it was not explicitly enabled
decoder: Decoder plugin 'wildmidi' is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg
simple_db: reading DB
input: Input plugin 'qobuz' is not configured: No Qobuz app_id configured
curl: version 7.88.1
curl: with OpenSSL/3.0.8
❯ systemctl start mpd.service
Job for mpd.service failed because the control process exited with error code.
See "systemctl status mpd.service" and "journalctl -xeu mpd.service" for details.

MPD seems to be running.

Could you try connecting to mpd with a frontend?

Or just run mpc update

1 Like
❯ mpd update
exception: Failed to open 'update': No such file or directory

No, i try with cantata but did not start

its mpc, not mpd

1 Like

oh sorry, typo :wink:

❯ mpc update
zsh: command not found: mpc
sudo pacman -S mpc
2 Likes

Also, which DE/WM are you using?

1 Like

Im using Plasma running Cantata as client. But Cantata didnt start anymore as i began to start mpd. something is going wrong from this point on

Install mpc

Run mpc update

And tell if it throws any error

1 Like

seems there is no error.

❯ mpc update
Updating DB (#1) ...
volume:100%   repeat: off   random: off   single: off   consume: off

trying to start mpd again

Okay so it works. No issues with config as such.

Lets kill the server and try starting as systemd service.

mpd --kill
killall mpd

And start service as user.

systemctl --user start mpd.service

Then check systemctl status mpd

1 Like

All done.

❯ systemctl status mpd
× mpd.service - Music Player Daemon
     Loaded: loaded (/usr/lib/systemd/system/mpd.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/mpd.service.d
             └─00-arch.conf
     Active: failed (Result: exit-code) since Sat 2023-03-11 15:25:42 CET; 1min 30s ago
       Docs: man:mpd(1)
             man:mpd.conf(5)
    Process: 26497 ExecStart=/usr/bin/mpd --systemd (code=exited, status=1/FAILURE)
   Main PID: 26497 (code=exited, status=1/FAILURE)
        CPU: 61ms

Mär 11 15:25:42 ryzen systemd[1]: Starting Music Player Daemon...
Mär 11 15:25:42 ryzen mpd[26497]: exception: No configuration file found
Mär 11 15:25:42 ryzen systemd[1]: mpd.service: Main process exited, code=exited, status=1/FAILURE
Mär 11 15:25:42 ryzen systemd[1]: mpd.service: Failed with result 'exit-code'.
Mär 11 15:25:43 ryzen systemd[1]: Failed to start Music Player Daemon.

Does the default config at /etc/mpd.conf exist?

1 Like

Also, you could leave the systemd service altogether and start mpd by itself. (Thats how I prefer it and its never errored out)

Adding mpd to the KDE startup commands / script should do the trick.

1 Like

No couse i have backed it up as mpd00.conf. i need to rename it?. i was under the impression that mpd creates the file again on startup