Bug 202744

Summary: kded4 jumps to 50/100% CPU every time Phonon (?) is used
Product: [Unmaintained] kdelibs Reporter: anj.tuesday
Component: kdedAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: d.scheftelowitsch, ken69267, ken, kretz, maciej.zubala, martin.sandsmark, thomas.schlichter
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description anj.tuesday 2009-08-06 04:06:23 UTC
Version:            (using KDE 4.3.0)
OS:                Linux
Installed from:    Ubuntu Packages

Problem: The kded4 process jumps to 50% CPU as soon as a KDE 4 component or application play sound. 

What triggers it? The login sound, the trash emptied sound, any other notification sound as well as tests of the output devices in the Multimedia System Settings all immediately send kded4 to 50% (presumably 100% on a single core CPU). With Amarok 2 running but not playing, kded4 hovers between 20-something% and 44%. With Amarok 2 playing, it stays at around 45%. After quitting Amarok 2, it goes to the usual 50%. 

What doesn't trigger it? Anything non-KDE-4, as far as I can tell. Amarok 1.4, Audacity, Kaffeine 0.87, jackd, Flash plugin, Freedroid game... no problems there.

Sound hardware: VIA 8237 with ALC850 (on-board sound). 

Xine or GStreamer Backend doesn't make a difference as far as I can tell.
Comment 1 Ken Rushia 2009-12-03 17:29:00 UTC
Confirmed here. Oddly just started happening after Qt 4.6.0 and KDE 4.3.4 updates on Gentoo. I read this bug and then disabled notification sounds and kded4 no longer eats a CPU core. Thanks for the find.
Comment 2 Ken 2009-12-03 19:48:25 UTC
Confirming on Gentoo with Qt 4.6.0 and KDE 4.3.4. kded4 was using 100% cpu until I disabled sound notifications.
Comment 3 Dimitri Scheftelowitsch 2009-12-15 19:46:09 UTC
Confirming on openSUSE with Qt 4.6.0 from KDE:KDE4:UNSTABLE and stock KDE 4.3.1
Comment 4 Dimitri Scheftelowitsch 2009-12-15 20:42:19 UTC
After switching to Qt 4.6.0 from KDE:KDE4:Factory (the official Qt release) I cannot reproduce this behaviour anymore.
Reminds me of 216857, since I also experienced the symptomes described there.
Comment 5 maciej.zubala 2010-01-03 00:06:45 UTC
I might have the same problem. kded4 takes the whole core on kubuntu 9.04 (kde 4.2.4, qt 4.5.0). How can check for sure that this is also my issue ?
Comment 6 David Faure 2010-01-16 12:07:10 UTC
SVN commit 1075552 by dfaure:

Fix 100% CPU usage due to a startTimer(0) that was never stopped; this could
happen if the timer was started twice, so m_timerId was overwritten, and the first
timer ID never recognized. It's much much simpler to use deleteLater: no risk of forgetting
the deletion and no risk of timers running forever. It means using QWeakPointer to notice
when it got deleted, though.
CCMAIL: kretz@kde.org

I'm not sure which of the "kded uses 100% cpu" bugs this really fixes; maybe all,
or maybe just the one that talks about phonon specifically...
Fixed for: 4.4
BUG: 202744
CCBUG: 178228
CCBUG: 184576
CCBUG: 217364
CCBUG: 220047


 M  +16 -34    hardwaredatabase.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1075552
Comment 7 David Faure 2010-01-21 18:59:19 UTC
SVN commit 1078178 by dfaure:

Backport r1075552 (Fix kded using 100% CPU) using QPointer instead of QWeakPointer
(thanks to Rex Dieter for the converted patch)
Fixed for: 4.3.5
CCBUG: 202744


 M  +17 -34    hardwaredatabase.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1078178
Comment 8 Will Stephenson 2010-01-25 13:23:19 UTC
*** Bug 203048 has been marked as a duplicate of this bug. ***