Bug 281775 - knotify4 is wasting CPU cycles
Summary: knotify4 is wasting CPU cycles
Status: RESOLVED FIXED
Alias: None
Product: phonon-backend-gstreamer
Classification: Unmaintained
Component: general (show other bugs)
Version: 4.5.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Harald Sitter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-10 23:34 UTC by Dima Ryazanov
Modified: 2012-02-15 15:28 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dima Ryazanov 2011-09-10 23:34:29 UTC
Version:           unspecified (using KDE 4.7.1) 
OS:                Linux

knotify4 is constantly using up about 2% of the CPU. Sure, it's not a lot, but when dbus-daemon, udisks-daemon, amarok, etc. each use another 1-2%, it all adds up. Even when doing a Google search for "knotify4", most of the results are about knotify wasting CPU, so looks like it affects lots of people.

I've tried running strace and gdb, but the output doesn't look very interesting:


$ strace -fp 2796
[pid  2796] read(7, 0x1737d34, 4096)    = -1 EAGAIN (Resource temporarily unavailable)
[pid  2796] read(7, 0x1737d34, 4096)    = -1 EAGAIN (Resource temporarily unavailable)
[pid  2796] poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=9, events=POLLIN}, {fd=11, events=POLLIN}, {fd=5, events=POLLIN}, {fd=14, events=POLLIN}], 6, 0) = 0 (Timeout)
[pid  2796] read(7, 0x1737d34, 4096)    = -1 EAGAIN (Resource temporarily unavailable)
[pid  2796] read(7, 0x1737d34, 4096)    = -1 EAGAIN (Resource temporarily unavailable)
[pid  2796] poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=9, events=POLLIN}, {fd=11, events=POLLIN}, {fd=5, events=POLLIN}, {fd=14, events=POLLIN}], 6, 0) = 0 (Timeout)
...

$ gdb -p 2796
...
Breakpoint 1, read () at ../sysdeps/unix/syscall-template.S:82
82      ../sysdeps/unix/syscall-template.S: No such file or directory.
        in ../sysdeps/unix/syscall-template.S
(gdb) bt
#0  read () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f32fe9e2f1d in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007f32fe9e33f8 in xcb_poll_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007f3302d26099 in poll_for_event (dpy=0x1742750) at ../../src/xcb_io.c:256
#4  0x00007f3302d26161 in poll_for_response (dpy=0x1742750) at ../../src/xcb_io.c:288
#5  0x00007f3302d2688d in _XEventsQueued (dpy=0x1742750, mode=<optimized out>) at ../../src/xcb_io.c:362
#6  0x00007f3302d1714f in XEventsQueued (dpy=0x1742750, mode=2) at ../../src/Pending.c:43
#7  0x00007f3304973a9c in x11EventSourceCheck (s=0x171fce0) at kernel/qguieventdispatcher_glib.cpp:85
#8  0x00007f3300c2a844 in g_main_context_check (context=0x171f800, max_priority=0, fds=<optimized out>, n_fds=<optimized out>)
    at /build/buildd/glib2.0-2.29.90/./glib/gmain.c:2959
#9  0x00007f3300c2b092 in g_main_context_iterate (context=0x171f800, block=<optimized out>, dispatch=1, self=<optimized out>)
    at /build/buildd/glib2.0-2.29.90/./glib/gmain.c:3086
#10 0x00007f3300c2b539 in g_main_context_iteration (context=0x171f800, may_block=1) at /build/buildd/glib2.0-2.29.90/./glib/gmain.c:3152
#11 0x00007f3303c7ded6 in QEventDispatcherGlib::processEvents (this=0x16facd0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#12 0x00007f3304973c6e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#13 0x00007f3303c51cf2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#14 0x00007f3303c51ef7 in QEventLoop::exec (this=0x7fff28105dd0, flags=...) at kernel/qeventloop.cpp:201
#15 0x00007f3303c56789 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
#16 0x0000000000409787 in ?? ()
#17 0x00007f330346130d in __libc_start_main (main=0x409140, argc=1, ubp_av=0x7fff281061f8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fff281061e8) at libc-start.c:226
#18 0x0000000000409865 in _start ()


Reproducible: Always

Steps to Reproduce:
Start KDE and run "top"

Actual Results:  
knotify4 is on top, using up 2% of CPU.

Expected Results:  
knotify should not be doing anything.
Comment 1 Christoph Feck 2011-09-10 23:52:28 UTC
If you configure KNotify to not use Phonon using "System Settings > Application and System Notifications > Player Settings > No audio output", then restart KDE, does knotify4 still consume CPU cycles?
Comment 2 Dima Ryazanov 2011-09-16 20:28:11 UTC
No, looks like it stopped. Thanks!

(Though I'd assume this is still a bug, right?)
Comment 3 Christoph Feck 2011-09-16 20:44:28 UTC
Sure it is a bug :) But in your case, it would be a Phonon bug, so I am reassigning to Phonon maintainers.
Comment 4 Romain Perier 2011-09-16 20:56:14 UTC
Hi, It's on ubuntu, so it's phonon 4.5.1, I guess. What backend do you use ? Take a look at System Settings -> Multimedia -> Phonon -> last tab.
Comment 5 Dima Ryazanov 2011-09-16 21:01:11 UTC
I'm using the GStreamer backend. And yes, it's 4.5.1.
Comment 6 Myriam Schweingruber 2011-09-17 08:34:42 UTC
Reassigning to the correct product.
Comment 7 Bartosz Brachaczek 2011-09-17 12:35:05 UTC
Might be related to bug 156215 and/or bug 216130.
Comment 8 Harald Sitter 2011-09-17 12:36:49 UTC
Unlikely
Comment 9 Romain Perier 2011-09-17 13:06:18 UTC
Dima: I can reproduce it with phonon-gstreamer 4.5.1 but it has been fixed in phonon-gstreamer 4.6 RC1. Could do you try it ? See  http://wm161.net/2011/09/16/phonon-gstreamer-4-6-rc1/

If you encounter issues trying to build pgst 4.6RC1, feel free to contact me via email or IRC.