Bug 278245 - Amarok uses lots of CPU
Summary: Amarok uses lots of CPU
Status: RESOLVED DUPLICATE of bug 279144
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.4.1.90
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: 2.4.2
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-22 07:51 UTC by Frédéric COIFFIER
Modified: 2011-08-03 10:18 UTC (History)
0 users

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 Frédéric COIFFIER 2011-07-22 07:51:41 UTC
Version:           2.4.1.90 (using Devel) 
OS:                Linux

This problem has appeared in this last Amarok version and didn't exist in 2.4.1.
Sometimes, Amarok consumes more than 80% of CPU whereas no music is played and Amarok is in systray :

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                                                
 8011 fcoiffie  20   0  872m  79m  20m R   85  1.3  45:23.13 amarok                                                                                                                                                                                                                 

It seems there is a periodic treatment done by Amarok which consumes lots of CPU.

After 2 hours, Amarok has consumed 45min of CPU time without playing any second of music :

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                                                
 8011 fcoiffie  20   0  957m  92m  28m S    1  1.5  45:48.78 amarok                                                                                                                                                                                                                 

Have you any advices to help you to debug this problem ?

Reproducible: Sometimes

Steps to Reproduce:
1. Start Amarok and wait for several minutes

Actual Results:  
Amarok consumes around ~85% CPU

Expected Results:  
A CPU consumption around 5-10%
Comment 1 Frédéric COIFFIER 2011-07-22 08:14:59 UTC
I have relaunched Amarok in debug mode : When Amarok is in systray and consumes lots of CPU, no debug messages are printed but there lot's of X's errors :

X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Extension:    149 (RENDER)
  Minor opcode: 4 (RenderCreatePicture)
  Resource id:  0x6e1d083
X Error: RenderBadPicture (invalid Picture parameter) 168
  Extension:    149 (RENDER)
  Minor opcode: 7 (RenderFreePicture)
  Resource id:  0x6e1d081
X Error: BadPixmap (invalid Pixmap parameter) 4
  Major opcode: 54 (X_FreePixmap)
  Resource id:  0x6e1d080
X Error: BadGC (invalid GC parameter) 13
  Major opcode: 60 (X_FreeGC)
  Resource id:  0x6e1d082
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 55 (X_CreateGC)
  Resource id:  0x6e1d083
X Error: BadAlloc (insufficient resources for operation) 11
  Major opcode: 53 (X_CreatePixmap)
  Resource id:  0x6e1d086
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Extension:    149 (RENDER)
  Minor opcode: 4 (RenderCreatePicture)
  Resource id:  0x6e1d086
X Error: RenderBadPicture (invalid Picture parameter) 168
  Extension:    149 (RENDER)
  Minor opcode: 7 (RenderFreePicture)
  Resource id:  0x6e1d084
X Error: BadPixmap (invalid Pixmap parameter) 4
  Major opcode: 54 (X_FreePixmap)
  Resource id:  0x6e1d083
X Error: BadGC (invalid GC parameter) 13
  Major opcode: 60 (X_FreeGC)
  Resource id:  0x6e1d085
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 55 (X_CreateGC)
  Resource id:  0x6e1d086
X Error: BadAlloc (insufficient resources for operation) 11
  Major opcode: 53 (X_CreatePixmap)
  Resource id:  0x6e1d089
Comment 2 Myriam Schweingruber 2011-07-23 11:55:34 UTC
In your second example, Amarok uses 1% of CPU, is this really the line you wanted to insert?
Could you be a tad more precise about your graphics settings and compositing?
Comment 3 Frédéric COIFFIER 2011-07-25 07:00:11 UTC
In fact, it consumes CPU by phase during several minutes at 85%, several minutes around 1%...
On my second line, it's the cumulated CPU time (45 min after 2h of execution) which is important (and the Amarok has stayed in systray without playing anything).

In fact, I've found an important clue : the problem occurs ONLY when I'm remotely connected to my computer (with NX protocol [ http://www.nomachine.com/ ], a VNC-like) and ONLY when Amarok is minized in the systray.
But I don't why there are so many XRender calls when Amarok is minized... Have you an explanation ?
Comment 4 Myriam Schweingruber 2011-07-25 09:47:14 UTC
You didn't answer my second question :)
Comment 5 Frédéric COIFFIER 2011-07-25 12:00:18 UTC
Yes, you're right : in fact, with a remote connection, I can't use composition (no OpenGL). Message in systemsettings :

"Desktop effects are not available on this system due to the following technical issues:

Required X extensions (XComposite and XDamage) are not available."
Comment 6 Myriam Schweingruber 2011-07-25 13:13:46 UTC
Thank you for the feedback, let's see if a developer can sort this out.
Comment 7 Myriam Schweingruber 2011-08-02 12:03:29 UTC
Just for completeness sake: do you run Amarok in minimized mode?
Also, do you use any external scripts and which applets do you use in the context view?
Comment 8 Frédéric COIFFIER 2011-08-03 07:50:28 UTC
Yes, the problem occurs only :
 - when Amarok is *started minimized* in the systray/notification area
 - when I'm remotely connected

In the context view, I have just the Recently Added Albums. Other applets are empty as I don't play any music. And I'm using the Ultimate Lyrics script but this one doesn't run as no song is played.
Comment 9 Myriam Schweingruber 2011-08-03 10:18:30 UTC
Thank you for the feedback.

*** This bug has been marked as a duplicate of bug 279144 ***