Hello.
I am trying to start the mpd music daemon from runit as a user service, but it seems there is some error in the configuration.
Let me elaborate a bit more .....
First of all, this is the kernel I am running:
❯ uname -r
6.1.10-artix1-1
I start the pipewire service also from runit as a user service, and the pipewire-pulse service and wireplumber service are started based on the configuration I have for the pipewire service.
Pipewire services are started successfully, and I can listen successfully to the audio coming from apps like browers, for instance.
The mpd daemon is also started successfully, but there is no audio coming from it, using different clients like mpc and ncmpcpp.
❯ sv status mpd
run: mpd: (pid 21306) 1024s; run: log: (pid 19258) 1481s
This how I am starting the daemon:
#!/bin/sh
# Wait for the PipeWire Pulse daemon to start.
/usr/bin/pgrep pipewire-pulse >/dev/null || exit 1
[ -r ./conf ] && . ./conf
exec mpd --no-daemon --stderr /home/localuser/.config/mpd/mpd.conf 2>&1
and this is how my pstree looks like after starting the mpd daemon via runit:
❯ pstree
runit─┬─at-spi-bus-laun─┬─dbus-daemon
│ └─2*[{at-spi-bus-laun}]
├─at-spi2-registr───2*[{at-spi2-registr}]
├─autostart.sh─┬─dwmblocks
│ ├─nm-applet───4*[{nm-applet}]
│ └─picom───2*[{picom}]
├─chrome_crashpad───{chrome_crashpad}
├─chrome_crashpad
├─2*[dbus-daemon]
├─2*[dbus-launch]
├─dunst───2*[{dunst}]
├─pipewire-pulse───{pipewire-pulse}
├─runsvdir─┬─6*[runsv───agetty]
│ ├─runsv─┬─dbus-daemon
│ │ └─svlogd
│ ├─runsv───elogind
│ ├─runsv─┬─runsvdir─┬─runsv─┬─cat
│ │ │ │ └─emacs
│ │ │ ├─runsv─┬─cat
│ │ │ │ └─dbus-run-sessio─┬─dbus-daemon
│ │ │ │ └─pipewire───{pipewire}
│ │ │ └─runsv─┬─mpd───12*[{mpd}]
│ │ │ └─svlogd
│ │ └─svlogd
│ ├─runsv───udevd
│ ├─runsv───sddm─┬─Xorg───9*[{Xorg}]
│ │ ├─sddm-helper───dwm─┬─2*[alacritty─┬─zsh]
│ │ │ │ └─9*[{alacritty}]]
│ │ │ ├─alacritty─┬─zsh───less
│ │ │ │ └─9*[{alacritty}]
│ │ │ ├─alacritty─┬─ncmpcpp
│ │ │ │ └─9*[{alacritty}]
│ │ │ ├─alacritty─┬─zsh───pstree
│ │ │ │ └─9*[{alacritty}]
│ │ │ └─chromium─┬─chromium───chromium───12*[{chromium}]
│ │ │ ├─chromium───chromium─┬─chromium───4*[{c+
│ │ │ │ ├─19*[chromium───1+
│ │ │ │ ├─chromium───17*[{+
│ │ │ │ ├─chromium───14*[{+
│ │ │ │ ├─chromium───3*[{c+
│ │ │ │ ├─chromium───19*[{+
│ │ │ │ ├─chromium───6*[{c+
│ │ │ │ └─chromium───8*[{c+
│ │ │ ├─chromium───9*[{chromium}]
│ │ │ ├─chromium───6*[{chromium}]
│ │ │ └─21*[{chromium}]
│ │ └─{sddm}
│ └─runsv───NetworkManager───2*[{NetworkManager}]
├─wireplumber───4*[{wireplumber}]
├─wpa_supplicant
├─4*[zsh───gitstatusd-linu───16*[{gitstatusd-linu}]]
├─8*[zsh]
└─zsh───sleep
The log for the mpd daemon shows the following error:
2023-02-15_11:38:07.28695 exception: Failed to open "PipeWire Audio Server" (pipewire); Failed to connect stream: Host is down
2023-02-15_11:38:07.28700 output: opened "my_fifo" (fifo) audio_format=44100:16:2
2023-02-15_11:38:07.28703 output: converting in=44100:24:2 -> f=44100:24:2 -> out=44100:16:2
For the connection of clients to the mpd server, I use a UNIX socket, and clients seem to be able to connect to it without any problem:
❯ mpc --host /home/localuser/.local/state/mpd/socket toggle
Billy Idol - Billy Idol - Mony Mony
[playing] #13/367 0:12/5:02 (3%)
volume:100% repeat: off random: off single: off consume: off
So, it seems the problem is that the mpd daemon cannot find the pipewire server.
If I run the mpd daemon as a regular process, either from the command line or at start up, everything works correctly.
Any ideas on how to make the mpd daemon run as a runit user service?
Thanks a lot.