Sun, Oct 17, 2021 at 10:52:11PM +0300, Marko Mäkelä wrote:
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.
I just conducted this experiment with VDR 2.6.1, rpihddevice, and a
patch to support a /dev/lirc* remote (with no polling or wakeups in that
thread).
While a recording is paused, I see some VDR threads waking up
periodically. I ran the command
sudo perf record -p $(pgrep vdr")
and hit ctrl-c (SIGINT) after a couple of minutes. I see the following
threads in the "perf report" output:
"dvbplayer", "ovgthread", "vdr" (something related to rpihddevice)
"device 1 sectio" (cSectionHandler, possibly updating the EPG)
"frontend 0/0 tu" (cDvbTuner)
Updating the EPG is a valid reason to keep the tuner busy. I repeated
this experiment once more, this time first manually triggering an update
of the EPG, waiting it to finish, and then starting and pausing the
playback of a recording, and finally running "perf record" for a couple
of minutes while the recording was paused and there was no interaction
with VDR.
The result was the same: the system was apparently still parsing EPG
data. I set some breakpoints to identify some possible culprits. This
one is executed about once per second:
#0 cSectionHandler::SetStatus (On=true) at thread.h:94
#1 0x00093c80 in cDevice::SetChannel (LiveView=false) at device.c:915
#2 0x00093fe0 in cDevice::SwitchChannel (LiveView=false) at device.c:815
#3 0x000ae8ac in cEITScanner::Process (this=<EITScanner>) at eitscan.c:168
#4 0x000738cc in main () at vdr.c:1519
I see that there is a variable InhibitEpgScan, but the scan can only be
disabled based on the availability of a tuner. Thus, VDR never seems to
disable all tuners or completely suspend the parsing of EPG data.
The main loop in that thread wakes up once per second due to the
following:
#4 0x00101b38 in cRemote::Get (WaitMs=1000, UnknownCode=0x0) at remote.c:194
#5 0x000b87d8 in cInterface::GetKey (Wait=true) at interface.c:36
#6 cInterface::GetKey (Wait=true) at interface.c:31
#7 0x00072e4c in main () at vdr.c:1206
I think that a periodic wakeup in the main loop is reasonable. It would
still be good to disable the tuners when they are not really needed.
I conducted this test without applying the patch
https://github.com/glenvt18/vdr/commit/b368f67d00d0b466ae36028efb9336e81f77dba8
As far as I can tell, even with that patch the EPG parser could keep
running, because the patch does not set the variable InhibitEpgScan.
That would explain why the patch did not help reduce VDR power
consumption with the Astrometa USB stick.
I have not tried to measure the power consumption of the Pi TV HAT yet.
Best regards,
Marko
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr