Package: pulseaudio
Version: 0.9.21-3
Severity: normal
Tags: patch

Hi,

if PA is started as a X session daemon using the script under
/usr/bin/start-pulseaudio-x11, for example during startup of GNOME or
other desktop environments,  it will continue to run even if the X
session has ended. If you log into a VT after logging out of X you will
see something like this: 

        $ ps -fu 1000
        UID        PID  PPID  C STIME TTY          TIME CMD
        1000     15881     1  0 00:13 ?        00:00:00 /usr/bin/pulseaudio 
--start
        1000     16463 15730  0 00:14 tty2     00:00:00 -bash
        1000     16473 16463  0 00:15 tty2     00:00:00 ps -fu 1000

I think this is wrong because PA was started explicitly for the
X-session and should therefore exit with it.

This behaviour is not only annoying because you have needless processes
flying around, but apparently also causes several bugs:

 * #556971[1]: "pulseaudio does not remember volume settings, always set to 0"
 * #593746[2]: "pulseaudio doesn't support that $XAUTHORITY may have changed 
after logout/login"
 * #593952[3]: "hotplugging devices doesn't work completely if PA was started 
during earlier X-session"
 * maybe more?

The attached patch is a dirty hack to shutdown PA once the X-session has
ended. I know that this is no proper way to get the job done, but I
spent the last hour googling for some way to detect the end of a
X-session and didn't find anything remotely useful. This solution
a) does at least work
b) uses very few ressources (almost none)

I therefore think it's a good starting point, however I very much hope
that someone comes up with something not that ugly.

Best regards

Alexander Kurtz

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=556971#12
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593746
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593952
diff -ru old/usr/bin/start-pulseaudio-x11 new/usr/bin/start-pulseaudio-x11
--- old/usr/bin/start-pulseaudio-x11	2010-08-23 00:10:35.695615831 +0200
+++ new/usr/bin/start-pulseaudio-x11	2010-08-23 00:11:53.349215268 +0200
@@ -32,3 +32,8 @@
 	/usr/bin/pactl load-module module-x11-xsmp "display=$DISPLAY session_manager=$SESSION_MANAGER" > /dev/null
     fi
 fi
+
+{
+	xprop -root -spy > /dev/null 2>&1 || true
+	pulseaudio --kill
+} &

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
pkg-pulseaudio-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-pulseaudio-devel

Reply via email to