You are not logged in.

#1 2017-02-06 04:39:23

virtualdxs
Member
Registered: 2017-02-06
Posts: 6

Xorg and Login-based Audio

Note: I am on a phone, so please excuse my brevity.

I got fed up with xinit and startx so I decided to write my own startx script. Now it mostly works great, except for one thing: Audio will only play on VTs I have done a text login on. So if I log into tty1 and start X on tty2, audio will only play when tty1 is active. I have tried the following:

- Chowning and chmodding tty2 to duncan:tty and 0600 (this is the behavior I see when I log into a tty)
- Using openvt -fuc to attempt to allocate the tty to me. This results in the behavior noticed in the previous bullet, but does not fix the sound.

What can I do to fix this? It seems I need to somehow "claim" the tty but even openvt doesn't seem to be enough.

Last edited by virtualdxs (2017-02-06 04:39:50)

Offline

#2 2017-02-06 09:42:56

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: Xorg and Login-based Audio

Afaik systemd's loginctl 'Active' flag determines whether or not the sound will play for a given session. I know this is set to 'yes' when you log in to the VT normally first (text login) or when you use a greeter such as GDM.
You can check your session information with the command below. I suspect it will say 'Active=no' for your second session.

loginctl show-session ${XDG_SESSION_ID}

I do not know how you'd make loginctl mark a session as active manually though.

Last edited by Omar007 (2017-02-06 09:43:16)

Offline

#3 2017-02-06 13:53:23

virtualdxs
Member
Registered: 2017-02-06
Posts: 6

Re: Xorg and Login-based Audio

Thanks! I'll look into that today.

Offline

#4 2017-02-06 18:12:10

virtualdxs
Member
Registered: 2017-02-06
Posts: 6

Re: Xorg and Login-based Audio

Update: I just discovered that this only happens if the X server has been started at least once since boot. Even if I open another tty and log in as a different user, audio played by the first user continues. But the moment I start the X server, these policies are applied.

Offline

Board footer

Powered by FluxBB