Bug 101524 - amarokapp taking 95% of CPU time constantly
Summary: amarokapp taking 95% of CPU time constantly
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 101566 102091 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-14 23:03 UTC by Jani Huhtanen
Modified: 2006-06-11 12:32 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jani Huhtanen 2005-03-14 23:03:11 UTC
Version:           amaroK 1.2.2 official source distribution (using KDE KDE 3.3.0)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.2 cflags and cxxflags = "-O3 -march=athlon -funit-at-a-time -pipe"
OS:                Linux

Hi!

Just downloaded and compiled amarok 1.2.2. I find amarok promising but the amount of cpu time it's taking is _way_ too much to be normal.

Some facts:

- amaroK 1.2.2, compiled with gcc 3.4.2 from released source package with following configure:
CFLAGS="-O3 -march=athlon -funit-at-a-time -pipe" CXXFLAGS=$CFLAGS ./configure

- audio engine: gstreamer 0.8.9 also compiled with gcc 3.4.2 and with similar config (that goes with the plugins too).

- gstreamer using alsasink

- linux 2.6.10 with cko1 pathcset

- machine: Athlon 800Mhz with 1Gb of mem

- CPU usage of amarokapp process aprox. 95%, while being idle (ie. only playlist visible, no music playing). Really nothing changes the situation. I can play normally and nothing crashes, but even when I just start the app it takes up all the CPU time.

- OProfile says that most time in amarokapp is taking BoomAnalyzer::analyze, but I have some doubts about my skills in using oprof.. so here's the top 10 for amarokapp:

The first sample (and percentage) is CPU CLK samples taken by OProfile. 
          
vma      samples % samples% samples%  linenr info         app name      symbol name
081c8340 166 0.0784 0 0 0 0 (no location information) amarokapp BoomAnalyzer::analyze(std::vector const&)

0822a060 126 0.0595 0 0 0 0 (no location information) amarokapp sqlite3VdbeExec

080765b0 121 0.0571 0 0 0 0 (no location information) amarokapp anonymous symbol from section .plt

081f9600 34 0.0161 0 0 0 0 (no location information) amarokapp parseCellPtr

081a49ce 32 0.0151 0 0 0 0 (no location information) amarokapp __i686.get_pc_thunk.bx

081fd630 26 0.0123 0 0 0 0 (no location information) amarokapp sqlite3BtreeMoveto

081ca990 24 0.0113 0 0 0 0 (no location information) amarokapp Analyzer::Base::demo()

081fbaf0 20 0.0094 0 0 0 0 (no location information) amarokapp sqlite3BtreeKeySize

081ca100 18 0.0085 0 0 0 0 (no location information) amarokapp Analyzer::Base2D::qt_invoke(int, QUObject*)

081fc460 18 0.0085 0 0 0 0 (no location information) amarokapp fetchPayload

The most of the time is spent in libqt_mt.so.3.3.3. Amarokapp must be calling something pretty often there. Perhaps from the BoomAnalyzer::analyzer? Oh and both profiles were taken while nothing was playing.

I tried different audio engines.. nothing. There's nothing in any preferences that helps. Is this a bug or is amarok just really picky about optimization flags, becaus surely it isn't this hungry for CPU?

-- Jani Huhtanen 
-- Tampere University of Technology
-- Finland
Comment 1 Alexandre Oliveira 2005-03-15 03:15:14 UTC
I can confirm this, and some other people on #amarok confirmed as well. 
I've removed the analyzer from the toolbar, and that didn't change anything.
Comment 2 Tro 2005-03-15 03:16:19 UTC
I can confirm this. However, in my case, cpu usage is at 100%.

2.8 P4, 512MB. Gentoo. KDE 3.3.2.
CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer -msse2 -mmmx"
gcc-3.3.4
Comment 3 Greg Meyer 2005-03-15 03:24:00 UTC
I can confirm this also, and if it helps, I last updated at 2005-3-12 at 4:19UTC, which as a point of reference, was before muesli reverted the iframes.
 
It happens with every engine, and even with no engine.  Also amaroK works fine during this period, and then suddenly about 90 seconds after startup it stops and goes back to normal.  Also, another machine I have is unaffected.

Other relevant info might be that the machine that suffers is using mysql as the database back end.
Comment 4 Greg Meyer 2005-03-15 03:26:52 UTC
some more info that may or may not be relevant.  The affected machine compiled amaroK with GCC 3.4.1, and the machine that is fine uses 3.4.3.
Comment 5 Tro 2005-03-15 04:05:06 UTC
I just tried recompiling 1.2.2 with gcc 3.4.3. Problem persists.
Comment 6 Mark Kretschmann 2005-03-15 18:54:08 UTC
*** Bug 101566 has been marked as a duplicate of this bug. ***
Comment 7 Mark Kretschmann 2005-03-15 19:15:51 UTC
This report puzzles me. Can't reproduce it here.
Comment 8 Alexandre Oliveira 2005-03-15 22:41:29 UTC
CVS commit by aoliveira: 

The "data:image/png;base64," thing triggered a bug that made amarokapp take 100% cpu use for some people.
Reverting that nice change to fix this serious bug.
This URL shows someone with a similar problem: http://lists.kde.org/?l=kfm-devel&m=110185828621406&w=2 
It doesn't have much information, though.
BUG: 101524
CCMAIL: kde@sdas.de
CCMAIL: amarok-devel@lists.sf.net


  M +30 -16    contextbrowser.cpp   1.417
  M +4 -0      contextbrowser.h   1.68
Comment 9 Tro 2005-03-15 23:34:13 UTC
I just tried the CVS ebuild and it seems to work. Thanks for the quick fix!
Comment 10 Alexandre Oliveira 2005-03-21 15:56:17 UTC
*** Bug 102091 has been marked as a duplicate of this bug. ***
Comment 11 Dawid Ciezarkiewicz 2005-04-07 22:34:17 UTC
amarok: 1.2.3 (in which whole problem should be fixed, right?)

Start playing, hit "stop", watch your amarok taking 100% CPU and doing nothing.

BTW. While playing amarok (gst->ALSA) takes about 11% of CPU, xmms (ALSA output) 1%. Why, why, why? 
Comment 12 Tro 2005-04-08 00:25:50 UTC
Also happens when you pause.

This problem only occurs with GST for me. That's why I switched to xine.