Volume meters take too much CPU

Bug #830677 reported by Jarno Suni
52
This bug affects 10 people
Affects Status Importance Assigned to Milestone
pavucontrol (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

During playback (or during input) the respective volume meters take a lot of CPU via Xorg process, if such a meter is visible in pavucontrol's user interface. When playing music, for instance, Xorg process will then take about all available CPU power of AMD Athlon XP processor, that is about 70% of CPU; pavucontrol itself takes only 3%. This makes pavucontrol user interface unresponsive and high-resolution video playback stammer.

VGA compatible controller: nVidia Corporation NV17 [GeForce4 MX 420] (rev a3), using the default free driver.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: pavucontrol 0.9.9-1
ProcVersionSignature: Ubuntu 2.6.38-11.48-generic 2.6.38.8
Uname: Linux 2.6.38-11-generic i686
Architecture: i386
Date: Sun Aug 21 22:32:46 2011
EcryptfsInUse: Yes
InstallationMedia: Xubuntu 11.04 "Natty Narwhal" - Release i386 (20110426.1)
ProcEnviron:
 LANGUAGE=en_US:en
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: pavucontrol
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jarno Suni (jarnos) wrote :
Revision history for this message
Jarno Suni (jarnos) wrote :

I did not notice similar unresponsiveness with gnome-volume-control.

Jarno Suni (jarnos)
summary: - unresponsive
+ Volume meters take too much CPU
Revision history for this message
Jarno Suni (jarnos) wrote :

But there are no such volume meters in gnome-volume-control; didn't test its "Input level" meter.

description: updated
Jarno Suni (jarnos)
description: updated
Revision history for this message
Jarno Suni (jarnos) wrote :

Easy fix would be to remove meters altogether, or make them simply show whether there is playback/input or not, since they are mostly eye candy.

Revision history for this message
Jarno Suni (jarnos) wrote :

This might be a bug in the graphics driver, I guess, since there is similar CPU activity in Xorg when Update Manager shows its progress bar, and its operation is very slow.

Jarno Suni (jarnos)
tags: added: oneiric
Revision history for this message
Jarno Suni (jarnos) wrote :

In oneiric this seems to be better, but still, if pavucontrol meters are visible and I start to play hd video, playback performance is low and I can see (by top) that pulseaudio takes 25% of CPU. If I hide the meter by resizing pavucontrol window, pulseaudio load drops to 8% of CPU and playback becomes fluent.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pavucontrol (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Mertes (cmertes) wrote :

On an Atom this is a real issue. I see this behaviour in Precise, too. gnome-volume-control is no real alternative. AFAIK only pavucontrol and kmix allow audio streams to be redirected to a different sound device while they are playing (from local to pulse audio network sound device say). I cannot run skype and pavucontrol simultaneously on my Atom however. This is clearly undesirable.

Revision history for this message
Jarno Suni (jarnos) wrote :

The CPU usage is unacceptable. See the image. If I quit pavucontrol, CPU usage of pulseaudio drops to rough 10% and CPU usage of X drops to around 1.5%. No wonder why people feel they need faster computers, when volume control utility is that heavy.

lspci gives this output:
00:00.0 Host bridge: Intel Corporation Mobile 945GSE Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GSE Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)
00:1c.2 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 3 (rev 02)
00:1d.0 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 02)
00:1d.1 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 02)
00:1d.2 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 02)
00:1d.3 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 02)
00:1d.7 USB controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7-M Family) SATA Controller [IDE mode] (rev 02)
00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 02)
02:00.0 Ethernet controller: Atheros Communications Inc. AR242x / AR542x Wireless Network Adapter (PCI-Express) (rev 01)
03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet Controller (rev 13)

Revision history for this message
Darko Veberic (darko-veberic-kit) wrote :

on atom N550 the pavucontrol eats 23% of cpu and X 14% even when input and output are both completely muted. i guess this is just sloppy programming, updating the meters even when nothing is going on. this is effectively a busy-loop burning and would be really nice to fix, please?

Revision history for this message
Darko Veberic (darko-veberic-kit) wrote :

as soon as one of the input/output devices tab is visible the pavucontrol and X cpu usage goes up, even in the case both are muted and the meter appears grayed-out. viewing other tabs is ok.

Revision history for this message
Darko Veberic (darko-veberic-kit) wrote :

btw, this is ubuntu 13.04 amd64.

Revision history for this message
Christian Mertes (cmertes) wrote :

I actually tried to fix this once, halfheartedly though. If I recall correctly, it's not a busy wait but rather the graphical meters get updated every time a new volume value is available. Which is too often obviously. Strangely enough, just saving the current value and only updating the graphical meters when some minimum amount of time had passed, while indeed reducing the CPU load, also made the volume display update very infrequently, no matter how small I set the minimum wait time. I didn't try to understand why this was though.

So long story short: my fix was totally broken. So while this might seem like a trivial fix and might well be, it's at least a bit more complicated than it first looks.

Revision history for this message
hackel (hackel) wrote :

Just wanted to confirm this issue is still present with pavucontrol 2.0.

It is very interesting. With no audio playing (no audio sources listed on the Playback tab), pavucontrol consumes 12±2% CPU if I am on the "Output Devices" or "Input Devices" tabs. If I switch to any other tab, CPU goes down to 2-4%. The volume meters on the Playback and Output Devices tabs don't actually work! Even if there is audio playing, they just show a solid grey bar. The volume meter on the Input Devices tab *does* work, however.

Unfortunately I need to keep pavucontrol running all the time in order for my desktop notifications not to be heard on my HDMI-connected TV, so I would like to see this resolved.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.