Hi.
Here you can find an updated version of the patch:
https://github.com/glenvt18/vdr/commits/vdr-2.4.6
On Mon, Oct 11, 2021 at 04:02:43PM +0100, Richard F wrote:
> Mon, Sep 13, 2021 at 08:51:05PM +0200, Martin Wache wrote:
> > So, back to the plan with the Raspberry Pi 2B. One problem that I wanted
> > to solve is the power consumption of the DVB-T dongle when it is not in
> > use. I found https://github.com/mvp/uhubctl which can switch off power
> > on individual USB ports. I wrote a VDR shutdown script that does the
> > following:
> >
> > sudo service lircd stop
> > uhubctl -p ... -a off
> > sudo service vdr stop
> >
> > I did not refine the uhubctl invocation yet. The physical port could
> > vary.
> >
> > An easy way to start up VDR could be a udev rule that would start up the
> > lircd and vdr services when the USB DVB stick is plugged in. Obviously,
> > if we power off the port during VDR shutdown, the adapter would have to
> > be plugged into a different port.
> >
> > A simpler option for the occasional use of VDR might be to simply write
> > udev rules that will start up lircd and vdr when the DVB adapter is
> > plugged in, and shut down the services when the adapter is removed.
> > That would be too risky if recording timers are being used.
> >
> > I am not yet sure whether powering off the USB port makes any
> > difference, because the plastic case of the DVB stick feels slightly
> > warm to the touch even when the port is supposedly powered off. It might
> > be that some internal heat produced by the Rasberry is being dissipated
> > via the USB port. The metal frame of the USB jacks feels a bit warm too.
> >
> > I think that I must measure the input power of the Raspberry Pi as well
> > as the voltage on the USB port when it is supposedly powered off.
> >
> > Marko
>
> Powersaving for DVB receivers - try the attached patch from glenvt18
>
>
> This has worked for me for a few years without noticeable problems on both
> USB and PCI cards. I'm still on V2.20 by the way. There's a little bit of
> log chatter as it powers up/down receivers when VDR scans the EPG etc, but
> you can filter that I reckoned it saved around 3W at the mains for a
> 2-receiver server setup when I tested it back in 2016 - which adds up over
> time.
>
> usbhubctl is a bit of a sledgehammer !
>
> HTH
>
> Richard
>
> From 656cce97750882fd945d9ba76c47cb93a74c3059 Mon Sep 17 00:00:00 2001
> From: glenvt18
> Date: Tue, 24 May 2016 00:39:01 +0300
> Subject: [PATCH] Device power saving feature
>
> ---
> 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 9c6b71e..e196353 100644
> --- a/config.c
> +++ b/config.c
> @@ -395,6 +395,9 @@ cSetup::cSetup(void)
>PositionerSpeed = 15;
>PositionerSwing = 650;
>PositionerLastLon = 0;
> + PowerdownEnabled = 0;
> + PowerdownTimeoutM = 15;
> + PowerdownWakeupH = 4;
>SetSystemTime = 0;
>TimeSource = 0;
>TimeTransponder = 0;
> @@ -617,6 +620,9 @@ 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);
> @@ -743,6 +749,9 @@ 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 d1bae04..dbe84bb 100644
> --- a/config.h
> +++ b/config.h
> @@ -273,6 +273,9 @@ public:
>int PositionerSpeed;
>int PositionerSwing;
>int PositionerLastLon;
> + int PowerdownEnabl