diff --git a/packages/mediacenter/xbmc-pvr/install b/packages/mediacenter/xbmc-pvr/install index 75515f79c7..7a81b924e3 100755 --- a/packages/mediacenter/xbmc-pvr/install +++ b/packages/mediacenter/xbmc-pvr/install @@ -28,6 +28,7 @@ mkdir -p $INSTALL/usr/bin cp $PKG_DIR/scripts/cputemp $INSTALL/usr/bin cp $PKG_DIR/scripts/gputemp $INSTALL/usr/bin cp $PKG_DIR/scripts/wait_on_xbmc_exit $INSTALL/usr/bin + cp $PKG_DIR/scripts/setwakeup.sh $INSTALL/usr/bin cp $PKG_BUILD/tools/EventClients/Clients/XBMC\ Send/xbmc-send.py $INSTALL/usr/bin/xbmc-send mkdir -p $INSTALL/usr/lib/xbmc diff --git a/packages/mediacenter/xbmc-pvr/patches/xbmc-pvr-11.0.1-991-set_wakeup_at_timer_at_suspend_or_hibernet.patch b/packages/mediacenter/xbmc-pvr/patches/xbmc-pvr-11.0.1-991-set_wakeup_at_timer_at_suspend_or_hibernet.patch new file mode 100644 index 0000000000..f2cbebb687 --- /dev/null +++ b/packages/mediacenter/xbmc-pvr/patches/xbmc-pvr-11.0.1-991-set_wakeup_at_timer_at_suspend_or_hibernet.patch @@ -0,0 +1,101 @@ +diff --git a/xbmc/ApplicationMessenger.cpp b/xbmc/ApplicationMessenger.cpp +index 7ef2027..bea711b 100644 +--- a/xbmc/ApplicationMessenger.cpp ++++ b/xbmc/ApplicationMessenger.cpp +@@ -73,6 +73,9 @@ + #include "utils/JobManager.h" + #include "storage/DetectDVDType.h" + ++#include "pvr/PVRManager.h" ++ ++using namespace PVR; + using namespace std; + + CDelayedMessage::CDelayedMessage(ThreadMessage& msg, unsigned int delay) +@@ -261,12 +264,14 @@ void CApplicationMessenger::ProcessMessage(ThreadMessage *pMsg) + + case TMSG_HIBERNATE: + { ++ g_PVRManager.SetWakeupCommand(); + g_powerManager.Hibernate(); + } + break; + + case TMSG_SUSPEND: + { ++ g_PVRManager.SetWakeupCommand(); + g_powerManager.Suspend(); + } + break; +diff --git a/xbmc/pvr/PVRManager.h b/xbmc/pvr/PVRManager.h +index 94a8c9a..99280c6 100644 +--- a/xbmc/pvr/PVRManager.h ++++ b/xbmc/pvr/PVRManager.h +@@ -450,6 +450,11 @@ namespace PVR + */ + void LoadCurrentChannelSettings(void); + ++ /*! ++ * @brief Executes "pvrpowermanagement.setwakeupcmd" ++ */ ++ bool SetWakeupCommand(void); ++ + protected: + /*! + * @brief PVR update and control thread. +@@ -525,11 +530,6 @@ namespace PVR + void ShowProgressDialog(const CStdString &strText, int iProgress); + + /*! +- * @brief Executes "pvrpowermanagement.setwakeupcmd" +- */ +- bool SetWakeupCommand(void); +- +- /*! + * @brief Hide the progress dialog if it's visible. + */ + void HideProgressDialog(void); +diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp +index cfba9bb..4e757d6 100644 +--- a/xbmc/pvr/timers/PVRTimers.cpp ++++ b/xbmc/pvr/timers/PVRTimers.cpp +@@ -714,8 +714,7 @@ CDateTime CPVRTimers::GetNextEventTime(void) const + const CDateTimeSpan prewakeup(0, 0, g_guiSettings.GetInt("pvrpowermanagement.prewakeup"), 0); + const CDateTimeSpan idle(0, 0, g_guiSettings.GetInt("pvrpowermanagement.backendidletime"), 0); + +- CDateTime timerwakeuptime; +- CDateTime dailywakeuptime; ++ CDateTime retVal; + + /* Check next active time */ + CPVRTimerInfoTag timer; +@@ -724,15 +723,16 @@ CDateTime CPVRTimers::GetNextEventTime(void) const + const CDateTime start = timer.StartAsUTC(); + + if ((start - idle) > now) { +- timerwakeuptime = start - prewakeup; ++ retVal = start - prewakeup; + } else { +- timerwakeuptime = now + idle; ++ retVal = now + idle; + } + } + + /* check daily wake up */ + if (dailywakup) + { ++ CDateTime dailywakeuptime; + dailywakeuptime.SetFromDBTime(g_guiSettings.GetString("pvrpowermanagement.dailywakeuptime", false)); + dailywakeuptime = dailywakeuptime.GetAsUTCDateTime(); + +@@ -746,8 +746,9 @@ CDateTime CPVRTimers::GetNextEventTime(void) const + const CDateTimeSpan oneDay(1,0,0,0); + dailywakeuptime += oneDay; + } ++ if (dailywakeuptime < retVal) ++ retVal = dailywakeuptime; + } + +- const CDateTime retVal((dailywakeuptime < timerwakeuptime) ? dailywakeuptime : timerwakeuptime); + return retVal; + } diff --git a/packages/mediacenter/xbmc-pvr/scripts/setwakeup.sh b/packages/mediacenter/xbmc-pvr/scripts/setwakeup.sh new file mode 100755 index 0000000000..e8be3036a0 --- /dev/null +++ b/packages/mediacenter/xbmc-pvr/scripts/setwakeup.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +################################################################################ +# Copyright (C) 2009-2010 OpenELEC.tv +# http://www.openelec.tv +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +if [ -f /sys/class/rtc/rtc0/wakealarm ]; then + logger -t setwakeup.sh "### Setting system wakeup time ###" + echo 0 > /sys/class/rtc/rtc0/wakealarm + echo $1 > /sys/class/rtc/rtc0/wakealarm + logger -t setwakeup.sh "### $(cat /proc/driver/rtc) ###" +fi