FS#30926 - [pulseaudio] wrong entries in /etc/X11/xinit/xinitrc.d/pulseaudio
Attached to Project:
Arch Linux
Opened by Heinrich Siebmanns (Harvey) - Monday, 30 July 2012, 18:37 GMT
Last edited by Jan Alexander Steffens (heftig) - Wednesday, 12 February 2014, 09:35 GMT
Opened by Heinrich Siebmanns (Harvey) - Monday, 30 July 2012, 18:37 GMT
Last edited by Jan Alexander Steffens (heftig) - Wednesday, 12 February 2014, 09:35 GMT
|
Details
/etc/X11/xinit/xinitrc.d/pulseaudio tests for:
________________________________ #!/bin/bash case "$DESKTOP_SESSION" in gnome|kde*|xfce*|default) # PulseAudio is started via XDG Autostart ;; *) # Extra checks in case DESKTOP_SESSION is not set correctly if [[ -z $KDE_FULL_SESSION && -z $GNOME_DESKTOP_SESSION_ID ]]; then /usr/bin/start-pulseaudio-x11 fi ;; esac ________________________________________ but the usual var in this context is DESKTOP_SESSION="default" so the pulseaudio daemon get started by this script as well as the two (!) other entries /etc/xdg/autostart/pulseaudio-kde.desktop and also nano /etc/xdg/autostart/pulseaudio-kde.desktop resulting in two entries in /var/log/errors like this: [pulseaudio] pid.c: Daemon already running |
This task depends upon
Closed by Jan Alexander Steffens (heftig)
Wednesday, 12 February 2014, 09:35 GMT
Reason for closing: Fixed
Additional comments about closing: 4.99.3-1, in [testing]
Wednesday, 12 February 2014, 09:35 GMT
Reason for closing: Fixed
Additional comments about closing: 4.99.3-1, in [testing]
gnome|kde*|xfce*) # PulseAudio is started via XDG Autostart
and therefore skips the line because of $DESKTOP_SESSION = 'default'. By adding default to the case line it skips and lets pulseaudio get started via xdg startup from /etc/xdg/autostart/pulseaudio-kde.desktop which has
Exec=start-pulseaudio-kde
in it. So I got rid of one of the two "[pulseaudio] pid.c: Daemon already running" errors. After that I moved /etc/xdg/autostart/pulseaudio.desktop out of the path which has
Exec=start-pulseaudio-x11
in it and thus tries to start pulseaudio another time. Now the second "[pulseaudio] pid.c: Daemon already running" error is gone.
Pulseaudio runs and sound is o.k.
Done?
Could I have a full environment dump, please?
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-Uvx4GXI1U2,guid=787a92047f0c2d755cb6da10503d1358"
declare -x DESKTOP_SESSION="default"
declare -x DISPLAY=":0"
declare -x DM_CONTROL="/var/run/xdmctl"
declare -x GTK_MODULES="canberra-gtk-module"
declare -x G_BROKEN_FILENAMES="1"
declare -x HOME="/home/harvey"
declare -x J2REDIR="/usr/lib/jvm/java-7-openjdk/jre"
declare -x J2SDKDIR="/usr/lib/jvm/java-7-openjdk"
declare -x JAVA_HOME="/usr/lib/jvm/java-7-openjdk"
declare -x LANG="de_DE.UTF-8"
declare -x LC_COLLATE="C"
declare -x LOGNAME="harvey"
declare -x MOZ_PLUGIN_PATH="/usr/lib/mozilla/plugins"
declare -x OLDPWD
declare -x PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl"
declare -x PWD="/home/harvey"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x USER="harvey"
declare -x WINDOWPATH="7"
declare -x XDG_CACHE_HOME="/home/harvey/.cache"
declare -x XDG_CONFIG_DIRS="/etc/xdg"
declare -x XDG_CONFIG_HOME="/home/harvey/.config"
declare -x XDG_DATA_DIRS="/usr/local/share/:/usr/share/"
declare -x XDG_DATA_HOME="/home/harvey/.local/share"
declare -x XDG_SESSION_COOKIE="ec213935c21a498fa451a9891a73a9ca-1346179928.527312-1380516639"
declare -x XDM_MANAGED="method=classic"
I had this idea before too. But in the context of the executed script /etc/xdg/autostart/pulseaudio.desktop there is no env var that points to KDE. They all get set in the user context. If I do 'export' in a user context there is at least KDE_FULL_SESSION="true". But this seems to get set later than the execution of the pulseaudio script and therefore the fallback line
if [[ -z $KDE_FULL_SESSION && -z $GNOME_DESKTOP_SESSION_ID ]]; then
won't fire either.
Not very helpful, unfortunately.
I have a very similar issue here.
I use a customized windows manager that has been developed by the Qubes-OS team. Meaning it's not gnome, nor kde, nor xfce. The problem is that this for-mentioned script has been changed to :
case "$DESKTOP_SESSION" in
gnome|kde*|xfce*) # PulseAudio is started via XDG Autostart
;;
This cause start-pulse-audio-x11 to starts, before xdg autostart targets. If 'default' cannot be used because kde broke the thing, I don't have any way to avoid pulseaudio to start except faking a gnome/kde desktop environment.
Is it possible to add some value like 'other' in order to allow users to bypass pulseaudio autostart ?
In fact, is this script needed at all ? Because it force users that installed pulseaudio to run pulseaudio.
I think PulseAudio should autostart, unlike Olivier Médoc, since JACK interop is basically fixed (via dbus handshakes) and PulseAudio has a decent ALSA emulation backend. If it's installed, it should autostart.
But as I often run Openbox with a variety of apps from KDE and GNOME and elsewhere, not just stock desktop assumptions, I do find Arch scripts can fail to adequately address non-standard DEs. So I'm with Olivier there. Make script cases include unknown/undefined clauses.
An up-to-date KDE stock rig has empty $DESKTOP_SESSION while $KDE_FULL_SESSION gives "true" and meanwhile, perhaps unrelated, pavucontrol is core dumping all over me, sigh.
I'm using Xfce and adding 'echo $DESKTOP_SESSION >> env_var.txt' into /etc/X11/xinit/xinitrc.d/pulseaudio shows that my DESKTOP_SESSION is correctly set to 'xfce'. Nevertheless, I'm getting an error on boot that pulseaudio is trying to start after it already started. I can prevent this error by moving one of the following files to my home directory: /etc/xdg/autostart/pulseaudio.desktop or /etc/X11/xinit/xinitrc.d/pulseaudio. This means both files are starting pulseaudio. I understand why /etc/xdg/autostart/pulseaudio.desktop is starting pulseaudio because that's what it's supposed to do when Xfce starts. But, why is /etc/X11/xinit/xinitrc.d/pulseaudio also starting pulseaudio? Here are the contents of /etc/X11/xinit/xinitrc.d/pulseaudio:
#!/bin/bash
case "$DESKTOP_SESSION" in
gnome|kde*|xfce*) # PulseAudio is started via XDG Autostart
;;
*)
# Extra checks in case DESKTOP_SESSION is not set correctly
if [[ -z $KDE_FULL_SESSION && -z $GNOME_DESKTOP_SESSION_ID ]]; then
/usr/bin/start-pulseaudio-x11
fi
;;
esac
I tried commenting out the "Extra checks" but that didn't solve anything.I tried replacing '/usr/bin/start-pulseaudio-x11' with 'touch /home/colin/tried-pulseaudio'. But it still started pulseaudio a 2nd time and it did not create /home/colin/tried-pulseaudio.
So why does moving /etc/X11/xinit/xinitrc.d/pulseaudio to my home directory solve the problem? It seems that if there's a file called pulseaudio in /etc/X11/xinit/xinitrc.d, it will try to start pulseaudio regardless of contents. I will test that out.
It seems as though none of these files are necessary. How can I find out what is actually starting pulseaudio?
FS#38412- [pulseaudio] pid.c: Daemon already running, Prevent by modifying ...xinitrc.d/pulseadio & PKGBUILD (https://bugs.archlinux.org/task/38412) that I have reported.