Re: [vdr] Making VDR run under Systemd
Mon, Oct 18, 2021 at 11:44:32PM +0300, glenvt18 wrote: What is the output of lsof | grep frontend when VDR is in the "idle" state? I produced some output from /proc/$(pgrep vdr)/fd which I think might be more helpful. The last-but-one "ls" output was "too soon" after I started and paused the recording, so VDR was still in normal mode. In case you wonder, the connection between lircd and vdr did not work last time I tried, and probably also not this time. That is why I used telnet to the SVDRP port. The last "ls" command was when VDR was expected to be idle (after 1-minute timeout, instead of the 15-minute timeout of your patch). I ran the command once more after a while, and the output remained identical. Note that this USB DVB-T stick has two frontends for the same aerial connector. I think that one is for DVB-T and another for DVB-T2. You can see that "frontend1" was replaced with "frontend0" in the not-quite-idle mode. I am happy to try a revised patch, and I can also use GDB ("thread apply all backtrace" and such) if that is needed. This was the latest commit 0d50ec57f50375c8fda92d117e348dd8fd5a77a9 ("Version 2.5.6") from http://git.tvdr.de/vdr.git with only your patch on top (and the 15-minute timeout changed to 1 minute). Best regards, Marko pi@raspberrypi:~ $ sudo service lircd start pi@raspberrypi:~ $ pgrep lircd 3811 pi@raspberrypi:~ $ sudo ls -l /proc/3811/fd yhteensä 0 lr-x-- 1 root root 64 loka 20 21:37 0 -> /dev/null lrwx-- 1 root root 64 loka 20 21:37 1 -> socket:[47310] lrwx-- 1 root root 64 loka 20 21:37 2 -> socket:[47310] lrwx-- 1 root root 64 loka 20 21:37 3 -> socket:[49360] lrwx-- 1 root root 64 loka 20 21:37 4 -> socket:[47311] lrwx-- 1 root root 64 loka 20 21:37 5 -> /run/lirc/lircd.pid lr-x-- 1 root root 64 loka 20 21:37 6 -> /sys/devices/platform/soc/3f98.usb/usb1/1-1/1-1.5/rc/rc0/protocols lr-x-- 1 root root 64 loka 20 21:37 7 -> /sys/devices/platform/soc/3f98.usb/usb1/1-1/1-1.5/rc/rc0/protocols pi@raspberrypi:~ $ sudo service vdr start pi@raspberrypi:~ $ sudo lsof /dev/dvb/adapter0/* COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME vdr 3878 vdr7u CHR 212,3 0t0 42703 /dev/dvb/adapter0/frontend0 pi@raspberrypi:~ $ sudo ls -l /proc/3878/fd yhteensä 0 lr-x-- 1 root root 64 loka 20 21:37 0 -> /dev/null lrwx-- 1 root root 64 loka 20 21:37 1 -> socket:[48975] lrwx-- 1 root root 64 loka 20 21:37 10 -> socket:[49006] lrwx-- 1 root root 64 loka 20 21:37 11 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 12 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 13 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 14 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 15 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 16 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 17 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 18 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 2 -> socket:[48975] lrwx-- 1 root root 64 loka 20 21:37 3 -> socket:[48980] lrwx-- 1 root root 64 loka 20 21:37 4 -> /dev/dvb/adapter0/frontend1 lrwx-- 1 root root 64 loka 20 21:37 5 -> /dev/vchiq lrwx-- 1 root root 64 loka 20 21:37 6 -> socket:[49005] lrwx-- 1 root root 64 loka 20 21:37 7 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 8 -> /dev/dvb/adapter0/demux0 lr-x-- 1 root root 64 loka 20 21:37 9 -> /dev/dvb/adapter0/dvr0 pi@raspberrypi:~ $ telnet localhost 6419 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 raspberrypi SVDRP VideoDiskRecorder 2.5.6; Wed Oct 20 21:40:00 2021; UTF-8 hitk menu 250 Key "menu" accepted hitk 4 250 Key "4" accepted hitk red 250 Key "red" accepted hitk pause 250 Key "pause" accepted quit 221 raspberrypi closing connection Connection closed by foreign host. pi@raspberrypi:~ $ date ke 20.10.2021 21.40.45 +0300 pi@raspberrypi:~ $ sudo ls -l /proc/3878/fd yhteensä 0 lr-x-- 1 root root 64 loka 20 21:37 0 -> /dev/null lrwx-- 1 root root 64 loka 20 21:37 1 -> socket:[48975] lrwx-- 1 root root 64 loka 20 21:37 10 -> socket:[49006] lrwx-- 1 root root 64 loka 20 21:37 13 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 14 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 15 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 16 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 17 -> /dev/dvb/adapter0/demux0 lrwx-- 1 root root 64 loka 20 21:37 2 -> socket:[48975] lrwx-- 1 root root 64 loka 20 21:37 3 -> socket:[48980] lrwx-- 1 root root 64 loka 20 21:37 4 -> /dev/dvb/adapter0/frontend1 lrwx-- 1 root root 64 loka 20 21:37 5 -> /dev/vchiq lrwx-- 1 root root 64 loka 20 21:37 6 -> socket:[49005] lr-x-- 1 root
Re: [vdr] Making VDR run under Systemd
I'm not sure VDR is "idle" while a recording is paused. What is the log output? I myself don't use a standalone VDR (using softhddevice etc.). I use it only as a streaming server. When you start VDR as a server, it enters idle mode after a configured timeout. It might be different for a standalone VDR. If I remember, there is a softhddevice's command/option called "suspend" or "detach", or whatever, which stops live TV. That causes idle state too. BTW. Do you use both DVB-T and DVB-T2? And I've never tried the patch with VDR > 2.4.6. On Wed, Oct 20, 2021 at 10:04:26PM +0300, Marko Mäkelä wrote: > Mon, Oct 18, 2021 at 11:44:32PM +0300, glenvt18 wrote: > > What is the output of > > > >lsof | grep frontend > > > > when VDR is in the "idle" state? > > I produced some output from /proc/$(pgrep vdr)/fd which I think might be > more helpful. The last-but-one "ls" output was "too soon" after I started > and paused the recording, so VDR was still in normal mode. > > In case you wonder, the connection between lircd and vdr did not work last > time I tried, and probably also not this time. That is why I used telnet to > the SVDRP port. > > The last "ls" command was when VDR was expected to be idle (after 1-minute > timeout, instead of the 15-minute timeout of your patch). I ran the command > once more after a while, and the output remained identical. > > Note that this USB DVB-T stick has two frontends for the same aerial > connector. I think that one is for DVB-T and another for DVB-T2. You can see > that "frontend1" was replaced with "frontend0" in the not-quite-idle mode. > > I am happy to try a revised patch, and I can also use GDB ("thread apply all > backtrace" and such) if that is needed. > > This was the latest commit 0d50ec57f50375c8fda92d117e348dd8fd5a77a9 > ("Version 2.5.6") from http://git.tvdr.de/vdr.git with only your patch on > top (and the 15-minute timeout changed to 1 minute). > > Best regards, > > Marko > > pi@raspberrypi:~ $ sudo service lircd start > pi@raspberrypi:~ $ pgrep lircd > 3811 > pi@raspberrypi:~ $ sudo ls -l /proc/3811/fd > yhteensä 0 > lr-x-- 1 root root 64 loka 20 21:37 0 -> /dev/null > lrwx-- 1 root root 64 loka 20 21:37 1 -> socket:[47310] > lrwx-- 1 root root 64 loka 20 21:37 2 -> socket:[47310] > lrwx-- 1 root root 64 loka 20 21:37 3 -> socket:[49360] > lrwx-- 1 root root 64 loka 20 21:37 4 -> socket:[47311] > lrwx-- 1 root root 64 loka 20 21:37 5 -> /run/lirc/lircd.pid > lr-x-- 1 root root 64 loka 20 21:37 6 -> > /sys/devices/platform/soc/3f98.usb/usb1/1-1/1-1.5/rc/rc0/protocols > lr-x-- 1 root root 64 loka 20 21:37 7 -> > /sys/devices/platform/soc/3f98.usb/usb1/1-1/1-1.5/rc/rc0/protocols > pi@raspberrypi:~ $ sudo service vdr start > pi@raspberrypi:~ $ sudo lsof /dev/dvb/adapter0/* > COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME > vdr 3878 vdr7u CHR 212,3 0t0 42703 > /dev/dvb/adapter0/frontend0 > pi@raspberrypi:~ $ sudo ls -l /proc/3878/fd > yhteensä 0 > lr-x-- 1 root root 64 loka 20 21:37 0 -> /dev/null > lrwx-- 1 root root 64 loka 20 21:37 1 -> socket:[48975] > lrwx-- 1 root root 64 loka 20 21:37 10 -> socket:[49006] > lrwx-- 1 root root 64 loka 20 21:37 11 -> /dev/dvb/adapter0/demux0 > lrwx-- 1 root root 64 loka 20 21:37 12 -> /dev/dvb/adapter0/demux0 > lrwx-- 1 root root 64 loka 20 21:37 13 -> /dev/dvb/adapter0/demux0 > lrwx-- 1 root root 64 loka 20 21:37 14 -> /dev/dvb/adapter0/demux0 > lrwx-- 1 root root 64 loka 20 21:37 15 -> /dev/dvb/adapter0/demux0 > lrwx-- 1 root root 64 loka 20 21:37 16 -> /dev/dvb/adapter0/demux0 > lrwx-- 1 root root 64 loka 20 21:37 17 -> /dev/dvb/adapter0/demux0 > lrwx-- 1 root root 64 loka 20 21:37 18 -> /dev/dvb/adapter0/demux0 > lrwx-- 1 root root 64 loka 20 21:37 2 -> socket:[48975] > lrwx-- 1 root root 64 loka 20 21:37 3 -> socket:[48980] > lrwx-- 1 root root 64 loka 20 21:37 4 -> /dev/dvb/adapter0/frontend1 > lrwx-- 1 root root 64 loka 20 21:37 5 -> /dev/vchiq > lrwx-- 1 root root 64 loka 20 21:37 6 -> socket:[49005] > lrwx-- 1 root root 64 loka 20 21:37 7 -> /dev/dvb/adapter0/demux0 > lrwx-- 1 root root 64 loka 20 21:37 8 -> /dev/dvb/adapter0/demux0 > lr-x-- 1 root root 64 loka 20 21:37 9 -> /dev/dvb/adapter0/dvr0 > pi@raspberrypi:~ $ telnet localhost 6419 > Trying ::1... > Trying 127.0.0.1... > Connected to localhost. > Escape character is '^]'. > 220 raspberrypi SVDRP VideoDiskRecorder 2.5.6; Wed Oct 20 21:40:00 2021; UTF-8 > hitk menu > 250 Key "menu" accepted > hitk 4 > 250 Key "4" accepted > hitk red > 250 Key "red" accepted > hitk pause > 250 Key "pause" accepted > quit > 221 raspberrypi closing connection > Connection closed by foreign host. > pi@raspberrypi:~ $ date > ke 20.10.2021 21.40.45 +0300 > pi@raspberrypi:~ $ sudo ls -l /proc/3878/fd > yhteensä 0 > lr-x-- 1 root root 64 loka 20 21:37 0 -> /dev/null > lrwx-- 1 root root 64
Re: [vdr] Making VDR run under Systemd
Thu, Oct 21, 2021 at 02:06:37AM +0300, glenvt18 wrote: I'm not sure VDR is "idle" while a recording is paused. What is the log output? I can only see a clue "trying device number 2 instead": Oct 20 21:37:56 raspberrypi vdr: [3878] DVB API version is 0x050B (VDR was built with 0x050A) Oct 20 21:37:56 raspberrypi vdr: [3878] frontend 0/0 provides DVB-T with QPSK,QAM16,QAM64 ("Realtek RTL2832 (DVB-T)") Oct 20 21:37:57 raspberrypi kernel: [257117.778208] mn88473 3-0018: downloading firmware from file 'dvb-demod-mn88473-01.fw' Oct 20 21:37:57 raspberrypi vdr: [3878] frontend 0/1 provides DVB-T,DVB-T2,DVB-C with QPSK,QAM16,QAM32,QAM64,QAM128,QAM256 ("Panasonic MN88473") Oct 20 21:37:58 raspberrypi vdr: [3878] found 1 DVB device Oct 20 21:37:58 raspberrypi vdr: [3878] initializing plugin: rpihddevice (1.0.4): HD output device for Raspberry Pi Oct 20 21:37:58 raspberrypi vdr: [3878] rpihddevice: HwInit() done, display size is 1920x1080 Oct 20 21:37:58 raspberrypi vdr: [3878] setting primary device to 1 Oct 20 21:37:58 raspberrypi vdr: [3878] device 1 has no MPEG decoder Oct 20 21:37:58 raspberrypi vdr: [3878] trying device number 2 instead Oct 20 21:37:58 raspberrypi vdr: [3878] setting primary device to 2 Oct 20 21:37:58 raspberrypi vdr: [3878] setting current skin to "lcars" Oct 20 21:37:58 raspberrypi vdr: [3878] loading /var/lib/vdr/themes/lcars-default.theme Oct 20 21:37:58 raspberrypi vdr: [3878] starting plugin: rpihddevice Oct 20 21:37:58 raspberrypi lircd-0.9.4c[3811]: Notice: accepted new client on /var/run/lirc/lircd Oct 20 21:37:58 raspberrypi vdr: [3878] switching to channel 1 T-8438-8193-1501 (Yle TV1 HD (T)) Oct 20 21:37:58 raspberrypi lircd-0.9.4c[3811]: Info: [lirc] protocol is enabled Oct 20 21:37:58 raspberrypi vdr: [3911] SVDRP raspberrypi opening port 6419/tcp Oct 20 21:37:58 raspberrypi vdr: [3911] SVDRP raspberrypi listening on port 6419/tcp Oct 20 21:37:58 raspberrypi vdr: [3907] rpihddevice: loading /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf ... Oct 20 21:37:58 raspberrypi vdr: [3907] rpihddevice: loading /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf ... Oct 20 21:38:01 raspberrypi vdr: [3878] retuning due to modification of channel 1 (Yle TV1 HD (T)) Oct 20 21:38:01 raspberrypi vdr: [3878] switching to channel 1 T-8438-8193-1501 (Yle TV1 HD (T)) Oct 20 21:40:00 raspberrypi vdr: [3911] SVDRP raspberrypi < 127.0.0.1:52142 client connection accepted Oct 20 21:40:08 raspberrypi vdr: [3878] replay /var/lib/video/XXX/2019-01-05.19.07.19-0.rec Oct 20 21:40:08 raspberrypi vdr: [3878] loading /var/lib/video/XXX/2019-01-05.19.07.19-0.rec/marks Oct 20 21:40:08 raspberrypi vdr: [3947] resuming replay at index 807 (0:00:32.07) Oct 20 21:40:13 raspberrypi vdr: [3911] SVDRP raspberrypi < 127.0.0.1:52142 connection closed Oct 20 21:41:55 raspberrypi vdr: [3878] stopping plugin: rpihddevice Oct 20 21:41:55 raspberrypi lircd-0.9.4c[3811]: Info: removed client Oct 20 21:41:55 raspberrypi vdr: [3878] saved setup to /var/lib/vdr/setup.conf If I remember, there is a softhddevice's command/option called "suspend" or "detach", or whatever, which stops live TV. That causes idle state too. I remember (co-)developing such a feature for softdevice (without the "hd" part). Apart from saving power, another motivation was to reduce the probability of crashes, because reception errors of the DVB-T stream used to cause that back then. Maybe I could check if something similar could be done in rpihddevice. Still, in my opinion, when a recording is being watched and nothing is being simultaneously recorded or streamed, there should normally be no reason to keep any tuners powered. BTW. Do you use both DVB-T and DVB-T2? Yes, some transponders are DVB-T and some are DVB-T2, and I think that all free-to-view DVB-T2 channels are also available via DVB-T. I do not know when that transition period will end here. Wikipedia says that it was supposed to complete by April 2020 already. The first DVB-T2 transponders were introduced in 2011. And I've never tried the patch with VDR > 2.4.6. The patch applied without glitches, only some line number differences. In VDR 2.5, the EPG works for me. In 2.4, I think I never got it to cover the DVB-T2 transponders. Best regards, Marko ___ vdr mailing list vdr@linuxtv.org https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr