[pulseaudio-discuss] logged in twice using pulse
Lennart Poettering
lennart at poettering.net
Wed Jul 16 11:50:00 PDT 2008
On Thu, 10.07.08 09:33, Ken Mandelberg (km at mathcs.emory.edu) wrote:
> We are running Ubuntu 8.04 on a Sunray (thin client) server. Every thin
> client login gets its own AUDIODEV and its own pulseaudio server.
>
> However, it is possible for the same user to have simultaneous logins
> from different locations on different thin clients. The first obstacle
> to this is the single pid file per uid, which can be sort of worked
> around by using --use-pid-file=false.
>
> The second obstacle is that pulseaudio uses a variety of uid named unix
> domain sockets, which are unavailable to the second instance.
>
> Is there any workaround for this?
PA is supposed to be a per-user daemon, not a per-session daemon. In
the git version of PA i added support for sharing a single version of
PA easily between multiple sessions of the same user. To do this I
made four changes:
- There's now a command line option --start that spawns a new PA
daemon if no instance is already running for the calling user. After
the command returns it is guaranteed that PA finished starting up.
- I modified the XSMP module to register the session as a "client"
inside PA
- I added a ConsoleKit module to register each session as a "client"
inside PA.
- I enabled autospawning and auto-exit-on-idle by default.
Also, PA should then no longer bestarted via the "esd" wrapper script
from gnome-session. Instead it should be started via a sample
shellscript from XDG autostart:
<snip>
#!/bin/sh
pulseaudio --start
pactl load-module module-x11-xsmp display="$DISPLAY" session_manager="$SESSION_MANAGER"
pactl load-module module-x11-publish display="$DISPLAY"
</snip>
This way for each session we load a new set of X11 modules into the sound
server, which will automatically be unloaded when the respective
session ends. A few seconds after the last session using the PA
instance terminated PA will terminate too.
With a bit of hackery you can do something similar in the released
versions too. For that to work you need to write some non-trivial
shell scripts however, that make sure the X11 modules are unloaded at
the right time -- because otherwise stupid libX11 will kill us at
inappropriate times.
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss
mailing list