Red Hat Bugzilla – Bug 322481
Pusleaudio users very unreasonable CPU time limits
Last modified: 2007-11-30 17:12:17 EST
Description of problem:
Something's broken about how does pulseaudio limit its CPU usage. ESD
compatibility daemon dies from time to time after ~3 minutes of running. ESound
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run esd daemon
2. Play a song in rhythmbox
3. See esd die after a while
Soft CPU time limit exhausted, terminating.
The program terminates due to mechanism that prevents it from consuming over 70%
CPU for 10 seconds. I don't know whether that really happens, but as esound was
functioning properly and I don't experience excessive CPU loads I am not aware
of any problems with my audio drivers.
Using 2.2% CPU
Using 4.4% CPU
Using 3.5% CPU
Using 8.2% CPU
Using 4.0% CPU
Unable to reproduce it (now after I compiled debugging pulseaudio with profiling
If anyone finds out how to reproduce that reliably that would be greatly
W: alsa-util.c: Cannot find mixer control "Master".
Using 7.0% CPU
Using 9.4% CPU
Using 8.5% CPU
Using 7.9% CPU
Using 8.5% CPU
Using 8.9% CPU
Using 9.1% CPU
What's interesting is that pulseaudio eats more cpu when playing natively
instead of esd emulation.
CPU utilization scales with how small the buffer sizes are. By default the ESD
buffer sizes are quite large, while the native ones are smaller.
If you manage to reproduce this, could you please supply me with the ouput of
Are you confident the buffer size is the only guilty part? Does increasing the
buffer size have some memory consumption or other implications?
I wouldn't want to guarantee that the buffer size is the only culprit.
OK, I identified the bug now.
This is a bit complicated. PA enters an andless loop under certain circumstances
when we hit EOF of esound sockets. This will either cause to unload some modules
after some time or cause the CPU limit stuff to become active and terminate PA.
The effects are a bit confusing und surprising, though. Its's fixed in PA r1964.
A fix is now commited to F8.
Adding it to the blocker list as to close the loop as to why we're tagging it
for the release at this stage.
Lennart: Much thanks for that. I also noticed that on my machine pulseaudio uses
less than half of the CPU time comparted to what it used to. I do not know why
though, as I updated both pulseaudio and alsa since. Keep the good work!