Re: Where is pulseaudio started?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

HTH, :-)
Marko

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux