Where is pulseaudio started?

Steven W. Orr steveo at syslang.net
Thu Aug 27 04:16:33 UTC 2009

On 08/26/09 20:45, quoth Marko Vojinovic:
> Ok Steven, let me do a google search on "pulseaudio home page", follow the 
> first link which reads www.pulseaudio.org, click on the "documentation" link, 
> scroll down to "KDE" and read http://www.pulseaudio.org/wiki/PerfectSetup#KDE 
> for you here. It says:
> <quote>
> KDE 4 uses Phonon as the main audio interface. The Xine backend of Phonon 
> should eventually use PulseAudio automatically, but at the time of writing the 
> pulse plugin for Xine is too unreliable, so it's disabled by default. While 
> waiting for that to get better, Phonon uses Alsa. Therefore, to get Phonon to 
> use PulseAudio, you have to edit your ~/.asoundrc or /etc/asound.conf.
> </quote>
> So when your favorite KDE app tries to play some sound, it talks to Phonon, 
> which either uses xine backend to talk to pulseaudio directly, or uses alsa. 
> Now let me scroll back to the top of the page and read 
> http://www.pulseaudio.org/wiki/PerfectSetup#ALSAApplications for you:
> <quote>
> If the PulseAudio plugin for alsalibs is installed all applications with 
> support for the ALSA API should be able to access a PulseAudio server. You 
> need version 1.0.12 or newer of the ALSA packages for the PulseAudio plugin to 
> be included.
> To activate the driver edit /etc/asound.conf or ~/.asoundrc and add:
> pcm.pulse {
>     type pulse
> }
> ctl.pulse {
>     type pulse
> }
> Now you you can access the PulseAudio server under the virtual ALSA device 
> pulse:
> % aplay -Dpulse foo.wav
> % amixer -Dpulse
> If you want to make the PulseAudio driver the default, use something like this 
> in the ALSA configuration files:
> pcm.!default {
>     type pulse
> }
> ctl.!default {
>     type pulse
> }
> </quote>
> Now let me take a look at /etc/asound.conf and ~/.asoundrc instead of you, and  
> find that this is precisely how a default Fedora system is configured.
> So how does it work? Open your favorite sound app, and ask it to play some 
> music. If it is a typical KDE app, it will utilize Phonon, which redirects to 
> ALSA, where pulseaudio plugin for alsa takes over, checks if the pulseaudio 
> binary is already running and transfers audio handling to it. If it is not 
> running, the plugin launches /etc/pulse/default.pa, which is an equivalent of 
> an userland "init script" for pulseaudio. It launches the actual binary. Look 
> at the first line:
> #!/usr/bin/pulseaudio -nF
> This is where it actually gets executed. (I hope you are familiar with the 
> "sha-bang" syntax.)
> Now, once executed, pulseaudio starts receiving signals to be played from all 
> apps that try to use it natively, or try to use ALSA or ESD or Phonon or 
> whatever. All these signals get mixed and sent to ALSA sound driver which 
> talks to actual hardware to play the sound.
> So in a nutshell, whatever your app tries to use as a sound interface, it gets 
> eventually rerouted to pulseaudio, which gets executed if it is not running 
> already. If it doesn't get rerouted to pulseaudio, something is broken 
> (typically the app itself), and you don't get any sound from that app by 
> default. File a bug against it.
>>>> Can pulseaudio be simply shut OFF?
> I don't think so, at least not so easily. As you can see above, it is way too 
> much integrated in the system. There is no single place where it is invoked 
> and where it could be "shut off". You need to uninstall it altogether and let 
> every app find it's own way to fallback to alsa.
>> Unfortunately, I am running KDE-4.2.4 and if there's a way to shut the
>> little stinker off, I'd be grateful to know how.
> AFAICS, KDE is using Xine backend by now, which talks to pulseaudio natively. 
> I don't think that you can find an option to shut it down and use alsa. But do 
> take a look at systemsettings -> Multimedia, maybe there you can set 
> preferences the way you like. Here I talk about the latest KDE 4.3, you should 
> probably yum update.
>> I have no idea what it is that pulseaudio is supposed to actually do that
>> I'm supposed to like about it. I used to have sound. I still have sound.
> Let me read the very first sentence from http://www.pulseaudio.org/  for you:
> <quote>
> PulseAudio is a sound server for POSIX and Win32 systems. A sound server is 
> basically a proxy for your sound applications. It allows you to do advanced 
> operations on your sound data as it passes between your application and your 
> hardware. Things like transferring the audio to a different machine, changing 
> the sample format or channel count and mixing several sounds into one are 
> easily achieved using a sound server.
> </quote>
> Then let me click on "About pulseaudio" link and read 
> http://www.pulseaudio.org/wiki/AboutPulseAudio#Details for you:
> <quote>
> PulseAudio is a networked sound server, similar in theory to the Enlightened 
> Sound Daemon (EsounD). PulseAudio is however much more advanced and has 
> numerous features.
> A sound server can serve many functions:
>     * Software mixing of multiple audio streams, bypassing any restrictions 
> the hardware has.
>     * Network transparency, allowing an application to play back or record 
> audio on a different machine than the one it is running on.
>     * Sound API abstraction, alleviating the need for multiple backends in 
> applications to handle the wide diversity of sound systems out there.
>     * Generic hardware abstraction, giving the possibility of doing things 
> like individual volumes per application. 
> </quote>
> In a nutshell, pulseaudio is for audio what X is for graphics. Imagine every 
> particular app having to talk directly to radeon, intel or nvidia drivers in 
> order to display itself on the screen. It is extremely complicated to maintain 
> such an app. X is an abstraction layer that provides a standardized graphics 
> interface to each app, and talks to the drivers in the background, "mixing the 
> signals" of all apps into a set of windows that you can see on the screen.
> Pulseaudio does the same thing, for audio. The way I see it, it is a Good 
> Thing, providing a lot of functionality.
> Finally, this is how top reports the cpu usage on my system at the moment:
> 12.0%  X
> 7.6% plasma-desktop
> 6.0% xmms
> 5.0% pulseaudio
> 3.3% ktorrent
> 1.7% compiz
> I am running compiz-fusion/emerald under latest KDE, have a bunch of windows 
> open on 8 desktops, listening to mp3 in xmms, while downloading some stuff with 
> ktorrent. Now, if you compare the cpu usage by X and by pulseaudio, I think I 
> should "turn off" X first, before pulseaudio, if I were to follow your logic.
> You never listen to several audio sources simultaneously, right? So you don't 
> need pulseaudio server, right? I guess you also never look at two windows on 
> the screen simultaneously, right? So you don't actually need X, right?
> I am sorry if this e-mail sounds a bit like venting, but *please* next time 
> use google and read about things yourself, don't expect from people on the 
> list to quote things that can be found on the web (and in a rather obvious 
> way).

Marko, I thank you for your help. I had read the pa material before but I did
not realize that removing it from the system was really not an option. After
reading your reply, I upgraded to kde-4.3.0 and that actually made a huge
difference. Time will tell, but so far, I do not seem to be getting syslog
messages constantly at a rate of about 26 per second. The messages now seem to
be only happening when I do something that causes a sound to be generated, and
it stops after a second or two with a rate of about 13/second. This is a
substantial improvement.

I *might* not be feeling so grateful if your answer had not coincided with an
upgrade that showed such an improvement ;-) but since it worked out as well as
it did, I say we declare victory and withdraw. There's a beer waiting for you
if you get to the Boston area. :-)>

Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20090827/34d8a0ba/attachment-0001.bin 

More information about the users mailing list