By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 3152 - Amarok spectrum analyser high CPU usage when idle
Summary: Amarok spectrum analyser high CPU usage when idle
Status: NEW
Alias: None
Product: TDE
Classification: Unclassified
Component: tdemultimedia (show other bugs)
Version: R14.0.x [Trinity]
Hardware: Other Linux
: P5 normal
Assignee: Timothy Pearson
URL:
Depends on:
Blocks:
 
Reported: 2020-07-26 17:41 CDT by Jan Stolarek
Modified: 2020-08-16 16:35 CDT (History)
4 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
Idle animation on the default spectrum analyser (18.04 KB, image/png)
2020-07-26 17:41 CDT, Jan Stolarek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Stolarek 2020-07-26 17:41:01 CDT
Created attachment 2984 [details]
Idle animation on the default spectrum analyser

On a 3,8GHz CPU Amarok uses the following percentages of CPU time:

<0,7% when idle and minimized (either to system tray or to the taskbar)
~2% when playing mp3 and minimized
~5% when idle and not minimized
~6% when playing mp3 and not minimized (the numbers don't add up, I know)

After tedious debugging it turns out that this is because of the spectrum analyser, and the CPU usage when idle is caused by idle animation on the analyser (see attached screenshot). While I understand that the analyser has to use some CPU time when used during playback I don't think it's justified to use as much CPU when nothing is being played. In fact, the second analyser uses as much as 10% CPU time in idle state. To put these percentages into perspective: Xorg server uses around 1-5% when drawing TDE windows, while idle Firefox with 10-15 tabs uses ~7% CPU time.

As a workaround it's possible to not select any analyser (downside: annoying text telling you to click to pick a spectrum analyser) or remove the analyser from the bar altogether via toolbar configuration (subjective downside: weird toolbar layout).

Aside: 5% of 3,8GHz is 190MHz. When I first used KDE3 over 15 years ago I had a 500MHz Pentium III and IIRC that analyser was already there. No way it used over a third of my CPU speed back then.
Comment 1 Michele Calgaro 2020-07-27 04:11:29 CDT
Hi Janek,
question: which Amarook engine are you using?
In case it is xine, which version of xine and TDE?
Comment 2 Jan Stolarek 2020-07-27 04:45:08 CDT
I'm using libxine2 1.2.9-1:

https://packages.debian.org/buster/libxine2

and TDE 14.0.9 PSB.
Comment 3 Michele Calgaro 2020-07-28 23:11:00 CDT
ok, thanks Janek.
Would you be able to test Amarok R14.0.8 for comparison?
There has been a recent change in the Amarok scope plugin, so it would help to see if that is the cause of the high cpu you see.

Also, would you be able to test on a different computer? I don't see any particular CPU usage here
Comment 4 Jan Stolarek 2020-07-29 06:22:12 CDT
> Would you be able to test Amarok R14.0.8 for comparison?

I tried but I'm not sure if I downgraded correctly. I installed 14.0.8 versions of amarok-trinity, amarok-common-trinity and amarok-engine-xine-trinity fro the 14.0.8 repository, bu the version reported by `amarok --version` is the same as for the PSB repository. If that was a correct downgrade then the results are the same - still around ~5% COU usage on idle.

> Also, would you be able to test on a different computer?

I tested on a laptop that also runs TDE PSB and I get the exact same results.
Comment 5 Michele Calgaro 2020-07-29 10:19:20 CDT
> I tried but I'm not sure if I downgraded correctly.

Uhm, it should say R14.0.8, PSB says R14.0.9 [DEVELOPMENT].
PSB already contains the latest changes, that is why I asked to test on R14.0.8.
Maybe Amarok was still running from before in the sys tray?
Comment 6 Jan Stolarek 2020-07-29 10:32:38 CDT
Hmm... nNot sure what I did wrong. `amarok --version` says:

Qt: 3.5.0
TDE: R14.0.9 [DEVELOPMENT]
Amarok: 1.4.10

And to be clear: I downgraded Amarok *only*, not TDE itself. I also logged out and in again to make sure Amarok is not running in the background. I also cleaned Amarok configuration to make sure there are no leftovers from my normal config.
Comment 7 Slávek Banko 2020-07-29 11:45:01 CDT
I can confirm the above problem - Amarok on Wheezy (Xine 1.2.2).
Comment 8 Michele Calgaro 2020-08-04 03:36:22 CDT
Hi Slavek,
when you have time could you try rebuilding amarok without commit c5f901c03ec and see if the problem still happens in Wheezy?
This will help understanding if the problem was preexisting or not.
In bullseye I can't test that since I have xine 1.2.10 and without that commit ther would be a FTBFS.
Thank you!
Comment 9 Michele Calgaro 2020-08-05 01:23:39 CDT
Slavek was able to test Amarok R14.0.8 on Wheezy and the problem is still happening, so it is not related to the commit to fix xine 1.2.10 support but instead caused by something else.
Comment 10 Jan Stolarek 2020-08-16 16:35:15 CDT
I just realized that the default analyser (only) has a refresh rate setting available under right click. Setting lower FPS reduces the CPU usage, which can be a workaround for someone who doesn't want to completely disable the analyser.