[systemd-devel] Systemd not correctly handle audio device acls for the active session?

Mantas Mikulėnas grawity at gmail.com
Fri Mar 28 08:22:58 PDT 2014


On Fri, Mar 28, 2014 at 2:33 PM, Kawing Chiu <kawing.chiu.sysu at gmail.com>
wrote:
> I get no sound in my desktop when using the following way to start the
> desktop: from a virtual terminal, say vt2, run:
>
> (setsid startx -- vt7 &).
>
> That is, startx in a virtual terminal other than the current one. The
> "setsid" is not relevant here, without it, (startx -- vt7 &) won't work,
> either. However, if I play something in the desktop and then SWITCH BACK
to
> vt2, the sound comes. If I log into another virtual terminal, for example,
> vt1, the sound comes, too. Just as long as I switch back to desktop on
vt7,
> the sound stops. Furthermore, if I start X by:
>
> (setsid startx -- vt2 &)
>
> that is, in the same virtual terminal, then all problems are gone,
> pulseaudio works perfectly.
>
> At first, I thought this is because pulseaudio cannot correctly recognize
> the current active session. But the pulseaudio developer told me that it
is
> because pulseaudio cannot get the permission to access audio devices under
> /dev/snd/*. And these permission is supposed to be set by systemd
> (https://bugs.freedesktop.org/show_bug.cgi?id=76672). I've checked that on
> my system: when in desktop(vt7), `getfacl /dev/snd/controlC0` gives no acl
> permission to the current user while running the same command in vt2 shows
> that correct acl permission is given to the current user.
>
>
> So I'm asking for help here. Is this a misconfiguration or a bug?

It's the way logind tracks the "activity" of sessions. If you log in on
vt2, the session is considered "active" *as long as vt2 is the foreground
terminal*.

So if you switch to vt7, the session is no longer active and access is
removed, since logind has no way of knowing that vt7 is being used by your
processes.

You have already found the correct way to fix this – start X on the
*same*vt that you logged in (e.g. `startx -- vt2` or `startx --
vt$XDG_VTNR`).

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140328/cd6ac4c4/attachment.html>


More information about the systemd-devel mailing list