0

I try to run mpd on fedora 23 using alsa (pulseaudio removed). However, when running mpd as user "mpd", I get

alsa_output: Error opening default ALSA device: Permission denied

So I ran it as user root, and everything is fine. Ok, permission problem - its just that I don't understand why its not working as user mpd - permissions look fine to me:

/dev/snd:
total 0
crw-rw----+ 1 root audio 116,  0 Jan  1  1970 controlC0
crw-rw----+ 1 root audio 116, 16 Jan  8 20:38 pcmC0D0p
crw-rw----+ 1 root audio 116, 17 Jan  1  1970 pcmC0D1p
crw-rw----+ 1 root audio 116,  1 Jan  1  1970 seq
crw-rw----+ 1 root audio 116, 33 Jan  1  1970 timer
[root@sh02 ~]# grep audio /etc/group
audio:x:63:isaac,mpd
[root@sh02 ~]# getenforce 
Permissive

And of course I have rebootet just to make sure everything gets properly initialized. Anyone got an idea what is missing to let mpd acces my audio device? I could probably add some acl to allow mpd explicit access - but in my understanding the group membership should be sufficient ???

EDIT This are the permissions of the mpd config file:

-rw-r-----. 1 root root system_u:object_r:mpd_etc_t:s0 13585 Jan  8 22:04 /etc/mpd.conf

Notice that mpd can run as user mpd if using the pulse output plugin. But because pulse did stutter and also sometimes not start, I decided not to use pulse but use the alsa output.

There are no .mpdconf files in any homes.

  • Do you have a file in your home called ~/.mpdconf? If so, what permissions does it have? What permissions has the file /etc/mpd.conf? – nKn Jan 10 '16 at 21:46
  • I have updated my question with the requested info. – Isaac Jan 11 '16 at 19:16
2

Adding acls to explicitly allow mpd access to the sound devices solved the problem:

sudo setfacl -m u:mpd:rw /dev/snd/*

Bevor doing this, the acls were like this:

# file: dev/snd/controlC0
# owner: root
# group: audio
user::rw-
user:lightdm:rw-
group::rw-
mask::rw-
other::---

# file: dev/snd/pcmC0D0p
# owner: root
# group: audio
user::rw-
user:lightdm:rw-
group::rw-
mask::rw-
other::---

# file: dev/snd/pcmC0D1p
# owner: root
# group: audio
user::rw-
user:lightdm:rw-
group::rw-
mask::rw-
other::---

# file: dev/snd/seq
# owner: root
# group: audio
user::rw-
user:lightdm:rw-
group::rw-
mask::rw-
other::---

# file: dev/snd/timer
# owner: root
# group: audio
user::rw-
user:lightdm:rw-
group::rw-
mask::rw-
other::---

Since mpd was already member of the audio group, these acls should have been sufficient. I will give the bounty to the one able to explain what was going on here.

| improve this answer | |
-1

You must add the user to the audio group:

usermod -aG audio [user]

Logout and and back in. You should be able to use audio.

| improve this answer | |
  • Please read the question properly. The user was already member of the audio group. It did not work, even though it should have, according to group permissions. Which is why I posted this question in the first place :) – Isaac Mar 27 '18 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.