[mythtv-commits] Ticket #12960: Patch to prevent a remote frontend idlescreen (standby) from waking up the backend ater the backend becomes idle.

MythTV noreply at mythtv.org
Tue Dec 20 15:56:22 UTC 2016


#12960: Patch to prevent a remote frontend idlescreen (standby) from waking up the
backend ater the backend becomes idle.
--------------------------+------------------------------------------------
     Reporter:  mythtv@…  |      Owner:
         Type:  Patch -   |     Status:  new
  Feature                 |
     Priority:  minor     |  Milestone:  unknown
    Component:  MythTV -  |    Version:  0.28.0
  General                 |
     Severity:  medium    |   Keywords:  idlescreen standby wake-on-lan wol
Ticket locked:  0         |
--------------------------+------------------------------------------------
 The idlescreen (standby) screen in mythtv-0.28 provides a very useful
 function that allows the backend to shutdown and keep the user informed
 about the state of the backend server. This works well on a combined
 master backend/frontend deployment but for remote frontends, the master
 backend is restarted, by the idlescreen updates, via WOL every time it
 shuts down (unless WOL is disabled for the master backend).

 This bug report describes an enhancement such that Wake-on-LAN (WOL) is
 disabled when the idlescreen has focus and the master backend has shut
 down.

 A patch is attached to implement this.

 This patch updates mythfrontend/idlescreen.cpp,
 mythfrontend/backendconnectionmanager.cpp and
 libmythbase/mythcorecontext.cpp (plus associated .h files). The
 functionality of the frontend is unchanged unless the idlescreen is
 displayed. After the master backend has issued a SHUTDOWN_NOW event,
 further backend connection attempt from the idlescreen disable WOL. When
 the master backend restarts (to record etc) WOL is re-enable for the
 idlescreen.

 Summary of changes:
 mythfrontend/idlescreen.cpp
     Changes made to disable WOL when the master backend has announced it
 is 'shutting down now' and re-enable it after master backend restart.

     New events IDLE_SCREEN_LOADED and IDLE_SCREEN_DESTROYED sent on
 idlescreen creation and destruction.
     New parameter 'bool disableWOL' added to call of
 SafeConnectToMasterServer. When called set to m_disableWOL.
     Extra code in IdleScreen::customEvent to set m_disableWOL true on a
 SHUTDOWN_NOW event.
     Extra code in IdleScreen::customEvent to set m_disableWOL false on a
 RECONNECT_SUCCESS event.

 backendconnectionmanager.cpp
     Changes made to enable detection of SHUTDOWN_NOW, IDLE_SCREEN_LOADED
 and IDLE_SCREEN_DESTROYED events and disabling of WOL during reconnect
 retries.

     New variable 'bool m_disableWOL' added to class Reconnect.
     New parameter 'bool disableWOL' with default value of false added to
 Reconnect.
     New variables 'bool m_frontend_idle' and 'bool m_shutdown_now'.
     Extra parameter 'bool disableWOL' add to calls of
 SafeConnectToMasterServer, set to true when both m_frontend_idle and
 m_shutdown_now are true.
     In BackendConnectionManager::customEvent additional code to catch
 IDLE_SCREEN_LOADED and IDLE_SCREEN_DESTROYED setting m_frontend_idle
 appropriately.
     Extra code in BackendConnectionManager::customEvent to set
 m_shutdown_now true on SHUTDOWN_NOW event.
     Extra code in BackendConnectionManager::customEvent to set
 m_shutdown_now false on RECONNECT_SUCCESS event.

 libmythbase/mythcorecontext.cpp
     Changes made to allow 'bool disableWOL' to be passed to
 ConnectCommandSocket which implements WOL.

     Extra parameter 'bool disableWOL' with default value of false added to
 definitions of SafeConnectToMasterServer, ConnectToMasterServer,
 ConnectCommandSocket.

 See attached patch.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/12960>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list