You are not logged in.

#1 2018-07-08 20:57:04

go4linux
Member
Registered: 2018-07-04
Posts: 19

[SOLVED] Putting users in audio group to make sound work

According to the wiki there should be no users in the audio group. However, if I don't do it the only output I have is a "dummy output" in pulseaudio, and I get nothing in alsamixer either. Root can play sounds.
Looking around, everywhere I read that the solution is to add the user to the audio group.

In my case it wouldn't be a real problem to add the user to the audio group, considering the reason to not do it. However, if people discourage it there must be a better solution.
Can anybody explain this?

Last edited by go4linux (2018-07-09 09:33:03)

Offline

#2 2018-07-08 20:58:41

loqs
Member
Registered: 2014-03-06
Posts: 17,416

Re: [SOLVED] Putting users in audio group to make sound work

systemd should automatically make audio devices available to locally logged in user sessions.
edit:

$ getfacl /dev/snd/controlC0
getfacl: Removing leading '/' from absolute path names
# file: dev/snd/controlC0
# owner: root
# group: audio
user::rw-
user:testuser:rw-
group::rw-
mask::rw-
other::---
$ groups
users

Last edited by loqs (2018-07-08 21:06:10)

Offline

#3 2018-07-08 21:32:04

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,754

Re: [SOLVED] Putting users in audio group to make sound work

Likely your audio device is hogged by something else, what does

sudo fuser -v /dev/snd/*

return for you? If that isn't your own user's pulseaudio for every device, there's something to fix at another point than adding users to the audio group.

Offline

#4 2018-07-09 08:14:44

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [SOLVED] Putting users in audio group to make sound work

Sounds more like a broken session or a remote login than something highjacking the card. See if sound works on a plain tty.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#5 2018-07-09 09:00:51

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] Putting users in audio group to make sound work

loqs wrote:

systemd should automatically make audio devices available to locally logged in user sessions.

I am afraid this is not the case:

$ getfacl /dev/snd/controlC*
getfacl: Removing leading '/' from absolute path names
# file: dev/snd/controlC0
# owner: root
# group: audio
user::rw-
group::rw-
mask::rw-
other::---

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

# file: dev/snd/controlC2
# owner: root
# group: audio
user::rw-
group::rw-
mask::rw-
other::---
$ getfacl /dev/snd/pcmC*
getfacl: Removing leading '/' from absolute path names
# file: dev/snd/pcmC0D3p
# owner: root
# group: audio
user::rw-
group::rw-
mask::rw-
other::---

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

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

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

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

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

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

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

# file: dev/snd/pcmC2D0c
# owner: root
# group: audio
user::rw-
group::rw-
mask::rw-
other::---
V1del wrote:

Likely your audio device is hogged by something else, what does

sudo fuser -v /dev/snd/*

return for you?

Empty.
After all, if I don't have rights on the files, it makes sense.

Mr.Elendig wrote:

Sounds more like a broken session or a remote login than something highjacking the card. See if sound works on a plain tty.

okay, this is really weird.

I start XFCE from xinit, so to go to console only I just log out.
I tried a few times this test command:

speaker-test -Dfront:Generic -c2

this doesn't work from a terminal in XFCE, and it didn't work from a console. However, when I tried it as root, and then again as a normal user, it worked (from the console).

But the funny thing came after that.
I started XFCE  again, went on  youtube, and the videos just wouldn't play. They wouldn't even start.
Then I went on a tty, XFCE still running, and from the console I could hear the music of the youtube video. Switched back to the XFCE screen and the video stopped.

Really weird stuff

Offline

#6 2018-07-09 09:04:19

loqs
Member
Registered: 2014-03-06
Posts: 17,416

Re: [SOLVED] Putting users in audio group to make sound work

Offline

#7 2018-07-09 09:12:19

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] Putting users in audio group to make sound work

Ah, very interesting, thank you. I get Active=no when I run loginctl.
Now, I login on the 1st tty, but X starts on the second. That is, just to be clear, I do Ctrl-Alt-F2 to go to X, where I do Ctrl-Alt-F1 to go to my original login shell.
So maybe the problem is that I don't run a login manager.

But can I run X on the same tty without a login manager? I would like, at least for the time being, to use xinit.

Offline

#8 2018-07-09 09:15:37

loqs
Member
Registered: 2014-03-06
Posts: 17,416

Re: [SOLVED] Putting users in audio group to make sound work

Do you use autologin?  How do you start X on a different TTY?

Offline

#9 2018-07-09 09:31:07

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] Putting users in audio group to make sound work

loqs wrote:

Do you use autologin?  How do you start X on a different TTY?

I just login on console and do xinit. My .xinitrc is

exec startxfce4

Anyway, I found a solution:

https://bbs.archlinux.org/viewtopic.php?id=173229

Seems to work now. Thanks guys.

Last edited by go4linux (2018-07-09 09:32:45)

Offline

#10 2018-07-09 10:24:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,754

Re: [SOLVED] Putting users in audio group to make sound work

You should read the second blue note in https://wiki.archlinux.org/index.php/Xinit#xinitrc

Offline

#11 2018-07-09 11:16:57

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] Putting users in audio group to make sound work

V1del wrote:

You should read the second blue note in https://wiki.archlinux.org/index.php/Xinit#xinitrc

Adding xinitrc.d? Yes, it looks like it's important, thank you. One of those scripts does something with xauthority. I changed ~/.xinitrc
But it still looks like I have to use the vt1 option, because if I can't start X in the same terminal it just doesn't seem to work.
I wonder if I should add that to the wiki.

Offline

#12 2018-07-09 11:49:40

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,754

Re: [SOLVED] Putting users in audio group to make sound work

depends on what you are using, a simple argumentless startx should default to the active vt and parse that file, if you use xinit or similar with any other arguments you tell it to ignore the .xinitrc and instead do something else.

Offline

#13 2018-07-09 17:06:30

go4linux
Member
Registered: 2018-07-04
Posts: 19

Re: [SOLVED] Putting users in audio group to make sound work

V1del wrote:

depends on what you are using, a simple argumentless startx should default to the active vt and parse that file, if you use xinit or similar with any other arguments you tell it to ignore the .xinitrc and instead do something else.

But if put the arguments after '--' they should go to the server, right? So if I say

xinit -- vt1

the xinitrc should still be executed. After all, I wouldn't be able to start XFCE if xinitrc wasn't executed
It would actually be nice to start xinit without the vt1 option, but I don't think there is a way. I don't think I can do it just by changing the xinit files. Those are for the client, I believe.

EDIT: it seems that adding the files in xinitrc.d allows me to shutdown without logging in as root. Interesting.

Last edited by go4linux (2018-07-09 17:12:26)

Offline

#14 2018-07-10 12:57:34

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,952

Re: [SOLVED] Putting users in audio group to make sound work

EDIT: it seems that adding the files in xinitrc.d allows me to shutdown without logging in as root. Interesting.

https://wiki.archlinux.org/index.php/Xinit#xserverrc


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB