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