Pulseaudio not recognize active session correctly under some circumstance
Submitted by Kevin
Assigned to pul..@..op.org
Description
I get no sound in my desktop when using the following (a bit usual) 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 &) don't work, either.
But, 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.
I guess this is because pulseaudio fails to recognise the active session: if I run pacmd list-sinks
in the desktop(vt7), it shows that the status of the active sink is "SUSPENDED" and the suspend cause is "SESSION" while running the same command in vt2 shows the status is "RUNNING".
Also, loginctl user-status
shows that, all processes of my desktop(vt7) and vt2 belong to the same session (in systemd's notion).
And if I start X by:
(setsid startx -- vt2 &)
that is, in the same virtual terminal, then all problems are gone, pulseaudio works perfectly.
I'm using arch linux, mate desktop(1.8.0), pulseaudio(5.0), all packages are from arch's official repository.