Hi there,
I have a user service:
~/.config/sv/mpd/run:
#!/bin/sh
MPDCONF=${XDG_CONFIG_HOME:-$HOME/.config}/mpd/mpd.conf
exec mpd --no-daemon $MPDCONF
/etc/runit/myname_services:
#!/bin/sh
export USER="myname"
export HOME="/home/$USER"
groups="$USER"
svdir="$HOME/.service"
exec chpst -u "$USER:$groups" runsvdir "$svdir"
sv status ~/.service/mpd shows:
run: /home/myname/.service/mpd: (pid 1254) 11135s
mpc update shows:
Updating DB (#16) ...
volume:100% repeat: off random: off single: off consume: off
However whenever I try to play a song by adding it to the queue, e.g. mpc add /path/to/song.flac, I get:
error adding /path/to/song.flac: Access denied
This happens with any song. The song is in my home directory and my user has read access to it. mpd clients like ncmpcpp also don't work.
~/.config/mpd/mpd.conf:
# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
#
music_directory "~/music"
#
# This setting sets the MPD internal playlist directory. The purpose of this
# directory is storage for playlists created by MPD. The server will use
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
playlist_directory "~/.mpd/playlists"
#
# This setting sets the location of the MPD database. This file is used to
# load the database at server start up and store the database while the
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
db_file "~/.mpd/database"
###############################################################################
# General music daemon options ################################################
# This setting enables MPD to create playlists in a format usable by other
# music players.
#
save_absolute_paths_in_playlists "no"
# This setting enables automatic update of MPD's database when files in
# music_directory are changed.
#
auto_update "yes"
# Input #######################################################################
#
input {
plugin "curl"
# proxy "proxy.isp.com:8080"
# proxy_user "user"
# proxy_password "password"
}
#
###############################################################################
# Audio Output ################################################################
#
# MPD supports various audio output types, as well as playing through multiple
# audio outputs at the same time, through multiple audio_output settings
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
# pipewire conf
audio_output {
type "pipewire"
name "PipeWire Sound Server"
}