Re: Making VDR run under Systemd

Marko Mäkelä <[email protected]> Sun, 17 Oct 2021 22:52:11 +0300
Newsgroups gmane.linux.vdr
Message-ID <YWx+61uwK3ZVzqk7@jyty>
Tue, Oct 12, 2021 at 07:21:10PM +0300, glenvt18 wrote:
>Here you can find an updated version of the patch:
>https://github.com/glenvt18/vdr/commits/vdr-2.4.6

Thank you. I just conducted some tests with my uncalibrated Agilent 
power supply. The USB cable of such low quality that the Raspberry Pi 
complained several times about undervoltage.

I measured the following current draw at 5 volts, in ascending order:

81 mA: Raspberry Pi 2B shut down
200 mA: Raspberry Pi 2B powered up, no Ethernet plugged in
240 mA: Ethernet cable plugged in (HDMI cable makes no difference)
320 mA: Ethernet + USB DVB stick plugged in
440 mA: compiling VDR with "make -j4" (all CPU cores busy)
550 mA: VDR playing back a recording
530 mA: recording paused in VDR
510 mA: EPG scan running
600 mA: VDR displaying live DVB-T2

https://github.com/glenvt18/vdr/commit/b368f67d00d0b466ae36028efb9336e81f77dba8
applied cleanly on the latest VDR source. I changed the PowerdownTimeoutM
from 15 to 1 minute to speed up my testing.

The patch only had a minimal impact. After 1 or 2 minutes of the 
playback of a recording being paused, the power consumption dropped from 
530 mA to 500 mA.

I noticed that VDR is consuming about 5% of the CPU power according to 
"top". Could it not be made more event-based? It might be interesting to 
check with "powertop" how many wakeups per second there are, and with 
"perf record" and "perf replay" (or simply "perf top") where the CPU 
cycles are being spent when the playback of a recording is paused.

The bulk of the the power consumption ought to be caused by the USB DVB 
stick not being in fully idle state. After all, utilizing all 4 CPU 
cores during the "make -j4" minutes showed a pretty stable power 
consumption of 440 mA for several minutes, which is much less than when 
the VDR process was running.

Here is a summary of the power consumption measured at 5 volts.

1.2 W (240 mA)  mostly idle Raspberry Pi 2B (Ethernet plugged in)
1.6 W (320 mA)  USB DVB stick plugged in, VDR not running
2.5 W (500 mA)  lowest power consumption achieved with VDR
3.0 W (600 mA)  VDR displaying live TV

My conclusion is that I will configure udev so that VDR will 
automatically start up or shut down when the USB stick is plugged in or 
removed. In that way, the power consumption of the system will only be 
more than doubled when VDR is actually in use.

I am planning to install the most recent Raspberry Pi and to document 
the minimal changes on top of that.

Best regards,

	Marko

_______________________________________________
vdr mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr