[pulseaudio-discuss] system-wide daemon

Colin Guthrie gmane at colin.guthr.ie
Tue Feb 9 06:27:35 PST 2010


'Twas brillig, and Markus Rechberger at 09/02/10 08:43 did gyre and gimble:
> On Tue, Feb 9, 2010 at 9:38 AM, Colin Guthrie <gmane at colin.guthr.ie> wrote:
>> 'Twas brillig, and Markus Rechberger at 09/02/10 02:16 did gyre and gimble:
>>> On Tue, Feb 9, 2010 at 3:01 AM,  <olin.pulse.7ia at shivers.mail0.org> wrote:
>>>> Bill Cox:
>>>>> While the "right" way is not system-wide mode, in practice, I find
>>>>> system-wide mode to be very stable and usable on Ubuntu systems that
>>>>> have multiple users trying to send sound to the speakers.
>>>>
>>>> So, I'm still wondering: what *is* the "right way" for this use case? Is it
>>>> the case that PulseAudio just doesn't address it?
>>>
>>> There is no right way pulseaudio was not designed to support multiple
>>> users at the same time (without the depreciated exception of running
>>> it as system wide daemon).
>>
>> Indeed. PA is principally meant to be run per-user. Each user logged in
>> will have their own PA process running and each will monitor a system
>> service called "ConsoleKit" which tracks which user is active. We adhere
>> to whatever ConsoleKit tells us with regards to which user is currently
>> "active" (see ck-list-sessions) and only the active user has access to
>> the sound hardware.
>>
>> Think about how switching users works (on Linux and on Windows/OSX).
>> Only the user whose desktop is currently presented will be allowed to
>> use sound, the other user's sound is "corked" until they become active
>> again.
> 
> 
> Bad example as usual, on OSX everyone (who's permitted to use the
> audio unit) can just log in and use the audio unit.

Can you demonstrate this?

In the past when I've tested this behaviour on OSX (it was quite a while
ago) it behaves exactly as I described above, and I've literally just
now re-tested this on a colleagues Mac (latest version):

 1. Enable "Fast User Switching" (System Settings -> Accounts -> Login
Options).
 2. Login as user.
 3. Fast user switch (top right, next to clock) to a different user.
 4. With new user download and run e.g. VLC or iTunes.
 5. Start playing  some tunes.
 6. Fast user switch back to your original user.
 7. Note the blissful silence.
 8. Do whatever you like with the original user login. Play tunes, check
mail etc.
 9. Switch back to the user who *was* playing.
 10. If you used iTunes, it will now be in the Pause state so will be
quiet. If you used VLC the music will continue playing now the user is
active again.

I guess the reason there is a difference between iTunes and VLC is that
iTunes presumably listens to the "cork" notifications from CoreAudio and
issues an application level pause, whereas VLC does not and thus is
forcibly corked, but will automatically play again.

This is *exactly* the same behaviour as we promote in PulseAudio too.

If you can show me something that proves the above invalid, I'm all
ears, but I'm pretty confident that what I said originally is correct
and the above test seems to support that.

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list