Bug 322481 - Pusleaudio users very unreasonable CPU time limits
Summary: Pusleaudio users very unreasonable CPU time limits
Alias: None
Product: Fedora
Classification: Fedora
Component: pulseaudio
Version: 8
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: F8Blocker
TreeView+ depends on / blocked
Reported: 2007-10-07 21:18 UTC by Lubomir Kundrak
Modified: 2007-11-30 22:12 UTC (History)
2 users (show)

Clone Of:
Last Closed: 2007-10-31 00:51:21 UTC

Attachments (Terms of Use)

Description Lubomir Kundrak 2007-10-07 21:18:18 UTC
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
worked fine.

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
Actual results:

$ esd 
Soft CPU time limit exhausted, terminating.

Additional info:

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.

Comment 1 Lubomir Kundrak 2007-10-10 14:46:20 UTC
$ esd
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

Comment 2 Lubomir Kundrak 2007-10-10 16:11:11 UTC
$ pulseaudio 
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.

Comment 3 Lennart Poettering 2007-10-15 14:59:38 UTC
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
"pulseaudio -vv"?

Comment 4 Lubomir Kundrak 2007-10-16 14:17:21 UTC
Are you confident the buffer size is the only guilty part? Does increasing the
buffer size have some memory consumption or other implications?

Comment 5 Lennart Poettering 2007-10-17 21:07:40 UTC
I wouldn't want to guarantee that the buffer size is the only culprit. 

Comment 6 Lennart Poettering 2007-10-31 00:20:07 UTC
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.

Comment 7 Lennart Poettering 2007-10-31 00:51:21 UTC
A fix is now commited to F8.

Comment 8 Jesse Keating 2007-10-31 00:58:37 UTC
Adding it to the blocker list as to close the loop as to why we're tagging it
for the release at this stage.

Comment 9 Lubomir Kundrak 2007-10-31 11:33:56 UTC
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!

Note You need to log in before you can comment on or make changes to this bug.