FS#26608 - [pulseaudio] 1.1-1 Allow to start system instance

Attached to Project: Arch Linux
Opened by Olivier Mehani (shtrom) - Tuesday, 25 October 2011, 06:31 GMT
Last edited by Jan Alexander Steffens (heftig) - Friday, 17 February 2012, 18:36 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

This seems to be a common problem. Some applications such as MPD running as a system user do not cope well with PulseAudio being launched on a per-session basis, and the Pulse instances fight with the X session to get hold of the sound card, instead of mixing nicely.

At the moment, PulseAudio is launched either 1) by the (Gnome|KDE|XFCE) session 2) xinitrc script packaged with the pulseaudio package. I'm running FVWM, so I'm in the latter case, and really am the only user of my machine, but switching back and forth between X sessions.

It would be good if the PulseAudio created relevant users, and provided an rc.d script and the possibility to toggle (e.g. via a conf.d file) between starting PulseAudio per user or systemwide (or deactivate it altogether).

An old HowTo for Ubuntu illustrates the idea [0]. Some documentation on the MPD and ArchLinux wikis also supports this approach [1,2].

[0] http://www.ubuntugeek.com/how-to-setup-mpd-with-pulseaudio-independent-on-x.html
[1] http://mpd.wikia.com/wiki/PulseAudio
[2] https://wiki.archlinux.org/index.php/Music_Player_Daemon#MPD_.26_PulseAudio

Additional info:
* pulseaudio 1.1-1
* mpd 0.16.5-1

Steps to reproduce:
* configure MPD to output sound wia Pulse
* rc.d start mpd gdm
* log in with session FVWM (though I'm sure it would be the same with Gnome et al.)
* start playing whatever sound in the X session
* use and MPD client to start playback
* playback cannot start, and MPD complains that 'mpd: output: "My Pulse Output" [pulse] failed to play: suspended'
This task depends upon

Closed by  Jan Alexander Steffens (heftig)
Friday, 17 February 2012, 18:36 GMT
Reason for closing:  Won't implement
Additional comments about closing:  The pulseaudio package will not support system mode. Set it up yourself if you need it.

http://www.pulseaudio.org/wiki/WhatIsWro ngWithSystemMode
Comment by Jason William Walton (jasonww) - Wednesday, 26 October 2011, 09:30 GMT
I doubt you will see much support for this. System instances of pulseaudio are discouraged by upstream and not well supported. In Arch, the required groups were removed somewhere around 0.9.22. The mpd wiki is wrong to assume that it should be started as a different user for normal usage.
Comment by Olivier Mehani (shtrom) - Wednesday, 26 October 2011, 23:06 GMT
I'm aware of this, but this is annoying nonetheless. I have Gnome installed. It pulls PA as a dependency, which then starts itself with *every* X11 session (that is not Gnome, KDE or XFCE, as they start it themselves).

Not considering system instances here, it would be good to, at least, be able to deactivate PA for X11 sessions.

If system-wide PA is not the way to go (which everybody seems to agree on), then I would like to do away with it, so it doesn't do thing I don't want with my sound card, and let me manage it myself.

I've played around with the pulseaudio package in AUR, and modified it so the pulseaudio.xinit now sources a /etc/conf.d/pulseaudio. This file comes with the package as well, and can optionally define a variable, say X11_DISABLE_PULSE, which, when defined, prevents pulseaudio.xinit from starting with X11.

if [ -z "$X11_DISABLE_PULSE" ]; then
/usr/bin/start-pulseaudio-x11
fi

I have nothing against PA itself, and the ideas behind it seem sound, but it specifically prevents me from using my system the way I want to, and this really annoys me.
Comment by Aaron Hurt (leprechau) - Friday, 17 February 2012, 18:25 GMT
I know it's probably not the best way .. but I've been resolving this myself for quite awhile by just creating a simple shell script in my home directory called audiohack.sh that does 'sudo killall pulseaudio > /dev/null 2>&1' ... I create a ~/.config/autostart/audiohack.desktop file for it and everything works great and the only pulseaudio running is my own.

Loading...