Activity log for bug #311772

Date Who What changed Old value New value Message
2008-12-27 17:43:05 TJ bug added bug
2008-12-27 17:43:22 TJ mythbuntu: status New Confirmed
2008-12-27 17:43:22 TJ mythbuntu: assignee intuitivenipple
2008-12-27 17:43:22 TJ mythbuntu: statusexplanation
2008-12-28 13:52:24 TJ description There are reports in forums and the mythtv mailing list of 'jerky' playback or delayed reaction and high CPU load when using remote controls via lircd . Some people reported noticing the gnome-screensaver process spiking when a key is pressed. http://ubuntuforums.org/showpost.php?p=6385269&postcount=1 http://www.gossamer-threads.com/lists/mythtv/users/348326?do=post_view_threaded I've just analysed the call-path for LIRC events and discovered the cause of the delay. It is the result of poking gnome-screensaver for each key-press on the remote. In summary, the difference between a regular key-press and a remote-control key-press handled by LIRC, is that LIRC creates a custom event. In the Myth front-end the method customEvent() handles the LIRC events. For every event the screensaver's count-down timer is reset. This involves the execution of an external system command each time: gnome-screensaver-command --poke The time it takes the system to run that command is what causes the delay. On some systems the delay will not be as noticeable as on others. It should be possible to use the DBUS API instead to remove this delay. I've developed and am currently testing a patch that uses dbus. Here's the call-path analysis: libs/libmyth/lirc.cpp::LircClient::Process(void) QApplication::postEvent(mainWindow, new LircKeycodeEvent(code, keycode, true)); libs/libmythui/mythmainwindow.cpp::MythMainWindow::customEvent(QCustomEvent *ce) { #if defined(USE_LIRC) || defined(USING_APPLEREMOTE) else if (ce->type() == kLircKeycodeEventType && !d->ignore_lirc_keys) { LircKeycodeEvent *lke = (LircKeycodeEvent *)ce; int keycode = lke->getKeycode(); if (keycode) { gContext->ResetScreensaver(); if (gContext->GetScreenIsAsleep()) return; // ... QKeyEvent key(lke->isKeyDown() ? QEvent::KeyPress : QEvent::KeyRelease, k, ascii, mod, text); QObject *key_target = getTarget(key); if (!key_target) QApplication::sendEvent(this, &key); else QApplication::sendEvent(key_target, &key); } libs/libmythui/mythmainwindow.cpp::MythMainWindow::eventFilter(QObject *, QEvent *e) { switch (e->type()) { case QEvent::KeyPress: { QKeyEvent *ke = dynamic_cast<QKeyEvent*>(e); } There are reports in forums and the mythtv mailing list of 'jerky' playback or delayed reaction and high CPU load when using remote controls via lircd . Some people reported noticing the gnome-screensaver process spiking when a key is pressed. http://ubuntuforums.org/showpost.php?p=6385269&postcount=1 http://www.gossamer-threads.com/lists/mythtv/users/348326?do=post_view_threaded I've just analysed the call-path for LIRC events and discovered the cause of the delay. It is the result of poking gnome-screensaver for each key-press on the remote. In summary, the difference between a regular key-press and a remote-control key-press handled by LIRC, is that LIRC creates a custom event. In the Myth front-end the method customEvent() handles the LIRC events. For every event the screensaver's count-down timer is reset. This involves the execution of an external system command each time: gnome-screensaver-command --poke The time it takes the system to run that command is what causes the delay. On some systems the delay will not be as noticeable as on others. It should be possible to use the DBUS API instead to remove this delay. I've developed and am currently testing a patch that uses dbus. Here's the call-path analysis: libs/libmyth/lirc.cpp::LircClient::Process(void) QApplication::postEvent(mainWindow, new LircKeycodeEvent(code, keycode, true)); libs/libmythui/mythmainwindow.cpp::MythMainWindow::customEvent(QCustomEvent *ce) { #if defined(USE_LIRC) || defined(USING_APPLEREMOTE) else if (ce->type() == kLircKeycodeEventType && !d->ignore_lirc_keys) { LircKeycodeEvent *lke = (LircKeycodeEvent *)ce; int keycode = lke->getKeycode(); if (keycode) { gContext->ResetScreensaver(); if (gContext->GetScreenIsAsleep()) return; // ... QKeyEvent key(lke->isKeyDown() ? QEvent::KeyPress : QEvent::KeyRelease, k, ascii, mod, text); QObject *key_target = getTarget(key); if (!key_target) QApplication::sendEvent(this, &key); else QApplication::sendEvent(key_target, &key); } libs/libmythui/mythmainwindow.cpp::MythMainWindow::eventFilter(QObject *, QEvent *e) { switch (e->type()) { case QEvent::KeyPress: { QKeyEvent *ke = dynamic_cast<QKeyEvent*>(e); } libs/libmythui/mythmainwindow.cpp::MythMainWindow::customEvent(QCustomEvent *ce) libs/libmythui/mythmainwindow.cpp:1515: gContext->DoResetScreensaver(); libs/libmyth/mythcontext.cpp::MythContext::DoResetScreensaver(void) libs/libmyth/mythcontext.cpp::d->screensaver->Reset(); libs/libmyth/screensaver-x11.cpp::ScreenSaverX11::Reset(void) XResetScreenSaver(qt_xdisplay()); if (d->IsScreenSaverRunning()) resetSlot(); libs/libmyth/screensaver-x11.cpp::ScreenSaverX11::resetSlot() d->ResetScreenSaver(); libs/libmyth/screensaver-x11.cpp::ScreenSaverX11Private::ResetScreenSaver() { if (m_xscreensaverRunning) myth_system("xscreensaver-command -deactivate >&- 2>&- &"); else myth_system("gnome-screensaver-command --poke >&- 2>&- &"); }
2008-12-28 16:51:57 TJ bug assigned to mythtv
2008-12-28 17:55:57 Bug Watch Updater mythtv: status Unknown Fix Released
2009-02-13 06:04:52 TJ mythbuntu: assignee intuitivenipple
2009-05-12 02:24:21 MarcRandolph mythbuntu: status Confirmed Fix Released