panel volume: High CPU usage in desktop and panel when there is pulse backend used without pulse server #415

maxnet opened this Issue Sep 5, 2012 · 14 comments


None yet

6 participants


Compiled Razor from yesterday's git on a low spec Raspberry Pi.
And get high CPU usage in razor-panel and razor-desktop even when the GUI is completely idle.

When I create a couple folders in the home directory CPU usage gets even higher.
Like there is something wrong with the file/icon change notification code, or like it is redrawing the screen all the time while nothing has changed.

I am logged in via SSH.

top - 14:44:12 up 18 min,  2 users,  load average: 0.39, 0.44, 0.36
Tasks:  67 total,   1 running,  66 sleeping,   0 stopped,   0 zombie
%Cpu(s): 11.1 us, 19.3 sy,  0.0 ni, 69.6 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    238424 total,   227368 used,    11056 free,    35652 buffers
KiB Swap:   118780 total,       68 used,   118712 free,   108264 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                 
 1815 pi        20   0  148m  15m  11m S  14.7  6.5   2:39.61 razor-panel                                             
 1810 pi        20   0  120m  36m  13m S   4.3 15.8   0:53.93 razor-desktop                                           
 1550 root      20   0 45244  13m 6588 S   2.9  6.0   0:33.21 Xorg                                                    
 9573 pi        20   0  3428 1332  988 R   1.3  0.6   0:00.20 top                             

razor-panel consumes 15% CPU doing nothing, razor-desktop 4$

Now lets create some folders in the home directory

pi@raspberry-pi:~$ mkdir test
pi@raspberry-pi:~$ mkdir test2
pi@raspberry-pi:~$ mkdir test3
pi@raspberry-pi:~$ mkdir test4
pi@raspberry-pi:~$ mkdir test5
pi@raspberry-pi:~$ top
top - 14:45:11 up 19 min,  2 users,  load average: 0.72, 0.50, 0.38
Tasks:  67 total,   1 running,  66 sleeping,   0 stopped,   0 zombie
%Cpu(s): 52.1 us, 21.3 sy,  0.0 ni, 26.3 id,  0.0 wa,  0.0 hi,  0.3 si,  0.0 st
KiB Mem:    238424 total,   226228 used,    12196 free,    35488 buffers
KiB Swap:   118780 total,       68 used,   118712 free,   107084 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                 
 1810 pi        20   0  120m  37m  14m S  45.9 15.9   1:08.27 razor-desktop                                           
 1815 pi        20   0  148m  15m  11m S  12.6  6.5   2:47.71 razor-panel                                             
 1550 root      20   0 45244  13m 6588 S   6.5  6.0   0:35.85 Xorg                                                    
 9898 pi        20   0  3428 1332  988 R   1.3  0.6   0:00.39 top                                                     

And now razor-desktop consumes 45.9% all the time doing nothing.
If I rmdir the folders again, CPU usage of razor-desktop drops again.

I also noticed is that it seems to be writing something to disk every 5 seconds or so, and sync'ing().
Hear my external 2.5" HDD making noise every 5 or so seconds, despite I am not running anything.

Razor-qt member

Seems "volume control" is the problem.
Both the razor-panel and razor-desktop CPU usage dropped to normal levels after removing it.

Tasks:  64 total,   1 running,  63 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.7 us,  1.4 sy,  0.0 ni, 97.9 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    238424 total,   213280 used,    25144 free,    31492 buffers
KiB Swap:   118780 total,       24 used,   118756 free,    99512 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                 
 3925 pi        20   0  3428 1328  988 R   1.3  0.6   0:01.07 top                                                     
 1840 pi        20   0 97352  17m  12m S   0.7  7.3   1:14.14 razor-panel                                             
 1835 pi        20   0  112m  36m  13m S   0.3 15.5   0:44.44 razor-desktop

Hadn't even noticed it was there because the volume control doesn't have an icon on my installation.
Was just a grey area on the panel.

Razor-qt member

volumeicon should be always displayed now after today's commit. Please try it if you can.

can you run it in some callgrind-like tool, please? qcachegrind/kcachegrind can be helpful.


Will let it compile the new release overnight (takes about 2 hours on a Pi) and give it a try tomorrow.

Razor-qt member

I played witch callgrind a bit and conclusion is (on my machine):

desktop is quite optimized (I fixed some inits in loops etc. but it's only minor stuff. It mostly stays in QPixmap::scale() for backround on start. Then it does not takes almost anything (using only analogclock and iconview pointing to ~/Desktop)

for panel: I tried it too. It mostly stays in mainmenu. But when I have audiovolume compiled with pulse support and pulse is disabled it consumes about 1.5% of CPU staying somewhere in libpulse internals. When I enable pulse back again it's almost on 0%. I don't see any glitch in cachegrind output here too.


With the new version I see a red/white unavailable cross as icon.
valgrind package is not available on the Pi.
Had a go with plain old gprof, but that didn't produce any function with high times. Probably doesn't work on threaded applications.

Did discover that the problem is indeed with PulseAudio, of which I do not even have the daemon installed. Think only the client libraries were installed as another package's dependency.
If I edit the source so that it does "m_engine = new AlsaEngine(this);" I have normal CPU usage, normal icon, and working mixer.


With Pulse, if I change "m_reconnectionTimer.setInterval(100);" to "m_reconnectionTimer.setInterval(10000);" I only get CPU spikes every 10 seconds.

Think it should fallback to ALSA if connecting doesn't work instead of trying again every tenth of a second.


The pulse client libraries seem to create a .pulse-cookie and .pulse directory under the home directory on each connection attempt.
Think that trigger razor-desktop file monitoring code and redraws screen.

Razor-qt member

ad desktop - you have set the home dir for displaying?

I'll also rename the issue to fit our observations


ad desktop - you have set the home dir for displaying?

Desktop indeed shows the home directory.

I have not changed any settings myself though. Think Razor shows home by default on Linux distributions that do not create a separate "Desktop" directory automatically when you do adduser.

Edit: home is indeed set as default here:

Razor-qt member

Yes. ~ is set if there is no Desktop (provided by Qt lib call). I will try to investigate how to refresh icon view when visible files/dirs are changes.


Same issue.
My env/setup details:
MSI Wind U-100
Linux Mint 12
Razor-Qt 0.50(I had 0.41, did "apt-get purge razorqt" before updating to new version)
Using xfwm4 as window manager.
I use alsa and I think pulseaudio also runs in the background.


i'll made ome test and where pulse server are running cpu usage are normally (of course with pulse server that i hate consume some), but if pule server are donw, panel's break and pulse volume olugin break.. due unvaliability of pulse backend..

this are the rasonable scenario due pulse volume plugin need a backend for work.. so the the right solution its that pulse volume swicht must veify if a backend are avilable..

solution possible are some way to split volume plugin library into alsa part "so" file and pulse part "so" file.. so then package the pulse with a dependency of pulse backend server are the mandatory (nonsense if not)

in alsa this dont happen due alsa itseft are the backend an the soundsystem, wheantime pulse its only a framework backend (that still depend of a module alsa/oss4 interface fo comuncate with hardware)

Clarifing information about sound systems in linux

pulseaudio its equivalent of a diretx sound for winbuntu or gstreamer (gnomepuach) or phonon (qt4/kde4) .. these systems ar only interfaces an frameworks for real soun systems (like alsa, oss an newer oss4)

Sound systems and hardware modules in linux:

theres only 3 real sound systems in linux, this systems access to hardware and made posible that frameworks like pulseaudio can comunicate an manage the sound card of u'r machine:

  • oss : older and not available in kernel now.. superseded by alsa
  • alsa: main in 2.6.X tree of kernel, deprecated in 3.5.X superseded by oss4
  • oss4 newer boom system audio in kernel for modern hardware, not recommended for older hardware

Some famous frameworks/backends in linux (not audio systems):

  • pulseaudio (interfaces and frameworks, for audio specially)
  • jackd (interfaces, and framworks, with audio and also now video capabilities)
  • phonon (interface)
  • gstreamer (interface)
Razor-qt member

Moved to lxqt.

@jleclanche jleclanche closed this May 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment