[pulseaudio-discuss] starting multiple pulseaudio instances for the same user

Antoine Martin antoine at nagafix.co.uk
Wed Apr 13 09:13:16 PDT 2011


I have found a  workaround for this problem by setting a different $HOME
before launching each pulseaudio instance for the same $USER.

Since the pid file option says:
"use-pid-file= Create a PID file in /tmp/pulse-$USER/pid. Of this is
enabled you may use commands like --kill or --check. If you are planning
to start more  than  one  PulseAudio process per user, you better
disable this option since it effectively disables multiple instances.
Takes a boolean argument, defaults to yes. The --no-cpu-limit command
line option takes precedence."
I think it is fair to assume that multiple instances per user should
work, shouldn't it?

The problem seems to come from the softlink from:
$HOME/.pulse/${MACHINE_ID}-runtime
Where MACHINE_ID=`cat /var/lib/dbus/machine-id`
And when this link exists you cannot start another instance as it will
block on the autospawn.lock.
(tested on a fully up to date Fedora 14 system)

Thanks
Antoine







On 04/09/2011 03:20 AM, Antoine Martin wrote:
> Hi,
> 
> How can I start multiple copies of pulseaudio for the same $USER, but in
> different contexts?
> This was working a while back (last year or so - not sure about version
> numbers).. but doesn't any more?
> 
> My software starts a virtual X server (xpra, vnc..), dbus and a
> dedicated pulseaudio server for each "session application" it launches.
> This allows it to redirect the sound (in and out) to/from remote
> machines (potentially multiple at once too, some directly, some via
> gstreamer+vorbis over ssh) - all this together with the display. see (1)
> 
> Each "application session" gets its own environment and starts
> pulseaudio with:
> /usr/bin/pulseaudio --start -vvvv --disable-shm=true --daemonize=false
> --use-pid-file=false --system=false --exit-idle-time=-1 -n
> --load=module-suspend-on-idle --load=module-null-sink
> "--load=module-native-protocol-unix socket=/tmp/pulse-$DISPLAY/native"
> 
> A single $USER may start dozens of those sessions, each with a different
> (virtual) $DISPLAY.
> Now, when I start the second instance I can see that it somehow finds
> the previous copy (not the one used by my local X11 session)
> [pid  3044]
> open("/home/antoine/.pulse/70a1ab2a8c9d6cb7625f17060000000d-runtime/autospawn.lock",
> O_RDWR|O_CREAT|O_NOCTTY|O_NOFOLLOW, 0600) = 5
> [pid  3044] fcntl(5, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0,
> len=0}
> From that point onwards, nothing happens.
> 
> Can you please advise on how to restore this functionality?
> 
> Thanks
> Antoine
> 
> (1)
> http://winswitch.org/
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss




More information about the pulseaudio-discuss mailing list