What Does Pulseaudio Do?

About one in three times after I start my system, I may have problems with my microphone. It does not appear to work. Skype and zoom are useless, because no one can hear me.

But the microphone does sort of still work. If I turn the mic and the igain up high in mixer, and position the microphone near the speakers, there is feedback.

The previous way I have cleared this problem is by restarting the whole system.

But today, from a terminal, I merely killed off pulseaudio. Amazingly, the microphone then worked in all applications. pulseaudio had not restarted.

Some hours later, I noticed that pulseaudio had started again. I am not sure which programs start it and when.

But the whole audio system including the microphone seemed to work well enough when it was not running.

What is the point of it? What does pulseaudio do?

I have looked at its own website where is says:
PulseAudio is a sound server system for POSIX OSes, meaning that it is a proxy for your sound applications. It is an integral part of all relevant modern Linux distributions and is used in various mobile devices, by multiple vendors. It performs advanced operations on sound data as it passes between your application and hardware. Things like transferring audio to a different machine, changing the sample format or channel count, or mixing several sounds into one input/output, are easily achieved using PulseAudio.

That does not help. Still don't know what in practical terms it does.
 
HI Mate, are you using Firefox as your browser

By default Firefox uses Pulseaudio

You can change Firefox to use sndio audio instead of Pulseaudio

open Firefox and in the url bar type

Code:
about:config

then paste in the following code next to the magnifying glass

Code:
media.cubeb.backend

set the option to string and add the following code

Code:
oss

restart Firefox and it wont use Pulseaudio anymore

Firefox and OBS Studio are the only two apps on Freebsd i know of that use Pulseaudio ( there may be others )
but you can change use both of those apps with sndio audio instead of Pulseaudio

20240624_15h05m25s_grim.png
 
What is the point of it? What does pulseaudio do?

Its meant to provide an abstraction layer above your (potentially complex) set of music hardware. Along with mixing them all together, it attempts to create a network aware service that can be streamed to and from remote devices.

Nice in theory but it doesn't always work well. Or rather it is very naïve and assume everyone is using some boring desktop/gaming PC. For a better implementation of the same concept, check out OpenBSD sndio.

The firefox port uses it because the port maintainer hasn't gotten round to making a native OSS port yet.
 
It presents a demon that takes sounds and gives out sound (for inputs). It also mixes sounds from applications together.

Under Linux you don't have an in-kernel mixer like FreeBSD has, so you need some software layer in userspace to mix when you want to have multiple applications all sending sound open. Pulseaudio is one of them.

Unfortunately it is one of those intended-to-be-magic pieces of software that configures everything automatically but gets it wrong often. Jackd is a better alternative, and you can then put pulseaudio on top of jackd.
 
changing the setting in firefox to oss lets you use virtual_oss
so you can capture the audio with obs studio or record it with ffmpeg or sox


Code:
====> Extra cubeb audio backends (OSS is always available)
     ALSA=off: ALSA audio architecture support
     JACK=on: JACK audio server support
     PULSEAUDIO=on: PulseAudio sound server support
     SNDIO=on: Sndio audio support
 
For the records, it should be possible to prevent any application from starting the pulseaudio server with the following line in ~/.config/pulse/client.conf:
Code:
autospawn = no

See for example Kodi wiki: Disable PulseAudio

Like other projects by Poettering you either fully adopt PulseAudio and use it for everything, or you avoid it like the plague. Using it together with other sound servers or direct OSS access will lead to troubles, as experienced by the OP. PulseAudio can make a good desktop sound server though, with dynamic audio routing and nice GUI utilities if all your applications support it. The linux world is currently abandoning PulseAudio for pipewire, which addresses some of its shortcomings.
 
Like other projects by Poettering you either fully adopt PulseAudio and use it for everything, or you avoid it like the plague. Using it together with other sound servers or direct OSS access will lead to troubles,[....]

I run quite successfully with Pulseaudio sitting on top of jackd. Applications I care about use the jack API, the rest and web browsers fall through to PA. I also use multichannel out to route PA output to a different analog line and mix things in an analog mixer.

Having said that, on FreeBSD this requires some ports compilation with custom options, though (not to mention my PA on -current has bus errors at the moment). This is more convenient on Linux right now, where my main audio chain rests (sorry).

Code:
pulseaudio -v -L module-jack-sink -L module-jack-source
 
Since I didn't see the previous answer, and I can't delete my post.
You can disable it globally by editing the file /usr/local/etc/pulse/client.conf
Code:
autospawn = no

Normally by doing so pulseaudio should not start itself randomly.
 
I run quite successfully with Pulseaudio sitting on top of jackd. Applications I care about use the jack API, the rest and web browsers fall through to PA. I also use multichannel out to route PA output to a different analog line and mix things in an analog mixer.

Ok, that sounds like useful combination - bonus points for the analog mixer as the ultimate "sound server"!

Out of interest, how does PulseAudio act when Jack is not running? Does it try to start Jack via DBUS? Also while PulseAudio is running, can you stop / restart Jack with a different sample rate, for example?
I'm not criticizing here, just want to anticipate some future bug reports ;)
 
The key really is to make the pulseaudio demon run stable once and indefinitely. Suppressing it can help with programs that autodetect PA when PA is present but not actually working, but that isn't really a solution.
 
Ok, that sounds like useful combination - bonus points for the analog mixer as the ultimate "sound server"!

Out of interest, how does PulseAudio act when Jack is not running? Does it try to start Jack via DBUS? Also while PulseAudio is running, can you stop / restart Jack with a different sample rate, for example?
I'm not criticizing here, just want to anticipate some future bug reports ;)

I don't know whether PA started with jackd modules specified on the commandline falls back to OSS. Given that it is Poetterware it probably falls through to ... something. But I didn't try. Jackd is usually stable and present unless I have a USB cable hickup with the soundcard.

If there is a hardware hickup or if you want to change sample rate you have to restart jackd and everything on top of it. You could work around this by using the module to add (and remove) additional sound hardware to an existing jack demon but I never tried that as it would then always re-sample everything on that additional soundcard.
 
That does not help. Still don't know what in practical terms it does.
Pulseaudio is a replacement for esd. esd was a component from Enlightenment, a window manager. esd's was created when Linux was still only using OSS as sound driver architecture.

The OSS version of Linux was unable to grant more than one application access to the hardware. So e.g. playing window manager sounds and mixing MP3s in with OSS was impossible.

esd was created to do that, software side sound channel mixing. Pulseaudio does the same, and much more.

Later Linux switched over to ALSA, which is able to offer more than one application access at the same time.
 
Pulseaudio is a replacement for esd. esd was a component from Enlightenment, a window manager. esd's was created when Linux was still only using OSS as sound driver architecture.

The OSS version of Linux was unable to grant more than one application access to the hardware. So e.g. playing window manager sounds and mixing MP3s in with OSS was impossible.

esd was created to do that, software side sound channel mixing. Pulseaudio does the same, and much more.

Later Linux switched over to ALSA, which is able to offer more than one application access at the same time.
When I started trying audio on FreeBSD, almost all of audio ports I tried hesitated to attach to vchans of in-base OSS. The only option to run multiple audio apps (inclding sounds from WMs) was esd, which was not widely supported. Later, pulseaudio popped in, and worked best at the moment.
Of course, at the moment, sndio, pipewire and jack didn't exist (at least on ports tree). Until then, I prefer pulseaudio, because switching to others is a large pain forcing me massive re-configures and rebuilds.

Yes, it was ancient days. OSS worked much pooly than nowadays.
(OSS on base was hugely overhauled later.)
 
Back
Top