Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
4.7.0
-
None
Description
I programmed a widget for Qt 4.7.0 on the n900. It is called BuliScores and the source code can be found here (its actually very simple and I only use 2 MediaObjects in mainwidget.cpp, thats all!):
https://garage.maemo.org/scm/?group_id=1890
The problem I see is constant unmotivated CPU usage by my widget (2-4% and /usr/bin/pulseaudio (13-20%) which drains the battery in no time...). My widget uses phonon to play mp3 files. (see mainwidget.cpp, it contains all the phonon calls). The high CPU usage doesn't show immediately, it's hard to reproduce but it showed up several times now. This time I tried to investigate, here is what I did and find out:
I created strace logs of both, the widget (strace.buliscores) and pulseaudio (strace.pulseaudio). With the help of dfaure we learned from the strace log that pulseaudio was constantly sending something to fd 63 and 64..
send(64, "\0\0\0\24\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0", 20, MSG_NOSIGNAL) = 20
send(63, "\0\0\0\24\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0", 20, MSG_NOSIGNAL) = 20
with the help of netstat (http://www.davidfaure.fr/kde/fd_sockets) I found out that those sockets were indeed connected to my widget.
So pulseaudio seems to constantly send something to my widget. Next, I used gdb and a lot of ctrl+c / cont cycles to finaly get a meaningfull backtrace (backtrace_widget).
I see that emitTick() is constantly emitted although I made sure that
a) my widget is currently playing no sounds at all
and
b) not calling any phonon functions repeatedly (I would see that in a debug log otherwise)
I think
#12 0x4249d9dc in Phonon::Gstreamer::MediaObject::emitTick (this=0x350fa8)
at ../../../3rdparty/phonon/gstreamer/mediaobject.cpp:1149
is interesting, since it tells me that phonon thinks some MediaObject is still playing (which is not
).
Hope that helps. If you need further info, please feel free to contact me.