samuelmello / datasoul

Automatically exported from code.google.com/p/datasoul
1 stars 5 forks source link

High CPU on ubuntu 12.04 when using video backgrounds. #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.run the datasoul software
2.
3.

What is the expected output? What do you see instead?
Normal CPU consumption, High CPU making fans working hard

What version of the product are you using? On what operating system?
ubuntu 12.04 

Please provide any additional information below.

Original issue reported on code.google.com by eric.duv...@gmail.com on 21 Oct 2012 at 6:56

GoogleCodeExporter commented 9 years ago
can you please provide some more information? with such an incomplete bug 
report its really hard to try to fix anything,

Which datasoul version are you using? Which architecture, java version, desktop 
environment?

I use it here in ubuntu 12.04 with normal cpu usage,..

Original comment by samuelme...@gmail.com on 21 Oct 2012 at 10:30

GoogleCodeExporter commented 9 years ago
BTW, it would be helpful to have also:

1. Output of 'top' showing which other processes are also using the cpu. 

2.  Output of a SIGQUIT (in a terminal, find datasoul's PID using 'ps ax' then 
use 'kill -QUIT  <datasoul_pid>). It should give us the stack trace for all 
java threads.

3. Attach VisualVM [1] to datasoul, monitore the threads for a while and report 
which thread is currently using the cpu.

Thanks

[1] http://visualvm.java.net/

Original comment by samuelme...@gmail.com on 21 Oct 2012 at 10:44

GoogleCodeExporter commented 9 years ago
shan2@shan-S3100:~$ top

top - 21:28:58 up 8 min,  2 users,  load average: 1.04, 1.07, 0.65
Tasks: 172 total,   1 running, 171 sleeping,   0 stopped,   0 zombie
Cpu(s): 45.6%us,  1.6%sy,  0.0%ni, 52.2%id,  0.3%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:   3915220k total,  1690652k used,  2224568k free,    75560k buffers
Swap:  3985404k total,        0k used,  3985404k free,   978724k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 3578 shan2     20   0  909m 254m  75m S   90  6.6   0:41.87 java               
 1039 root      20   0  187m  58m  46m S    2  1.5   0:37.00 Xorg               
 3399 root      20   0     0    0    0 S    1  0.0   0:01.66 kworker/0:0        
 3666 shan2     20   0  2856 1180  884 R    1  0.0   0:00.04 top                
  909 root      20   0     0    0    0 S    0  0.0   0:04.27 kworker/0:3        
 1014 root      20   0  3604  644  496 S    0  0.0   0:00.09 irqbalance         
 1738 shan2     20   0 36392 3332 2600 S    0  0.1   0:03.00 ibus-daemon        
 1838 shan2     20   0  181m  25m  17m S    0  0.7   0:02.53 nautilus           
 2201 shan2     20   0  686m 163m  36m S    0  4.3   1:05.33 firefox            
 2905 shan2     20   0 93204  15m  11m S    0  0.4   0:03.12 gnome-terminal     
 3251 root      20   0     0    0    0 S    0  0.0   0:03.37 kworker/1:0        
    1 root      20   0  3540 1984 1292 S    0  0.1   0:00.93 init               
    2 root      20   0     0    0    0 S    0  0.0   0:00.00 kthreadd           
    3 root      20   0     0    0    0 S    0  0.0   0:00.07 ksoftirqd/0        
    6 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/0        
    7 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/0         
    8 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/1        
shan2@shan-S3100:~$ dpkg -l | grep datasoul
ii  datasoul                               2.1-b1                               
   Datasoul is an application to manage and display song lyrics in worship 
services.
shan2@shan-S3100:~$ 

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 7:29

GoogleCodeExporter commented 9 years ago
shan2@shan-S3100:~$ java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) Server VM (build 23.5-b02, mixed mode)

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 7:34

GoogleCodeExporter commented 9 years ago
shan2@shan-S3100:~$ kill -QUIT 3578
shan2@shan-S3100:~$ 
What next?

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 7:41

GoogleCodeExporter commented 9 years ago
3. Attach VisualVM [1] to datasoul, monitore the threads for a while and report 
which thread is currently using the cpu.
--> sorry I dont know how to use it.

Yet, I have installed it.

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 7:42

GoogleCodeExporter commented 9 years ago

Hi,

Thank you very much.

Sorry, I forgot something about the kill -QUIT thing. Please start datasoul 
from the terminal. When you send the QUIT signal the output will appear in the 
terminal where you started datasoul.

I created a screenshot about the VisualVM:
https://docs.google.com/file/d/0B1Uhswwg9w15UVhUeW0tRFU0M1U/edit

First select datasoul's process in the tree in the right, then select the 
'Threads' tab, wait until it fills the screen, take a screenshot and send here.

It would be good if you use the same datasoul session for both, so we can 
correlate the kill -QUIT and the VisualVM outputs.

Do you do anything special or it just starts using cpu after start?

Thanks

Original comment by samuelme...@gmail.com on 22 Oct 2012 at 8:05

GoogleCodeExporter commented 9 years ago
Ah, if you could, please send also the output of VisualVM in Profiler tab, then 
click on CPU icon. 

Original comment by samuelme...@gmail.com on 22 Oct 2012 at 8:09

GoogleCodeExporter commented 9 years ago

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 8:22

Attachments:

GoogleCodeExporter commented 9 years ago
Do you do anything special or it just starts using cpu after start? --> No

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 8:25

GoogleCodeExporter commented 9 years ago
I'm trying to reproduce the problem here without success, yet.

Are you using Live or Video as background? 

In VisualVM, if you wait some time do you get other entries beside LivePanel 
and TimerManager?

Original comment by samuelme...@gmail.com on 22 Oct 2012 at 8:55

GoogleCodeExporter commented 9 years ago
Are you using Live or Video as background?  Yes

Original comment by eric.duv...@gmail.com on 22 Oct 2012 at 8:57

GoogleCodeExporter commented 9 years ago
Hum... this give us a good hint. 

If you disable it (use static background) the cpu usage goes to normal levels?

When you enable the output, does the video run smoothly? How are the cpu usage 
then?

Can you provide us some information about the video (codec, resolution, size, 
etc)?

Original comment by samuelme...@gmail.com on 22 Oct 2012 at 9:15

GoogleCodeExporter commented 9 years ago
But if I remove video it has the same effect

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 9:18

GoogleCodeExporter commented 9 years ago
In VisualVM, if you wait some time do you get other entries beside LivePanel 
and TimerManager? --> where is it?

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 9:25

GoogleCodeExporter commented 9 years ago

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 9:28

Attachments:

GoogleCodeExporter commented 9 years ago
I have remove the video:
top - 23:32:54 up  2:12,  2 users,  load average: 0.33, 1.31, 1.63
Tasks: 164 total,   1 running, 163 sleeping,   0 stopped,   0 zombie
Cpu(s):  4.5%us,  2.6%sy,  0.0%ni, 92.9%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3915220k total,  2229996k used,  1685224k free,    94520k buffers
Swap:  3985404k total,        0k used,  3985404k free,  1088560k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
 1039 root      20   0  194m  36m  20m S    9  1.0   5:44.75 Xorg               
 8443 shan2     20   0  462m 114m  32m S    3  3.0   0:16.14 firefox            
 1802 shan2     20   0  147m  13m  10m S    3  0.4   0:30.81 metacity           
 1744 shan2     20   0 96188  21m  12m S    1  0.6   0:10.51 python             
 1764 shan2     20   0  7396 3588  640 S    1  0.1   2:43.04 dbus-daemon        
 1829 shan2     20   0  375m  70m  36m S    1  1.9   0:41.06 unity-2d-shell     
 1855 shan2     20   0 79712  10m 7884 S    1  0.3   0:54.84 bamfdaemon         
 1738 shan2     20   0 36908 3764 2600 S    1  0.1   0:11.92 ibus-daemon        
 7797 root      20   0     0    0    0 S    1  0.0   0:03.53 kworker/1:2        
 1780 shan2     20   0  162m  16m  11m S    0  0.4   0:03.98 gnome-settings-    
 1828 shan2     20   0  143m  26m  19m S    0  0.7   2:04.43 unity-2d-panel     
 2353 shan2     20   0  160m  34m  26m S    0  0.9   0:05.29 unity-2d-spread    
 5374 shan2     20   0 1389m 464m  75m S    0 12.2   6:14.84 java               
 5791 shan2     20   0  161m  46m  19m S    0  1.2   0:04.88 shutter            
    1 root      20   0  3540 1984 1292 S    0  0.1   0:01.00 init               
    2 root      20   0     0    0    0 S    0  0.0   0:00.01 kthreadd           
    3 root      20   0     0    0    0 S    0  0.0   0:13.04 ksoftirqd

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 9:33

GoogleCodeExporter commented 9 years ago
shan2@shan-S3100:~/A_Elim$ mplayer -vo null palm-branches.avi 
Creating config file: /home/shan2/.mplayer/config
MPlayer svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing palm-branches.avi.
libavformat version 53.21.0 (external)
Mismatching header version 53.19.0
AVI file format detected.
[aviheader] Video stream found, -vid 0
AVI: No audio stream found -> no sound.
VIDEO:  [MJPG]  1920x1080  24bpp  29.970 fps  50849.7 kbps (6207.2 kbyte/s)
Load subtitles in ./
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
Audio: no sound
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [null] 1920x1080 => 1920x1080 Planar YV12 
V:   2.1  64/ 64 78%  0%  0.0% 0 0 

MPlayer interrupted by signal 2 in module: decode_video
V:   2.1  65/ 65 78%  0%  0.0% 0 0 

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 9:34

GoogleCodeExporter commented 9 years ago
So it because of the video !!!

Original comment by YihShan....@gmail.com on 22 Oct 2012 at 9:35

GoogleCodeExporter commented 9 years ago
That's right, it seems datasoul is playing the video even while output is not 
visible.

I got ~50% cpu usage with the ubuntu example video (How Fast.ogg) as 
background. Your Full HD video should require a bit more cpu usage.

Configuring background to static makes it drop to about ~1% after a while.

I think we can patch it to play the background video only when output is 
visible. I'm going to give this a try when I get some more time.

Original comment by samuelme...@gmail.com on 22 Oct 2012 at 9:37