Race condition when executing recording hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I finally managed to pull myself together and install markad-0.1.4 on Ubuntu
14.04.5 LTS and vdr-2.2.0. Not trivial for me because the markad sources
needed patching in order to compile and link properly. Different story - if
someone wants a clue just drop me a note. 

When playing around with markad last night, I noticed that there is a catch
with the combination of an active recording, changing pids and a recording
hook being configured. Look at the syslog snippet below. The recording is
started, then all of a sudden the channel pids change, after which VDR stops
the recording for a very short moment and restarts it accordingly. No problem
for the recording itself because only a few frames will be missing. 

But when stopping, the recording hook is invoked with "after", upon which
markad starts and tries to analyze the recording fragment. Now markad will
handle this situation gracefully because it will be invoked with "after" again
anyway when the recording is finished after a while, overwriting or renaming
an existing marks file. But we cannot always be sure what a user does in the
recording hook. 

I don't know how to handle this properly. My suggestion would be to ignore the
channel pid change during an active recording on this channel, and defer the
change until the recording is finished _if_ "-r something" is set on the
command line. 

Ideas or insights anyone? 


Dec 13 21:55:00 vdr vdr: [3759] record /video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec
Dec 13 21:55:00 vdr vdr: [3759] creating directory /video/Tatort:_Wofür_es_sich_zu_leben_lohnt
Dec 13 21:55:00 vdr vdr: [3759] creating directory /video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec
Dec 13 21:55:00 vdr vdr: [3759] recording to '/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec/00001.ts'
Dec 13 21:55:00 vdr vdr: [4035] recording thread started (pid=3759, tid=4035, prio=high)

...

Dec 13 21:55:02 vdr vdr: [3768] changing pids of channel 13 (SWR RP HD) from 5121+5121=27:5122=deu@3,5123=mis@3;5126=deu@106:5135=deu:5134 to 5131+5131=27:5132=deu@3,5133=mis@3;5136=deu@106:5135=deu:5134
Dec 13 21:55:02 vdr vdr: [4035] executing '/usr/local/bin/markad.sh started "/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec"'
Dec 13 21:55:02 vdr vdr: [3768] channel 13 (SWR RP HD) event Wed 13.12.2017 21:45-22:00 (VPS: 13.12. 21:45) 'SWR Aktuell Rheinland-Pfalz' status 4

...

Dec 13 21:55:06 vdr markad: [4032] detected logo stop (3892)
Dec 13 21:55:06 vdr vdr: [3759] stopping recording due to modification of channel 13 (SWR RP HD)
Dec 13 21:55:06 vdr vdr: [4035] recording thread ended (pid=3759, tid=4035)
Dec 13 21:55:06 vdr vdr: [3759] timer 10 (13 2155-0000 'Tatort: Wofür es sich zu leben lohnt') stop
Dec 13 21:55:06 vdr vdr: [3759] executing '/usr/local/bin/markad.sh after "/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec"'
Dec 13 21:55:06 vdr markad: [4055] starting v0.1.6 (ea2e182) (64bit)
Dec 13 21:55:06 vdr markad: [4055] on /video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec
Dec 13 21:55:06 vdr markad: [4055] broadcast aspectratio 16:9 (from info)
Dec 13 21:55:06 vdr markad: [4055] getting broadcast start from info mtime
Dec 13 21:55:06 vdr markad: [4055] no logo found, logo detection disabled
Dec 13 21:55:06 vdr markad: [4055] marks can/will be weak!
Dec 13 21:55:06 vdr markad: [4055] pre-timer 4m
Dec 13 21:55:06 vdr markad: [4055] broadcast length 90m
Dec 13 21:55:06 vdr vdr: [3759] switching device 2 to channel 13 (SWR RP HD)
Dec 13 21:55:06 vdr vdr: [3759] timer 10 (13 2155-0000 'Tatort: Wofür es sich zu leben lohnt') start
Dec 13 21:55:06 vdr vdr: [3759] Title: 'Tatort: Wofür es sich zu leben lohnt' Subtitle: 'Fernsehfilm Deutschland 2016'
Dec 13 21:55:06 vdr vdr: [3759] executing '/usr/local/bin/markad.sh before "/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec"'
Dec 13 21:55:06 vdr vdr: [3759] record /video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec
Dec 13 21:55:06 vdr vdr: [3759] recording to '/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec/00002.ts'
Dec 13 21:55:06 vdr markad: [4032] detected logo start (4384)*
Dec 13 21:55:06 vdr vdr: [4058] recording thread started (pid=3759, tid=4058, prio=high)

... 


-- 
Don't feed the bats tonight.

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr




[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux