Patrick Boettcher | 17 Jul 15:36 2016
Picon

SatIP>plugin: how to configure 2 DD Octopus NETs with different satellites

Hi,

I have 2 DD Octopus NET devices. One is a 2x DVB-S(2) + 2x DVB-T(2)
(let's call it AA) and the other one is 4x DVB-S(2) (BB).

AA's satellite orientation is Astra 28.2, BB's one is Astra 19.2.

How can I associate AA's or BB's inputs in VDR's configuration so that
it uses 

  1) the right input for the right source

  2) the maximum number of devices in parallel for recording,
     epg-scanning etc.

conf.d/50-satip.conf contains 

  --devices=8
  --server=192.168.1.21|DVBS2-4|Octo1;192.168.1.20|DVBS2-2,DVBT2-2|Octo2

I found discussions where they say that in sources.conf one needs to
assigned device numbers, so I tried:

  S19.2E 1 Astra 1KR/1L/1M/2C
  S19.2E 2 Astra 1KR/1L/1M/2C
  S19.2E 3 Astra 1KR/1L/1M/2C
  S19.2E 4 Astra 1KR/1L/1M/2C
  S28.2E 5 Astra 1N/2A/2F
  S28.2E 6 Astra 1N/2A/2F

(Continue reading)

Stuart Morris | 2 Jul 18:05 2016
Picon

Logical Channel Numbers

I have recently upgraded to VDR v2.2.0 and I notice in the changelog that support for Logical Channel Numbers (LCN) has been added.
Is there any way to sort and select VDR channels by LCN yet?

BTW My attempts at using scan to generate a channels.conf with LCN have been unsuccessful due to the fact that scan does not detect DVB-T2 FreeviewHD muxes in the UK.

Thanks
Stu-e
_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Behrooz Ramezani | 2 Jul 05:54 2016
Picon
Gravatar

Error in compile softhddevice

Hello evryone
I give this error when i compile softhddevice
[behrooz <at> Lenovo-G500 softhddevice-0.6.0]$ make
g++ -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -g -fvar-tracking-assignments -O3 -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/alsa      -DPLUGIN_NAME_I18N='"softhddevice"' -D_GNU_SOURCE  -DAV_INFO -DAV_INFO_TIME=3000     -DUSE_PIP             -DUSE_ALSA -DUSE_OSS -DUSE_VDPAU -DUSE_VAAPI -DUSE_SCREENSAVER -DUSE_SWRESAMPLE   -g -W -Wall -Wextra -Winit-self -Werror=overloaded-virtual   -c -o softhddevice.o softhddevice.cpp
In file included from softhddevice.cpp:46:0:
video.h:63:13: error: use of enum 'PixelFormat' without previous declaration
 extern enum PixelFormat Video_get_format(VideoHwDecoder *, AVCodecContext *,
             ^~~~~~~~~~~
video.h:64:16: error: use of enum 'PixelFormat' without previous declaration
     const enum PixelFormat *);
                ^~~~~~~~~~~
softhddevice.cpp: In member function 'virtual void cSoftOsd::Flush()':
softhddevice.cpp:480:31: error: invalid conversion from 'cPixmap*' to 'cPixmapMemory*' [-fpermissive]
     while ((pm = RenderPixmaps())) {
                  ~~~~~~~~~~~~~^~
softhddevice.cpp: At global scope:
softhddevice.cpp:2046:18: error:   by 'virtual void cSoftHdDevice::TrickSpeed(int)' [-Werror=overloaded-virtual]
     virtual void TrickSpeed(int);
                  ^~~~~~~~~~
cc1plus: some warnings being treated as errors
make: *** [<builtin>: softhddevice.o] Error 1

I using Arch linux
_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Richard F | 26 Jun 12:23 2016

vdr --genindex fails on radio recording

Hi Klaus,

In my testing, (VDR 2.20) the command vdr --genindex fails on an audio-only recording from a radio station for example.

The index file is generated during a recording, but if deleted, vdr itself cannot regenerate it, nor can the command line command. Kodi for example tries to regenerate it when playing, if it's missing, and fails. If the index is already there, it gets deleted.  Is this by design, or a bug ?

Thanks

Richard

_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Joerg Bornkessel | 21 Jun 13:25 2016
Picon

vdr-2.2.0 fails on compile with systemd-230

vdr-2.2.0 failed on compile up from systemd-230,
this results, as systemd upstream has removed some pkg-configure files.
removed files are marked as deprecated in previous version.
reviewing the removed files, they include the same content, exclude the
description,
atached patch fix this problem.
So far the theory as i don't have test it.
I dont have a systemd install and never ever i will infect my mashines
with the Poettering MALWARE.

see also
https://bugs.gentoo.org/show_bug.cgi?id=586070

Cheers

/bin/joerg
Attachment (vdr-2.2.0-sdnotivy.patch): text/x-patch, 786 bytes
_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Richard F | 16 Jun 11:44 2016

Cutter - wrong directory?

Hi Klaus,

I was trying the cutter for the first time and noticed that it didn't seem to be obeying the --video flag

It seemed to be trying default, causing this error:

Jun 16 09:12:56 ha-server vdr: [29658] ERROR (tools.c,459): /var/spool/video//mnt: Permission denied

I rebuilt with the makefile adjusted to match my config and the cutter then worked.

Is that a bug?

Thanks

Richard


_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Richard F | 30 May 22:45 2016

"TS packets to determine frame type"

Hi Klaus,

I'm 99% of the way to finishing my H264 ffmpeg transcoding script, I'm just getting 2 of these warnings when
reindexing transcoded files

May 30 21:08:09 ha-server vdr: [31785] WARNING: required 5 video TS packets to determine frame type
May 30 21:08:09 ha-server vdr: [31785] WARNING: required 5 video TS packets to determine frame type

Sometimes the number is 4. Fortunately not over 6 yet.
Is this a functional problem ? (files play in everything I need them to).
I reduced the I-frame gap which also improves seeking performance, but that's not the issue.

Looking at the code I'm not quite sure what it's looking for - can you help?

I may be able to adjust codec / muxer to avoid warnings

Thanks
Richard

_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Birgit & Andreas Böttger | 26 May 23:08 2016
Picon

Re: TBS driver breaks lirc_serial

Hi Karim,

Karim schrieb am 26.05.2016 um 22:39:
> I tried today with Jessie 8.4.0 x64, exactly same problem :-(
> I think we tried all the ways. I opened a case at TBS support a few days ago.
> They asked me to send them "lirc_serial.ko working" to check, it seems they could integrate it in their driver.
> If so, it should be great !
>
> Many thanks for your help !
> Of course, if I have some good news from TBS, I will post here.

You mean that the (current) TBS driver is incompatible to Debian?
Maybe .. OK, let's check the TBS support :)

Best regards
Andreas Böttger

_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
glenvt18 | 26 May 17:59 2016
Picon

[PATCH] cSkinXXXXDisplayMenu::SetEvent(): fix date buffer size

32 bytes is not enough for multi-byte utf8 strings

Date string is truncated.

Please review,
Sergey Chernyavskiy.
---
 PLUGINS/src/skincurses/skincurses.c | 2 +-
 skinclassic.c                       | 2 +-
 skinlcars.c                         | 2 +-
 skinsttng.c                         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c
index 358035e..fcf183d 100644
--- a/PLUGINS/src/skincurses/skincurses.c
+++ b/PLUGINS/src/skincurses/skincurses.c
 <at>  <at>  -407,7 +407,7  <at>  <at>  void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event)
      return;
   int y = 2;
   cTextScroller ts;
-  char t[32];
+  char t[64];
   snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
   ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, t, &Font, clrYellow, clrBackground);
   if (Event->Vps() && Event->Vps() != Event->StartTime()) {
diff --git a/skinclassic.c b/skinclassic.c
index b6d183b..410230d 100644
--- a/skinclassic.c
+++ b/skinclassic.c
 <at>  <at>  -352,7 +352,7  <at>  <at>  void cSkinClassicDisplayMenu::SetEvent(const cEvent *Event)
   const cFont *font = cFont::GetFont(fontOsd);
   int y = y2;
   cTextScroller ts;
-  char t[32];
+  char t[64];
   snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
   ts.Set(osd, x1, y, x2 - x1, y3 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
   if (Event->Vps() && Event->Vps() != Event->StartTime()) {
diff --git a/skinlcars.c b/skinlcars.c
index d84a753..7c5561c 100644
--- a/skinlcars.c
+++ b/skinlcars.c
 <at>  <at>  -1636,7 +1636,7  <at>  <at>  void cSkinLCARSDisplayMenu::SetEvent(const cEvent *Event)
   int xl = xi00;
   int y = yi00;
   cTextScroller ts;
-  char t[32];
+  char t[64];
   snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
   ts.Set(osd, xl, y, xi01 - xl, yi01 - y, t, font, Theme.Color(clrEventTime), Theme.Color(clrBackground));
   if (Event->Vps() && Event->Vps() != Event->StartTime()) {
diff --git a/skinsttng.c b/skinsttng.c
index f10f120..f81b13e 100644
--- a/skinsttng.c
+++ b/skinsttng.c
 <at>  <at>  -655,7 +655,7  <at>  <at>  void cSkinSTTNGDisplayMenu::SetEvent(const cEvent *Event)
   int xl = x3 + TextSpacing;
   int y = y3;
   cTextScroller ts;
-  char t[32];
+  char t[64];
   snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
   ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
   if (Event->Vps() && Event->Vps() != Event->StartTime()) {
--

-- 
1.9.1

_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
glenvt18 | 26 May 17:58 2016
Picon

[PATCH] cDevice::GetDeviceForTransponder(): fix a typo

d->MaySwitchTransponder(Channel) is always false here

Please review,
Sergey Chernyavskiy.

---
 device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/device.c b/device.c
index 18867cd..542d120 100644
--- a/device.c
+++ b/device.c
 <at>  <at>  -342,7 +342,7  <at>  <at>  cDevice *cDevice::GetDeviceForTransponder(const cChannel *Channel, int Priority)
          if (d->ProvidesTransponder(Channel)) {
             if (d->MaySwitchTransponder(Channel))
                Device = d; // this device may switch to the transponder without disturbing any receiver or live view
-            else if (!d->Occupied() && d->MaySwitchTransponder(Channel)) { // MaySwitchTransponder()
implicitly calls Occupied()
+            else if (!d->Occupied()) { // MaySwitchTransponder() implicitly calls Occupied()
                if (d->Priority() < Priority && (!Device || d->Priority() < Device->Priority()))
                   Device = d; // use this one only if no other with less impact can be found
                }
--

-- 
1.9.1

_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
glenvt18 | 26 May 17:36 2016
Picon

[PATCH] Device power saving feature

Hi folks.

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.

I know about the dynamite plugin, but 1) it does much more then this, 2)
still requires a VDR patch, which is bigger, 3) doesn't work reliably
for me and 4) I think this functionality should be part of the VDR
core.

A copy of the patch is here:
http://pastebin.com/FRi0kTjf

Please review,
Sergey Chernyavskiy.

---
 config.c    |  9 ++++++
 config.h    |  3 ++
 device.c    | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 device.h    | 29 +++++++++++++++++++
 dvbdevice.c | 39 +++++++++++++++++++++++++
 dvbdevice.h |  7 +++++
 eitscan.c   |  7 ++++-
 menu.c      |  9 +++++-
 vdr.c       |  6 ++++
 9 files changed, 201 insertions(+), 4 deletions(-)

diff --git a/config.c b/config.c
index e5f5463..794c9f8 100644
--- a/config.c
+++ b/config.c
 <at>  <at>  -395,6 +395,9  <at>  <at>  cSetup::cSetup(void)
   PositionerSpeed = 15;
   PositionerSwing = 650;
   PositionerLastLon = 0;
+  PowerdownEnabled = 0;
+  PowerdownTimeoutM = 15;
+  PowerdownWakeupH = 4;
   SetSystemTime = 0;
   TimeSource = 0;
   TimeTransponder = 0;
 <at>  <at>  -622,6 +625,9  <at>  <at>  bool cSetup::Parse(const char *Name, const char *Value)
   else if (!strcasecmp(Name, "PositionerSpeed"))     PositionerSpeed
  = atoi(Value);
   else if (!strcasecmp(Name, "PositionerSwing"))     PositionerSwing
  = atoi(Value);
   else if (!strcasecmp(Name, "PositionerLastLon"))
PositionerLastLon  = atoi(Value);
+  else if (!strcasecmp(Name, "PowerdownEnabled"))    PowerdownEnabled
  = atoi(Value);
+  else if (!strcasecmp(Name, "PowerdownTimeoutM"))
PowerdownTimeoutM  = atoi(Value);
+  else if (!strcasecmp(Name, "PowerdownWakeupH"))    PowerdownWakeupH
  = atoi(Value);
   else if (!strcasecmp(Name, "SetSystemTime"))       SetSystemTime
  = atoi(Value);
   else if (!strcasecmp(Name, "TimeSource"))          TimeSource
  = cSource::FromString(Value);
   else if (!strcasecmp(Name, "TimeTransponder"))     TimeTransponder
  = atoi(Value);
 <at>  <at>  -753,6 +759,9  <at>  <at>  bool cSetup::Save(void)
   Store("PositionerSpeed",    PositionerSpeed);
   Store("PositionerSwing",    PositionerSwing);
   Store("PositionerLastLon",  PositionerLastLon);
+  Store("PowerdownEnabled",   PowerdownEnabled);
+  Store("PowerdownTimeoutM",  PowerdownTimeoutM);
+  Store("PowerdownWakeupH",   PowerdownWakeupH);
   Store("SetSystemTime",      SetSystemTime);
   Store("TimeSource",         cSource::ToString(TimeSource));
   Store("TimeTransponder",    TimeTransponder);
diff --git a/config.h b/config.h
index e5565da..7a73d9d 100644
--- a/config.h
+++ b/config.h
 <at>  <at>  -273,6 +273,9  <at>  <at>  public:
   int PositionerSpeed;
   int PositionerSwing;
   int PositionerLastLon;
+  int PowerdownEnabled;
+  int PowerdownTimeoutM;
+  int PowerdownWakeupH;
   int SetSystemTime;
   int TimeSource;
   int TimeTransponder;
diff --git a/device.c b/device.c
index 542d120..9306adb 100644
--- a/device.c
+++ b/device.c
 <at>  <at>  -104,6 +104,9  <at>  <at>  cDevice::cDevice(void)
   dvbSubtitleConverter = NULL;
   autoSelectPreferredSubtitleLanguage = true;

+  idleTimerExpires = time(NULL) + Setup.PowerdownTimeoutM * 60;
+  wakeupTimerExpires = 0;
+
   for (int i = 0; i < MAXRECEIVERS; i++)
       receiver[i] = NULL;

 <at>  <at>  -745,6 +748,11  <at>  <at>  bool cDevice::SwitchChannel(int Direction)
   return result;
 }

+// While switching to a channel, the device will be kept powered up
+// for at least this number of seconds before a receiver is attached.
+// Must be less than cEITScanner::ScanTimeout.
+#define CHANNEL_SWITCH_POWERUP_TIMEOUT  10
+
 eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
 {
   cStatus::MsgChannelSwitch(this, 0, LiveView);
 <at>  <at>  -778,6 +786,8  <at>  <at>  eSetChannelResult cDevice::SetChannel(const
cChannel *Channel, bool LiveView)
         Result = scrNotAvailable;
      }
   else {
+     // Power up the device
+     PowerUp(CHANNEL_SWITCH_POWERUP_TIMEOUT);
      // Stop section handling:
      if (sectionHandler) {
         sectionHandler->SetStatus(false);
 <at>  <at>  -843,8 +853,11  <at>  <at>  int cDevice::Occupied(void) const

 void cDevice::SetOccupied(int Seconds)
 {
-  if (Seconds >= 0)
+  if (Seconds >= 0) {
      occupiedTimeout = time(NULL) + min(Seconds, MAXOCCUPIEDTIMEOUT);
+     // avoid short power-down/power-up cycles
+     SetIdleTimer(true, Seconds + 30);
+     }
 }

 bool cDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
 <at>  <at>  -1675,6 +1688,7  <at>  <at>  bool cDevice::AttachReceiver(cReceiver *Receiver)
             startScrambleDetection = time(NULL);
             }
          Start();
+         SetIdleTimer(false);
          return true;
          }
       }
 <at>  <at>  -1708,8 +1722,10  <at>  <at>  void cDevice::Detach(cReceiver *Receiver)
            camSlot->Assign(NULL);
         }
      }
-  if (!receiversLeft)
+  if (!receiversLeft) {
      Cancel(-1);
+     SetIdleTimer(true);
+     }
 }

 void cDevice::DetachAll(int Pid)
 <at>  <at>  -1731,6 +1747,82  <at>  <at>  void cDevice::DetachAllReceivers(void)
       Detach(receiver[i]);
 }

+void cDevice::CheckIdle(void)
+{
+  if (!SupportsPowerDown() || !Setup.PowerdownEnabled)
+     return;
+  cMutexLock MutexLock(&mutexPowerSaving);
+  if (idleTimerExpires != 0 && time(NULL) > idleTimerExpires) {
+     // idle, powered up
+     dsyslog("power saving: device %d idle timer expired", CardIndex() + 1);
+     SetIdleTimer(false);
+     if (Setup.PowerdownWakeupH != 0)
+        wakeupTimerExpires = time(NULL) + Setup.PowerdownWakeupH * 3600;
+     else
+        dsyslog("power saving: waking up is disabled");
+     if (!IsPoweredDown()) {
+        dsyslog("power saving: powering device %d down", CardIndex() + 1);
+        if (sectionHandler) {
+           sectionHandler->SetStatus(false);
+           sectionHandler->SetChannel(NULL);
+           }
+        PowerDown(true);
+        }
+     }
+  if (wakeupTimerExpires != 0 && time(NULL) > wakeupTimerExpires) {
+     // idle, powered down
+     dsyslog("power saving: device %d wakeup timer expired", CardIndex() + 1);
+     SetIdleTimer(true);
+     if (IsPoweredDown()) {
+        dsyslog("power saving: waking up device %d", CardIndex() + 1);
+        PowerDown(false);
+        }
+     }
+}
+
+void cDevice::SetIdleTimer(bool On, int ExtraTimeoutS)
+{
+  if (!SupportsPowerDown())
+     return;
+  cMutexLock MutexLock(&mutexPowerSaving);
+  if (On) {
+     int Tout = Setup.PowerdownTimeoutM * 60;
+     time_t Now = time(NULL);
+     if (ExtraTimeoutS > 0) {
+        if (idleTimerExpires >= Now + ExtraTimeoutS)
+           return;
+        Tout = ExtraTimeoutS;
+        }
+     idleTimerExpires = Now + Tout;
+     if (Setup.PowerdownEnabled)
+        dsyslog("power saving: set device %d idle timer to %d sec",
CardIndex() + 1, Tout);
+     }
+  else {
+     idleTimerExpires = 0;
+     if (Setup.PowerdownEnabled)
+        dsyslog("power saving: disable device %d idle timer", CardIndex() + 1);
+     }
+  wakeupTimerExpires = 0;
+}
+
+bool cDevice::PoweredDown(void)
+{
+  if (SupportsPowerDown() && Setup.PowerdownEnabled) {
+     cMutexLock MutexLock(&mutexPowerSaving);
+     return IsPoweredDown();
+     }
+  else
+     return false;
+}
+
+void cDevice::PowerUp(int ExtraTimeoutS)
+{
+  cMutexLock MutexLock(&mutexPowerSaving);
+  SetIdleTimer(true, ExtraTimeoutS);
+  if (SupportsPowerDown() && IsPoweredDown())
+     PowerDown(false);
+}
+
 // --- cTSBuffer -------------------------------------------------------------

 cTSBuffer::cTSBuffer(int File, int Size, int CardIndex)
diff --git a/device.h b/device.h
index 31ee303..6c1fdfb 100644
--- a/device.h
+++ b/device.h
 <at>  <at>  -821,6 +821,35  <at>  <at>  public:
        ///< Detaches all receivers from this device for this pid.
   virtual void DetachAllReceivers(void);
        ///< Detaches all receivers from this device.
+
+// Power saving facilities
+
+private:
+  cMutex mutexPowerSaving;
+  time_t idleTimerExpires, wakeupTimerExpires;
+  void PowerUp(int ExtraTimeoutS);
+       ///< If the device is powered down, powers it up and keeps it
+       ///< powered up for at least ExtraTimeoutS seconds (see
+       ///< cDevice::SetIdleTimer()).
+public:
+  void CheckIdle(void);
+       ///< Should be called periodically in the main loop.
+  bool PoweredDown(void);
+       ///< Returns true if the device is powered down "logically", that is,
+       ///< idle tasks like EPG scanning are disabled.
+  void SetIdleTimer(bool On, int ExtraTimeoutS = 0);
+       ///< Starts/disables the idle timer. This timer must be started when
+       ///< a device gets idle and must be disabled when it is receiving.
+       ///< If ExtraTimeoutS is greater than zero and On is true, a new timer
+       ///< won't be set, but the device will be kept powered up for at least
+       ///< ExtraTimeoutS seconds.
+protected:
+  virtual bool IsPoweredDown(void) {return false;}
+       ///< Returns true if the device is powered down "physically".
+  virtual void PowerDown(bool On) {};
+       ///< Actually powers the device down/up.
+  virtual bool SupportsPowerDown() {return false;}
+       ///< Returns true if a derived device supports power saving.
   };

 /// Derived cDevice classes that can receive channels will have to provide
diff --git a/dvbdevice.c b/dvbdevice.c
index 63af52e..cdadbff 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
 <at>  <at>  -348,6 +348,8  <at>  <at>  public:
   const cPositioner *Positioner(void) const { return positioner; }
   int GetSignalStrength(void) const;
   int GetSignalQuality(void) const;
+  bool IsPoweredDown(void) {return fd_frontend < 0;}
+  void PowerDown(bool On);
   };

 cMutex cDvbTuner::bondMutex;
 <at>  <at>  -544,6 +546,8  <at>  <at>  void cDvbTuner::ClearEventQueue(void) const

 bool cDvbTuner::GetFrontendStatus(fe_status_t &Status) const
 {
+  if (fd_frontend < 0)
+     return false;
   ClearEventQueue();
   while (1) {
         if (ioctl(fd_frontend, FE_READ_STATUS, &Status) != -1)
 <at>  <at>  -559,6 +563,8  <at>  <at>  bool cDvbTuner::GetFrontendStatus(fe_status_t &Status) const

 int cDvbTuner::GetSignalStrength(void) const
 {
+  if (fd_frontend < 0)
+     return -1;
   ClearEventQueue();
   uint16_t Signal;
   while (1) {
 <at>  <at>  -1001,6 +1007,26  <at>  <at>  void cDvbTuner::Action(void)
         }
 }

+void cDvbTuner::PowerDown(bool On)
+{
+  cMutexLock MutexLock(&mutex);
+  if (On && fd_frontend >= 0) {
+     isyslog("dvb tuner: power-down - closing frontend %d/%d",
adapter, frontend);
+     tunerStatus = tsIdle;
+     close(fd_frontend);
+     fd_frontend = -1;
+     }
+  if (!On && fd_frontend < 0) {
+     cString Filename = cString::sprintf("%s/%s%d/%s%d",
+        DEV_DVB_BASE, DEV_DVB_ADAPTER, adapter, DEV_DVB_FRONTEND, frontend);
+     isyslog("dvb tuner: power-up - opening frontend %d/%d", adapter,
frontend);
+     fd_frontend = open(Filename, O_RDWR | O_NONBLOCK);
+     if (fd_frontend < 0)
+        esyslog("ERROR: can't open DVB device frontend %d/%d",
adapter, frontend);
+     tunerStatus = tsIdle;
+     }
+}
+
 // --- cDvbSourceParam -------------------------------------------------------

 class cDvbSourceParam : public cSourceParam {
 <at>  <at>  -1712,6 +1738,19  <at>  <at>  void cDvbDevice::DetachAllReceivers(void)
   needsDetachBondedReceivers = false;
 }

+bool cDvbDevice::IsPoweredDown(void)
+{
+  if (dvbTuner)
+     return dvbTuner->IsPoweredDown();
+  return false;
+}
+
+void cDvbDevice::PowerDown(bool On)
+{
+  if (dvbTuner)
+     dvbTuner->PowerDown(On);
+}
+
 // --- cDvbDeviceProbe -------------------------------------------------------

 cList<cDvbDeviceProbe> DvbDeviceProbes;
diff --git a/dvbdevice.h b/dvbdevice.h
index 5ae4952..15d1ff8 100644
--- a/dvbdevice.h
+++ b/dvbdevice.h
 <at>  <at>  -290,6 +290,13  <at>  <at>  protected:
   virtual void CloseDvr(void);
   virtual bool GetTSPacket(uchar *&Data);
   virtual void DetachAllReceivers(void);
+
+// Power saving facilities
+
+protected:
+  virtual bool IsPoweredDown(void);
+  virtual void PowerDown(bool On);
+  virtual bool SupportsPowerDown() {return true;}
   };

 // A plugin that implements a DVB device derived from cDvbDevice
needs to create
diff --git a/eitscan.c b/eitscan.c
index 41ac25e..765055c 100644
--- a/eitscan.c
+++ b/eitscan.c
 <at>  <at>  -144,7 +144,8  <at>  <at>  void cEITScanner::Process(void)
            bool AnyDeviceSwitched = false;
            for (int i = 0; i < cDevice::NumDevices(); i++) {
                cDevice *Device = cDevice::GetDevice(i);
-               if (Device && Device->ProvidesEIT()) {
+               if (Device && Device->ProvidesEIT()
+                     && (!Device->PoweredDown() || lastActivity ==
0)) { // powered up or forced scan
                   for (cScanData *ScanData = scanList->First();
ScanData; ScanData = scanList->Next(ScanData)) {
                       const cChannel *Channel = ScanData->GetChannel();
                       if (Channel) {
 <at>  <at>  -165,6 +166,10  <at>  <at>  void cEITScanner::Process(void)
                                            }
                                         }
                                      //dsyslog("EIT scan: device %d
source  %-8s tp %5d", Device->DeviceNumber() + 1,
*cSource::ToString(Channel->Source()), Channel->Transponder());
+                                     if (lastActivity == 0)
+                                        // forced scan - set idle
timer for each channel switch;
+                                        // this prevents powering
down while scanning a transponder
+                                        Device->SetIdleTimer(true,
ScanTimeout + 5);
                                      Device->SwitchChannel(Channel, false);
                                      scanList->Del(ScanData);
                                      AnyDeviceSwitched = true;
diff --git a/menu.c b/menu.c
index 569900c..5a89771 100644
--- a/menu.c
+++ b/menu.c
 <at>  <at>  -3715,6 +3715,12  <at>  <at>  void cMenuSetupLNB::Setup(void)
      Add(new cMenuEditIntxItem(tr("Setup.LNB$Positioner speed
(degrees/s)"), &data.PositionerSpeed, 1, 1800, 10));
      }

+  Add(new cMenuEditBoolItem(tr("Setup.LNB$Enable power saving"),
&data.PowerdownEnabled));
+  if (data.PowerdownEnabled) {
+     Add(new cMenuEditIntItem(tr("Setup.LNB$Power down an idle device
after (min)"), &data.PowerdownTimeoutM));
+     Add(new cMenuEditIntItem(tr("Setup.LNB$Wake up from power-down
after (h)"), &data.PowerdownWakeupH));
+     }
+
   SetCurrent(Get(current));
   Display();
 }
 <at>  <at>  -3723,6 +3729,7  <at>  <at>  eOSState cMenuSetupLNB::ProcessKey(eKeys Key)
 {
   int oldDiSEqC = data.DiSEqC;
   int oldUsePositioner = data.UsePositioner;
+  int oldPowerdownEnabled = data.PowerdownEnabled;
   bool DeviceBondingsChanged = false;
   if (Key == kOk) {
      cString NewDeviceBondings = satCableNumbers.ToString();
 <at>  <at>  -3731,7 +3738,7  <at>  <at>  eOSState cMenuSetupLNB::ProcessKey(eKeys Key)
      }
   eOSState state = cMenuSetupBase::ProcessKey(Key);

-  if (Key != kNone && (data.DiSEqC != oldDiSEqC || data.UsePositioner
!= oldUsePositioner))
+  if (Key != kNone && (data.DiSEqC != oldDiSEqC || data.UsePositioner
!= oldUsePositioner || data.PowerdownEnabled != oldPowerdownEnabled))
      Setup();
   else if (DeviceBondingsChanged)
      cDvbDevice::BondDevices(data.DeviceBondings);
diff --git a/vdr.c b/vdr.c
index 6b0bf2b..c8de702 100644
--- a/vdr.c
+++ b/vdr.c
 <at>  <at>  -1515,6 +1515,12  <at>  <at>  int main(int argc, char *argv[])

         ReportEpgBugFixStats();

+        for (int i = 0; i < cDevice::NumDevices(); i++) {
+           cDevice *d = cDevice::GetDevice(i);
+           if (d)
+              d->CheckIdle();
+           }
+
         // Main thread hooks of plugins:
         PluginManager.MainThreadHook();
         }
--

-- 
1.9.1

_______________________________________________
vdr mailing list
vdr <at> linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Gmane