Bug 322481 - Pusleaudio users very unreasonable CPU time limits
Pusleaudio users very unreasonable CPU time limits
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: pulseaudio (Show other bugs)
8
All Linux
urgent Severity high
: ---
: ---
Assigned To: Lennart Poettering
Fedora Extras Quality Assurance
:
Depends On:
Blocks: F8Blocker
  Show dependency treegraph
 
Reported: 2007-10-07 17:18 EDT by Lubomir Kundrak
Modified: 2007-11-30 17:12 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-30 20:51:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Lubomir Kundrak 2007-10-07 17:18:18 EDT
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):

pulseaudio-esound-compat-0.9.7-0.15.svn20071001.fc8

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 10:46:20 EDT
$ 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
information).

If anyone finds out how to reproduce that reliably that would be greatly
appreciated.
Comment 2 Lubomir Kundrak 2007-10-10 12:11:11 EDT
$ 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 10:59:38 EDT
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 10:17:21 EDT
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 17:07:40 EDT
I wouldn't want to guarantee that the buffer size is the only culprit. 
Comment 6 Lennart Poettering 2007-10-30 20:20:07 EDT
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-30 20:51:21 EDT
A fix is now commited to F8.
Comment 8 Jesse Keating 2007-10-30 20:58:37 EDT
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 07:33:56 EDT
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.