5 ms·
For the last ~12 years, I gave PulseAudio a try every time I upgraded the Fedora distro on my main computers. I almost never had the catastrophic bugs many peop
by stncls 5y ago
For the last ~12 years, I gave PulseAudio a try every time I upgraded the Fedora distro on my main computers. I almost never had the catastrophic bugs many people complained about. But pulseaudio has always taken 10-15% of one CPU when in use (be it on audio/video calls, or music/movie playback). This is across 3 different laptops and 2 desktops. It is not a huge deal, but it is a bit frustrating on laptops where battery life is precious. I understand that PulseAudio is very powerful, but it represented no practical gain for me personally, with my very simple use cases, so I simply disabled it.
Weirdly, I found very few people complaining about PulseAudio's CPU usage. Maybe nobody cares about 10-15% of one core.
However, I am happy to report that PipeWire seems to not have this problem at all. Since it became default on Fedora, it has barely shown on top's first page. Given that it is even more ambitious than PulseAudio in terms of latency, this is incredibly impressive!
- stncls 5y agoNote that PipeWire was initiated by Wim Taymans, one of the driving forces behind GStreamer. I think it is one case of the right people in charge of the right projects :-).
- timvisee 5y agoYes! I experienced the same. Just never publicly complained about it. It's the only constant running thing having high CPU. PipeWire, though still somewhat power hungry, is a lot better.
- earthbee 5y agoAre there any particular circumstance where it takes 10-15% of one CPU for you or is it whenever there is sound playing? I just checked mine while playing music on YouTube and it bounces between 4.0 and 4.8%
- stncls 5y agoWhenever there is sound playing or recording. I think it was lower than 10-15% on my most recent desktop, so maybe 4-5% makes sense if your computer is powerful. (While I fully appreciate that it is a very minor annoyance, 5% still frustrates me because PulseAudio added no value to me. I also understand that it added features very useful to other people.)
- lostdog 5y agoSimilar thing for me. Pulseaudio sometimes takes a bunch of CPU with audio playing. Even stranger, sometimes it keeps taking 5-10% CPU with no audio playing. (I think it is related to running out of memory for a moment and using swap, but no matter how much memory I free up, the computer never returns to normal and must be restarted). I'm getting to the point of installing debug symbols and pointing perf at it, but dropping pulseaudio would be an even better solution.
- zokula 5y ago> Similar thing for me. Pulseaudio sometimes takes a bunch of CPU with audio playing. Run the same audio without pulse and the CPU usage will be higher.
- ncmncm 5y agoEven with no audio at all?
- puppet-master 5y agoParent comment likely refers to kernel CPU time accounted for in the generating process. If an application passes an audio sample to PulseAudio, it is charged for (at most) a memory copy and one or two syscalls, while PulseAudio is charged for the time spent in the kernel driver. Pulseaudio burning CPU during silence is usually due to an application holding open a channel that is either really playing silence or is keeping the Pulseaudio machinery awake. You could blame the apps, but IMHO that is definitely a Pulseaudio problem
- marcodiego 5y agoPulseaudio eating too much CPU happens on an Ubuntu machine of mine. I simply type "pulseaudio -k" to restart it. But this kind of action should not be needed, I'm the user, I'm not supposed to fight the system, the OS should work for me not the other way around.
- beebeepka 5y agoI've got music during my gaming sessions on Ubuntu. Never seen this happen. Will keep an eye. I'll probably get downvoted again but what hardware?
- marcodiego 5y agoAnd old Dell machine.
- beebeepka 5y agoWhat kind of hardware are we talking about? 15% for music playback is a lot
- stncls 5y agoThe laptops are: i7-3517U with realtek ALC269VB audio chip i7-6500U (I don't have access to this one right now, but it was a Asus ZenBook flip -- on this one I've definitely seen 15%+ usage by PulseAudio during video calls.) i5-7200U with conexant CX8200 The latest desktop is: Ryzen 5 2600 with realtek ALC887-VD (on this one the CPU load was lower than on the others, but still there)
- andrewaylett 5y agoOne time, many moons ago now, I noticed Pulse taking a reasonable fraction of a core and thought I'd zap PA to try to use less CPU. Unfortunately, using my media player without PA actually used more CPU overall -- the audio player's CPU use went up by more than PA had been using. So I went back to using PA.
- stncls 5y agoThere is a sibling comment describing the same experience. But I think that this behavior can't be reproduced nowadays. I think it must depend on the relative performance of the software resamplers involved (ALSA's in-kernel plughw vs. PulseAudio's vs. your media player's). Do you remember which media player triggered this?
- cout 5y agoOn Ubuntu 10.04 (iirc), I measured it at closer to 50% of one core, and I only had one core. It was unusable for me, until I got a faster computer.
- zokula 5y agoRun all of your apps without pulseaudio and you will see even more CPU useage than. Pulseaudio lowers CPU usage by 5 to 25 percent depending on CPU architecture.
- stncls 5y agoI just tried, but I could not reproduce this on my laptop here. The overall system load is consistently higher with PulseAudio when playing an audio file with mplayer -- even when using "plughw" (which allows in-kernel software resampling) instead of "hw" (which does not). It must be hardware- or system-dependent. Also, I'm curious why this happens on your system. PulseAudio itself uses ALSA (the standard kernel API for audio) behind the scenes, like any application would, directly, in its absence. In addition, it must carry audio samples across process boundaries and perform software mixing/routing, all with low-ish latency (hence small buffer sizes). All this with negative (up 25%!) CPU usage? One possible explanation: I did read many times that PulseAudio "fixes ALSA bugs" or "fixes buggy applications". However, I can't remember encountering any such bug in the last few years (or any PulseAudio bugs either, to be honest). Nowadays, most applications that can use ALSA directly do so through alsalib, which could just as well iron out such issues if any remain. Which application triggers this behavior?
- kiririn 5y agoPulseaudio is opinionated in favour of quality. For example if attaching an input to an output in pulseaudio it will resample by a minuscule amount to sync the clocks (eg 47999hz to 48000hz). This sort of thing does not come for free, and any other solution that is using less CPU may be cutting corners in areas like this. For me Pulseaudio is still my weapon of choice for running a dedicated realtime DSP where the input and output are on separate cards/clocks, but I can see how it has grown beyond sane scope for ordinary desktop usage
- Unklejoe 5y ago> attaching an input to an output ... sync the clocks This has to be done though. Otherwise, you would have periodic underruns or overflows.