every time i run mpd i get this:
Failed to bind to '0.0.0.0:6600'; Failed to bind socket: Address already in use
it doesn't matter what i set "bind_to_address" in mpd.conf to, i get this every time, can't find any processes using them either
Have you installed and configured mpd-<your_init>?
yes, it doesn't seem to do anything
i'm also getting a "no database" error when trying to "mpc up"
Failed to bind to '0.0.0.0:6600';
Failed to bind socket: Address already in useThat message means that something else is using the port 6600, maybe is he same mpd which is running as background or maybe is something else which is listening in that port. You can check what is running with this command:
ss -putan | grep 6600
tcp LISTEN 0 5 *:6600 *:*
tcp ESTAB 0 0 [::1]:58268 [::1]:6600 users:(("mpc",pid=2503,fd=3))
tcp ESTAB 0 0 [::1]:6600 [::1]:58268
it might just say its failing cause i've already binded it to mpd? thought it'd report "mpd has already started", if i specify another port (not address) in mpd.conf it gives me this:
decoder: Decoder plugin 'wildmidi' is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg
ncmpcpp still reports "MPD: No database"
See here: https://bbs.archlinux.org/viewtopic.php?id=234400
and: https://bbs.archlinux.org/viewtopic.php?pid=980224#p980224
and first and foremost: how to ask correctly to get the right answer (https://forum.artixlinux.org/index.php/topic,1923.0.html)
$ mpd --no-daemon --stdout --verbose
config_file: loading file /home/m/.config/mpd/mpd.conf
exception: Default TCP listener setup failed, but this is okay because we have a $XDG_RUNTIME_DIR listener: Failed to bind to '[::]:6600'; Failed to bind socket: Address already in use
libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
vorbis: Xiph.Org libVorbis 1.3.7
opus: libopus 1.3.1
sndfile: libsndfile-1.0.31
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.81.0
curl: with OpenSSL/1.1.1m
inotify: initializing inotify
event: RTIOThread could not get realtime scheduling, continuing anyway: sched_setscheduler failed: Operation not permitted
inotify: watching music directory
unsure how they fixed the problem as even they didn't know
https://bbs.archlinux.org/viewtopic.php?pid=1767159#p1767159
https://bbs.archlinux.org/viewtopic.php?pid=1767163#p1767163
https://wiki.archlinux.org/title/Music_Player_Daemon/Troubleshooting#Binding_to_IPV6_before_IPV4
https://bbs.archlinux.org/viewtopic.php?pid=980224#p980224
https://bbs.archlinux.org/viewtopic.php?pid=1862342#p1862342
https://old.reddit.com/r/linuxquestions/comments/bmkcl3/mpd_error_no_database/emxfdu1/
And so on. Reading is a skill.
Edit: Also:
https://github.com/MusicPlayerDaemon/MPD/discussions/1365#discussioncomment-1718911
So see about configuring the mpd service in your init to run it as a specific user. The database file needs to be accessible to mpd as well.
Edit 2: Just tried installing mpd + mpc in 66. Steps taken:
$ su
# pacman -S mpd mpd-suite66
# exit
$ pikaur -S mpc
$ su
# vim /etc/mpd.conf
# See: /usr/share/doc/mpd/mpdconf.example <-- big hint here
user "mpd" # <-- added those
group "mpd" # <-- two lines
pid_file "/run/mpd/mpd.pid"
db_file "/var/lib/mpd/mpd.db"
state_file "/var/lib/mpd/mpdstate"
music_directory "/var/lib/mpd/music" # <-- also this line
playlist_directory "/var/lib/mpd/playlists"
# touch /var/lib/mpd/{mpdstate,mpd.db}
# mkdir /var/lib/mpd/music
# chown mpd:mpd /var/lib/mpd/*
# 66-enable -t default -S mpd
# exit
$ mpc
volume: n/a repeat: off random: off single: off consume: off
Everything works normally, with the exception of sound output device, which I didn't configure, but that is out of the scope of the OP.
.config/mpd/mpd.conf:
music_directory "/mnt/Music"
playlist_directory "~/.config/mpd/playlists"
auto_update "yes"
bind_to_address "0.0.0.0" <---- the error persisted regardless of what ipv4 i bind to
port "6600"
restore_paused "yes"
max_output_buffer_size "16384"
audio_output {
type "pulse"
name "pulse"
#type "alsa"
#name "ALSA"
}
audio_output {
type "fifo"
name "Visualizer feed"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
/etc/mpd.conf:
# See: /usr/share/doc/mpd/mpdconf.example
user "mpd" <---- added user
group "mpd" <---- added group
pid_file "/run/mpd/mpd.pid"
db_file "var/lib/mpd/mpd.db"
state_file "/var/lib/mpd/mpdstate"
music_directory "/var/lib/mpd/music" <---- and music_directory
playlist_directory "/var/lib/mpd/playlists"
$ su
$ vim /etc/mpd.conf <----- added user, group, & music_directory lines
$ touch /var/lib/mpd/mpdstate
$ touch /var/lib/mpd/mpd.db
$ touch mkdir /var/lib/mpd/music
$ chown mpd:mpd /var/lib/mpd/*
$ rc-update add mpd <---- unsure if there was any "-t" or "-S" equivalent i had to specify, unfamiliar with 66 & couldn't find a suite66/openrc cheat sheet online
$ rc-service mpd restart
$ exit
$ mpc up
Updating DB (#1) ...
volume: n/a repeat: off random: off single: off consume: off
got the same error a few times along the way but i think restarting mpd init after recreating those steps fixed it, works even after reboot
This line:
If there was no directory /var/lib/music, the command you wrote above would create a file named mkdir in the current directory (whatever that might have been at the time) and a
file /var/lib/mpd/music. Instead, the command should be exactly this:
mkdir /var/lib/mpd/music
The idea with this particular command is to create a
directory /var/lib/mpd/music. For more information:
man touch
man mkdir