[vdr] 15/16: Updated opt-60_power-saving.patch to the version provided for 2.3.x

Tobias Grimm tiber-guest at moszumanska.debian.org
Wed Dec 27 13:02:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

tiber-guest pushed a commit to annotated tag debian/2.3.2-1_etobi1
in repository vdr.

commit 8e393311ba0f27fe8cf040e10aaed7077bdd35ce
Author: Tobias Grimm <etobi at debian.org>
Date:   Sat Jan 7 20:04:51 2017 +0100

    Updated opt-60_power-saving.patch to the version provided for 2.3.x
---
 debian/patches/opt-60_power-saving.patch | 64 +++++++++++++++++++++++++-------
 1 file changed, 51 insertions(+), 13 deletions(-)

diff --git a/debian/patches/opt-60_power-saving.patch b/debian/patches/opt-60_power-saving.patch
index 8e80224..d88f578 100644
--- a/debian/patches/opt-60_power-saving.patch
+++ b/debian/patches/opt-60_power-saving.patch
@@ -1,6 +1,42 @@
-Description: Power down DVB decices which are idle
-Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
-
+From d2ce271a6f10b36356a57e2e89b677dbc9228c38 Mon Sep 17 00:00:00 2001
+From: glenvt18 <glenvt18 at gmail.com>
+Date: Thu, 18 Aug 2016 16:44:18 +0300
+Subject: [PATCH v2] Device power saving feature
+
+This patch introduces a feature which allows an idle device (a device
+which is not currently recording or streaming) to enter a power-down
+mode after some period of time. Given two timeout values,
+PowerdownTimeoutM and PowerdownWakeupH, it works like this: when a
+device becomes idle, it is kept powered up for PowerdownTimeoutM minutes
+doing, for instance, an EPG scan before it is powered down. If the
+device is still idle and has been powered down for PowerdownWakeupH
+hours it is powered up for PowerdownTimeoutM minutes and so on. When
+recording, streaming or a forced EPG scan starts, the device is powered
+up and it's idle timer is disabled. This implies that PowerdownTimeoutM
+should be enough for a full round of EPG scanning (20 seconds *
+number_of_transponders). Another option is to run EPG scans from cron
+(at night) and use SVDRP SCAN command.
+
+Actual implementation of power saving facilities is left to a derived
+device class. In the case of a DVB device it is implemented by closing
+it's frontend device. For a DVB-S/S2 tuner this usually means powering
+the LNB off. My measurements show 3-4W power consumption drops per tuner
+for various DVB-S/S2 tuners. So, this feature (together with HDD
+spin-down) is especially valuable while running a headless 24/7 VDR
+server and/or using several tuners. A SATIP device can also implement
+power saving if it is supported by a server.
+---
+ config.c    |  9 ++++++
+ config.h    |  3 ++
+ device.c    | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ device.h    | 31 ++++++++++++++++++++
+ dvbdevice.c | 39 +++++++++++++++++++++++++
+ dvbdevice.h |  7 +++++
+ eitscan.c   |  7 ++++-
+ menu.c      |  9 +++++-
+ vdr.c       |  6 ++++
+ 9 files changed, 203 insertions(+), 4 deletions(-)
+
 --- a/config.c
 +++ b/config.c
 @@ -395,6 +395,9 @@
@@ -134,7 +170,7 @@ Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
 +           sectionHandler->SetStatus(false);
 +           sectionHandler->SetChannel(NULL);
 +           }
-+        PowerDown(true);
++        PowerDownMode(true);
 +        }
 +     }
 +  if (wakeupTimerExpires != 0 && time(NULL) > wakeupTimerExpires) {
@@ -143,7 +179,7 @@ Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
 +     SetIdleTimer(true);
 +     if (IsPoweredDown()) {
 +        dsyslog("power saving: waking up device %d", CardIndex() + 1);
-+        PowerDown(false);
++        PowerDownMode(false);
 +        }
 +     }
 +}
@@ -188,7 +224,7 @@ Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
 +  cMutexLock MutexLock(&mutexPowerSaving);
 +  SetIdleTimer(true, ExtraTimeoutS);
 +  if (SupportsPowerDown() && IsPoweredDown())
-+     PowerDown(false);
++     PowerDownMode(false);
 +}
 +
  // --- cTSBuffer -------------------------------------------------------------
@@ -196,7 +232,7 @@ Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
  cTSBuffer::cTSBuffer(int File, int Size, int CardIndex)
 --- a/device.h
 +++ b/device.h
-@@ -826,6 +826,35 @@
+@@ -826,6 +826,37 @@
         ///< Detaches all receivers from this device for this pid.
    virtual void DetachAllReceivers(void);
         ///< Detaches all receivers from this device.
@@ -223,9 +259,11 @@ Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
 +       ///< won't be set, but the device will be kept powered up for at least
 +       ///< ExtraTimeoutS seconds.
 +protected:
++       ///< NOTE: IsTunedToTransponder() should return false if the
++       ///< device is powered down.
 +  virtual bool IsPoweredDown(void) {return false;}
 +       ///< Returns true if the device is powered down "physically".
-+  virtual void PowerDown(bool On) {};
++  virtual void PowerDownMode(bool On) {};
 +       ///< Actually powers the device down/up.
 +  virtual bool SupportsPowerDown() {return false;}
 +       ///< Returns true if a derived device supports power saving.
@@ -239,7 +277,7 @@ Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
    int GetSignalStrength(void) const;
    int GetSignalQuality(void) const;
 +  bool IsPoweredDown(void) {return fd_frontend < 0;}
-+  void PowerDown(bool On);
++  void PowerDownMode(bool On);
    };
  
  cMutex cDvbTuner::bondMutex;
@@ -265,7 +303,7 @@ Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
          }
  }
  
-+void cDvbTuner::PowerDown(bool On)
++void cDvbTuner::PowerDownMode(bool On)
 +{
 +  cMutexLock MutexLock(&mutex);
 +  if (On && fd_frontend >= 0) {
@@ -299,10 +337,10 @@ Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
 +  return false;
 +}
 +
-+void cDvbDevice::PowerDown(bool On)
++void cDvbDevice::PowerDownMode(bool On)
 +{
 +  if (dvbTuner)
-+     dvbTuner->PowerDown(On);
++     dvbTuner->PowerDownMode(On);
 +}
 +
  // --- cDvbDeviceProbe -------------------------------------------------------
@@ -319,7 +357,7 @@ Author: Sergey Chernyavskiy <glenvt18 at gmail.com>
 +
 +protected:
 +  virtual bool IsPoweredDown(void);
-+  virtual void PowerDown(bool On);
++  virtual void PowerDownMode(bool On);
 +  virtual bool SupportsPowerDown() {return true;}
    };
  

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr.git



More information about the pkg-vdr-dvb-changes mailing list