Mailing List Archive

Events at the beginning of a recording
Hi.

I was wondering whether there is any more documentation about the
recording pending and recording started events than is available on the
wiki (which isn't very much).

I have read that the one envisaged uses of the recording pending event
is for it to trigger e.g. a set-top box being woken up, but for that to
be possible it would have to be triggered before the recording actually
begins, and the beginning of the recording should also wait until the
recording pending script returns.

On my backend I'm seeing the opposite: the recording started event
occurs before the recording pending event, and it obviously doesn't wait
for one event to be handled before the next-one begins.

So how is this actually meant to work?

Many thanks, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On Tue, 2023-01-24 at 18:59 +0100, Jan Ceuleers wrote:
> Hi.
>
> I was wondering whether there is any more documentation about the
> recording pending and recording started events than is available on
> the
> wiki (which isn't very much).
>
> I have read that the one envisaged uses of the recording pending
> event
> is for it to trigger e.g. a set-top box being woken up, but for that
> to
> be possible it would have to be triggered before the recording
> actually
> begins, and the beginning of the recording should also wait until the
> recording pending script returns.
>
> On my backend I'm seeing the opposite: the recording started event
> occurs before the recording pending event, and it obviously doesn't
> wait
> for one event to be handled before the next-one begins.
>
> So how is this actually meant to work?
>
> Many thanks, Jan
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
I use both, pending gets called initially 1 minute BEFORE the show
starts and started gets call at start time.
Attached are my 2 scripts, since I have 2 different set-top boxes and
inputs it has to handle both.
mythtv_recording_pending.sh and mythtv_recording_started.sh

Don't know if attachments actually make to the mailing list and thru...

Jim
Re: Events at the beginning of a recording [ In reply to ]
On Tue, 24 Jan 2023 at 18:02, Jan Ceuleers <jan.ceuleers@gmail.com> wrote:

> I was wondering whether there is any more documentation about the
> recording pending and recording started events than is available on the
> wiki (which isn't very much).
>

I'm not sure there is, so you'll have to rely on the wisdom of folks on
this list, I think.

I have read that the one envisaged uses of the recording pending event
> is for it to trigger e.g. a set-top box being woken up, but for that to
> be possible it would have to be triggered before the recording actually
> begins, and the beginning of the recording should also wait until the
> recording pending script returns.
>

As far as I know, the recording pending events are fired asynchronously.
There is no waiting for them to finish, rather, they are expected to have
successfully done their job before MythTV starts recording (including the
pre-roll). On my system I consistently see recording pending events
triggered at 94, 60 and 29 seconds before the pre-roll is due to start.

If you're only powering on a set-top box and changing its channel, then I
would have thought 29s would be enough time to successfully complete that.
You can pass %SECS% to the script in mythtv-setup for the recording_pending
system event script configuration.

If you're passing %SECS% as the first parameter to your script, then in the
script you can do something like:

ME="$(/usr/bin/basename ${0})"
TIME_SECS=${1}
if [ ${TIME_SECS} -gt 35 ]
then
echo "${ME}: time to programme start ${TIME_SECS}; exiting" \
>> /some/path/recording_pending.log
exit
fi
# put channel change stuff here

If you needed more time, then you could change '-gt 35' to '-gt 65',
above. If you do that though the pending script is still called again and
if you don't want it to execute again then in that case, you'd need to
create a semaphore file during the ~60s event, that is then checked for by
the ~30s event and then deleted within that event before exiting having
done nothing more.

On my backend I'm seeing the opposite: the recording started event
> occurs before the recording pending event, and it obviously doesn't wait
> for one event to be handled before the next-one begins.
>

I haven't tried using recording_started, but it seems like it should come
after pending to me, so that's a bit odd.

Cheers, Ian
Re: Events at the beginning of a recording [ In reply to ]
On Tue, 24 Jan 2023 at 19:46, Ian Cameron <mkbloke@gmail.com> wrote:

> ME="$(/usr/bin/basename ${0})"
> TIME_SECS=${1}
> if [ ${TIME_SECS} -gt 35 ]
> then
> echo "${ME}: time to programme start ${TIME_SECS}; exiting" \
> >> /some/path/recording_pending.log
> exit
> fi
> # put channel change stuff here
>

Oops, it should be "if [ $TIME_SECS -lt 35 ]", above for what I described.
Also, for using the ~60s event, rather than a semaphore file, you could use:

if [ $TIME_SECS -gt 35 -a $TIME_SECS -lt 65 ]

Cheers, Ian
Re: Events at the beginning of a recording [ In reply to ]
On 24/01/2023 20:46, Ian Cameron wrote:
> As far as I know, the recording pending events are fired
> asynchronously.  There is no waiting for them to finish, rather, they
> are expected to have successfully done their job before MythTV starts
> recording (including the pre-roll).  On my system I consistently see
> recording pending events triggered at 94, 60 and 29 seconds before the
> pre-roll is due to start.

I don't see that. What I see is as follows:

Only one recording-pending event is triggered, not three as you observe
on your system.

The order I see is as follows:

1. The recording-started event is triggered first, almost simultaneously
with the mythexternalrecorder's tuner command (at "second 0").

2. The recording-pending event is triggered next, at "second 5". So 5
seconds after the recording has already started.

Do you know whether these timings are parameters that I may have
misconfigured in the database? My database is quite old and has been
upgraded many times over the 15+ years that it has been in use.

Also, assuming I can get these events into the correct order, my
situation is that I need to power up the set-top box, and it takes quite
some time to boot to a condition in which it is able to accept infrared
commands (i.e. able to change channels).

Cheers, Jan

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
Hoi Jan,

Wednesday, January 25, 2023, 5:31:36 PM, you wrote:

> On 24/01/2023 20:46, Ian Cameron wrote:
>> As far as I know, the recording pending events are fired
>> asynchronously.  There is no waiting for them to finish, rather, they
>> are expected to have successfully done their job before MythTV starts
>> recording (including the pre-roll).  On my system I consistently see
>> recording pending events triggered at 94, 60 and 29 seconds before the
>> pre-roll is due to start.

> I don't see that. What I see is as follows:

> Only one recording-pending event is triggered, not three as you observe
> on your system.

> The order I see is as follows:

> 1. The recording-started event is triggered first, almost simultaneously
> with the mythexternalrecorder's tuner command (at "second 0").

> 2. The recording-pending event is triggered next, at "second 5". So 5
> seconds after the recording has already started.

> Do you know whether these timings are parameters that I may have
> misconfigured in the database? My database is quite old and has been
> upgraded many times over the 15+ years that it has been in use.

> Also, assuming I can get these events into the correct order, my
> situation is that I need to power up the set-top box, and it takes quite
> some time to boot to a condition in which it is able to accept infrared
> commands (i.e. able to change channels).

> Cheers, Jan

Am I correct that you are working on conserving electricity by only
powering up devices when needed?
I am currently working on a network management tool to achieve just
that and am now implementing a eg-pms2-lan with switchable power
sockets to among others manage my hdhomrun.
I use the mythtv api to extract a recording schedule for those tuners
to determine when to switch on or off.
Use "Dvr/GetUpcomingList" and "Dvr/GetEncoderList" to get the upcoming
and pending recordings.

I can give you the Mythtv API python module based on Stephen
Worthington's gaps program.

I'm afraid it will take some more time before I can publish the entire
package.


Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On 25/01/2023 18:29, Hika van den Hoven wrote:
> Am I correct that you are working on conserving electricity by only
> powering up devices when needed?

Yes, that's what I'm trying to achieve. I have three HDMI video capture
pipelines (STB, HDMI encoder and another device which shall remain
unnamed), and I am powering all three with a single 12VDC power supply
(and a 12V to 5V buck converter for the devices that require 5VDC),
which is plugged into an old 4-socket Gembird USB-controlled power strip
I had from an era long past.

Ideally I would like the sockets to be controlled by scripts ultimately
invoked from the MythTV backend, so that (among other things) they are
also powered down when the backend service is stopped, e.g. as part of
the whole server being shut down.

> I am currently working on a network management tool to achieve just
> that and am now implementing a eg-pms2-lan with switchable power
> sockets to among others manage my hdhomrun.
> I use the mythtv api to extract a recording schedule for those tuners
> to determine when to switch on or off.

I can see that working for scheduled recordings, but live TV (which I
occasionally use for testing) wouldn't work as it's of course unscheduled.

But I am indeed interested, since live TV is very much a corner case.
I'd also still want to work on powering stuff down while MythTV is down,
but that can probably be done independently of your scheme.

Thanks, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On Wed, 25 Jan 2023 at 16:34, Jan Ceuleers <jan.ceuleers@gmail.com> wrote:

> The order I see is as follows:
>
> 1. The recording-started event is triggered first, almost simultaneously
> with the mythexternalrecorder's tuner command (at "second 0").
>
> 2. The recording-pending event is triggered next, at "second 5". So 5
> seconds after the recording has already started.
>

How are you observing this?

I'd be tempted to set up a script for the recording_pending event that
simply runs:

date >> /tmp/pending.log

to see when and how many times it's called.

I don't know if it's your use of mythexternalrecorder that makes any
difference - I'm using IPTV. I'm also running 0.28 at the moment.

Do you know whether these timings are parameters that I may have
> misconfigured in the database? My database is quite old and has been
> upgraded many times over the 15+ years that it has been in use.
>

Not that I'm aware of.

Cheers, Ian
Re: Events at the beginning of a recording [ In reply to ]
On 25/01/2023 20:11, Ian Cameron wrote:
> On Wed, 25 Jan 2023 at 16:34, Jan Ceuleers <jan.ceuleers@gmail.com
> <mailto:jan.ceuleers@gmail.com>> wrote:
>
> The order I see is as follows:
>
> 1. The recording-started event is triggered first, almost simultaneously
> with the mythexternalrecorder's tuner command (at "second 0").
>
> 2. The recording-pending event is triggered next, at "second 5". So 5
> seconds after the recording has already started.
>
>
> How are you observing this?
>
> I'd be tempted to set up a script for the recording_pending event that
> simply runs:
>
> date >> /tmp/pending.log
>
> to see when and how many times it's called.

That's more or less what I'm doing, except that I'm having these scripts
send emails to myself that include the time stamp with second
resolution. I'm also having them create syslog entries.

For example, here is the recording-pending script (with the actual email
address redacted):

#!/bin/bash
(
echo "$0: called with parameters $*"
/bin/date
) | /usr/bin/mail -a From: jan.ceuleers@example.com -s "MythTV system
event $0" jan.ceuleers@example.com
logger "$0 called with parameters $*"

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
Hoi Jan,

Wednesday, January 25, 2023, 7:29:35 PM, you wrote:

> On 25/01/2023 18:29, Hika van den Hoven wrote:
>> Am I correct that you are working on conserving electricity by only
>> powering up devices when needed?

> Yes, that's what I'm trying to achieve. I have three HDMI video capture
> pipelines (STB, HDMI encoder and another device which shall remain
> unnamed), and I am powering all three with a single 12VDC power supply
> (and a 12V to 5V buck converter for the devices that require 5VDC),
> which is plugged into an old 4-socket Gembird USB-controlled power strip
> I had from an era long past.

> Ideally I would like the sockets to be controlled by scripts ultimately
> invoked from the MythTV backend, so that (among other things) they are
> also powered down when the backend service is stopped, e.g. as part of
> the whole server being shut down.

>> I am currently working on a network management tool to achieve just
>> that and am now implementing a eg-pms2-lan with switchable power
>> sockets to among others manage my hdhomrun.
>> I use the mythtv api to extract a recording schedule for those tuners
>> to determine when to switch on or off.

> I can see that working for scheduled recordings, but live TV (which I
> occasionally use for testing) wouldn't work as it's of course unscheduled.

> But I am indeed interested, since live TV is very much a corner case.
> I'd also still want to work on powering stuff down while MythTV is down,
> but that can probably be done independently of your scheme.

> Thanks, Jan
> _______________________________________________

If you wait a few months, I'll publish my management application. It
at present basically consists of a daemon running on my backend and on
a rPi that coordinates it all. All machines are interlinked in
dependencies. So if my workstation or frontend is waken, the backend
is waken too. If a frontend is still awake, sleep will be halted. You
can register the pid of a script and while it's running sleep is
halted. Etc...
Except for a small core around the rPi, this way everything can be
shut down and will wake at need.
Is tricky to get it all to work dependably.

Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On Wed, 25 Jan 2023 at 19:21, Jan Ceuleers <jan.ceuleers@gmail.com> wrote:

> That's more or less what I'm doing, except that I'm having these scripts
> send emails to myself that include the time stamp with second
> resolution. I'm also having them create syslog entries.
>

I can only think that this is specific to mythexternalrecorder then.

Cheers, Ian
Re: Events at the beginning of a recording [ In reply to ]
On Wed, 25 Jan 2023 17:31:36 +0100, you wrote:

>On 24/01/2023 20:46, Ian Cameron wrote:
>> As far as I know, the recording pending events are fired
>> asynchronously.? There is no waiting for them to finish, rather, they
>> are expected to have successfully done their job before MythTV starts
>> recording (including the pre-roll).? On my system I consistently see
>> recording pending events triggered at 94, 60 and 29 seconds before the
>> pre-roll is due to start.
>
>I don't see that. What I see is as follows:
>
>Only one recording-pending event is triggered, not three as you observe
>on your system.
>
>The order I see is as follows:
>
>1. The recording-started event is triggered first, almost simultaneously
>with the mythexternalrecorder's tuner command (at "second 0").
>
>2. The recording-pending event is triggered next, at "second 5". So 5
>seconds after the recording has already started.
>
>Do you know whether these timings are parameters that I may have
>misconfigured in the database? My database is quite old and has been
>upgraded many times over the 15+ years that it has been in use.
>
>Also, assuming I can get these events into the correct order, my
>situation is that I need to power up the set-top box, and it takes quite
>some time to boot to a condition in which it is able to accept infrared
>commands (i.e. able to change channels).

What is supposed to happen is that the recording-pending event happens
first, typically about 60 seconds before the start of the recording.
From that event, you are supposed to start anything that needs
starting, and tune your set top box (or whatever is providing the
signal) to the correct channel.

Then at the exact time the recording starts, the recording-started
event happens. When this happens depends on the settings for
pre-roll, including the global one (typically 60 seconds) and the one
on the recording rule, which in my case is set according to the
channel and may be 1, 2 or 3 minutes.

On my mother's MythTV box where I used to do FM radio recordings using
these events, that was how it worked, but that was many years ago. On
the box I still have a script "event_test.sh" that is run by a number
of events (including the "ANY" event) and logs when it happens:

#!/bin/bash

me=$(/usr/bin/basename "${0}")
log=/var/log/mythtv/event_test.log
echo `date` "$me $@" >>$log
exit 0

I also have "event-start-recording.sh" and
"event-finished-recording.sh" scripts on the appropriate events.

The logging shows that the first recording-pending event is happening
well before the recording-started event, but there are multiple
recording-pending events happening. Here is an example of the
logging:

Wed 25 Jan 2023 19:26:00 NZDT event_test.sh Any REC_PENDING %SENDER%
90 10073 2023-01-25T05:30:00Z 2023-01-25T06:30:00Z
2023-01-25T05:30:00Z 2023-01-25T06:30:00Z 120 0 Default
Wed 25 Jan 2023 19:26:00 NZDT event_test.sh RecordingPending %SENDER%
90 10073 2023-01-25T05:30:00Z 2023-01-25T06:30:00Z
2023-01-25T05:30:00Z 2023-01-25T06:30:00Z 120 0 Default
Wed 25 Jan 2023 19:26:00 NZDT event_test.sh Any SCHEDULER_RAN crw-pvr
%HOSTNAME% %CARDID% 0 %DIR% %FILE% %PROGSTARTISOUTC% %PROGENDISOUTC%
%STARTTIMEISOUTC% %ENDTIMEISOUTC% %SECS% %REACTIVATE% %RECGROUP%
Wed 25 Jan 2023 19:26:00 NZDT event_test.sh SchedulerRan crw-pvr
%HOSTNAME% %CARDID% 0 %DIR% %FILE% %PROGSTARTISOUTC% %PROGENDISOUTC%
%STARTTIMEISOUTC% %ENDTIMEISOUTC% %SECS% %REACTIVATE% %RECGROUP%
Wed 25 Jan 2023 19:26:31 NZDT event_test.sh Any REC_PENDING %SENDER%
90 10073 2023-01-25T05:30:00Z 2023-01-25T06:30:00Z
2023-01-25T05:30:00Z 2023-01-25T06:30:00Z 88 0 Default
Wed 25 Jan 2023 19:26:31 NZDT event_test.sh RecordingPending %SENDER%
90 10073 2023-01-25T05:30:00Z 2023-01-25T06:30:00Z
2023-01-25T05:30:00Z 2023-01-25T06:30:00Z 88 0 Default
Wed 25 Jan 2023 19:27:00 NZDT event_test.sh Any REC_STARTED %SENDER%
crw-pvr 90 10073 GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/crw-pvr
10073_20230125062700.ts 2023-01-25T06:30:00Z 2023-01-25T07:30:00Z
2023-01-25T06:27:00Z 2023-01-25T07:34:00Z %SECS% 0 Default
Wed 25 Jan 2023 19:27:00 NZDT event-start-recording.sh %SENDER%
crw-pvr 90 10073 GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/crw-pvr
10073_20230125062700.ts
Wed 25 Jan 2023 19:27:00 NZDT event-start-recording.sh Exiting now
Wed 25 Jan 2023 19:27:00 NZDT event_test.sh Any REC_PENDING %SENDER%
crw-pvr 90 10073 GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/crw-pvr
10073_20230125062700.ts 2023-01-25T06:30:00Z 2023-01-25T07:30:00Z
2023-01-25T06:27:00Z 2023-01-25T07:34:00Z 0 0 Default
Wed 25 Jan 2023 19:27:00 NZDT event_test.sh RecordingPending %SENDER%
crw-pvr 90 10073 GetPlaybackURL/UNABLE/TO/FIND/LOCAL/FILE/ON/crw-pvr
10073_20230125062700.ts 2023-01-25T06:30:00Z 2023-01-25T07:30:00Z
2023-01-25T06:27:00Z 2023-01-25T07:34:00Z 0 0 Default
Wed 25 Jan 2023 19:27:04 NZDT event_test.sh Any REC_STARTED_WRITING
%SENDER% crw-pvr 90 10073 /mnt/rec3/recordings 10073_20230125062700.ts
2023-01-25T06:30:00Z 2023-01-25T07:30:00Z 2023-01-25T06:27:00Z
2023-01-25T07:34:00Z %SECS% 0 Default
Wed 25 Jan 2023 20:38:00 NZDT event_test.sh Any REC_FINISHED %SENDER%
crw-pvr 90 10073 /mnt/rec3/recordings 10073_20230125062700.ts
2023-01-25T06:30:00Z 2023-01-25T07:30:00Z 2023-01-25T06:27:00Z
2023-01-25T07:38:00Z %SECS% 0 Default
Wed 25 Jan 2023 20:38:00 NZDT event-finished-recording.sh %SENDER%
crw-pvr 90 10073 /mnt/rec3/recordings 10073_20230125062700.ts
Wed 25 Jan 2023 20:38:00 NZDT event_test.sh Any SCHEDULER_RAN crw-pvr
%HOSTNAME% %CARDID% 0 %DIR% %FILE% %PROGSTARTISOUTC% %PROGENDISOUTC%
%STARTTIMEISOUTC% %ENDTIMEISOUTC% %SECS% %REACTIVATE% %RECGROUP%
Wed 25 Jan 2023 20:38:00 NZDT event_test.sh SchedulerRan crw-pvr
%HOSTNAME% %CARDID% 0 %DIR% %FILE% %PROGSTARTISOUTC% %PROGENDISOUTC%
%STARTTIMEISOUTC% %ENDTIMEISOUTC% %SECS% %REACTIVATE% %RECGROUP%

Sorry about all the long lines being wrapped - my email client does
that and it does not have an option to not do it. I would suggest
copying those lines to an editor and unwrapping them to be able to
read them properly - Each line starts with "Wed 25 Jan".

As well as just the recording-pending and recording-started events,
there are now also events added in more recent versions of MythTV than
when I was using these scripts, which includes a "recording-writing"
event that happens when the recording file is actually being written
to.

If you want to see all the event activity, try adding a script like
mine to the EventCmdAll event:

MariaDB [mythconverg]> select * from settings where value like
'EventCmdAll';
+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
| value | data | hostname |
+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+
| EventCmdAll | /usr/local/bin/event_test.sh Any %EVENTNAME% %SENDER% %HOSTNAME% %CARDID% %CHANID% %DIR% %FILE% %PROGSTARTISOUTC% %PROGENDISOUTC% %STARTTIMEISOUTC% %ENDTIMEISOUTC% %SECS% %REACTIVATE% %RECGROUP% | crw-pvr |
+-------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+

The %EVENTNAME% parameter will allow the script to log the name of the
event.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
Shoot me for top posting again.

I use both of these "pending" and "started" events with my
FREEBOX tuner, which is really just
STB -> IPTV_Encoder -> NETWORK-CONNECTION-> Mythtv (FREEBOX)

I control the STB tuning this way, and my actual channel chager scripts
check if the STB is on FIRST, if it is not they turn it on.


I log everything.

I get a "recording-pending" event 60 seconds BEFORE the recording is
due to start (which my scripts, attached in my first reply on this)
ignore. I get a second "recording-pending" event ~30 seconds BEFORE the
recording is due to start (which my scripts play a countdown on and
actually call the channel-changer script (to power on the box and set
the channel).
Then right at the tim the recording starts I get a single "recording-
started" event...

This has been this way for a few years, from v29 -> v30 -> v31 (which
is what I am currently running).

Jim

On Wed, 2023-01-25 at 17:31 +0100, Jan Ceuleers wrote:
> On 24/01/2023 20:46, Ian Cameron wrote:
> > As far as I know, the recording pending events are fired
> > asynchronously. There is no waiting for them to finish, rather,
> > they
> > are expected to have successfully done their job before MythTV
> > starts
> > recording (including the pre-roll). On my system I consistently
> > see
> > recording pending events triggered at 94, 60 and 29 seconds before
> > the
> > pre-roll is due to start.
>
> I don't see that. What I see is as follows:
>
> Only one recording-pending event is triggered, not three as you
> observe
> on your system.
>
> The order I see is as follows:
>
> 1. The recording-started event is triggered first, almost
> simultaneously
> with the mythexternalrecorder's tuner command (at "second 0").
>
> 2. The recording-pending event is triggered next, at "second 5". So 5
> seconds after the recording has already started.
>
> Do you know whether these timings are parameters that I may have
> misconfigured in the database? My database is quite old and has been
> upgraded many times over the 15+ years that it has been in use.
>
> Also, assuming I can get these events into the correct order, my
> situation is that I need to power up the set-top box, and it takes
> quite
> some time to boot to a condition in which it is able to accept
> infrared
> commands (i.e. able to change channels).
>
> Cheers, Jan
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On 25/01/2023 21:22, Ian Cameron wrote:
> I can only think that this is specific to mythexternalrecorder then.

I also have an HDHR, and the out-of-order events also affect those
recordings, so no, it is not specific to mythexternalrecorder.

I'll do some code-reading.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On 26/01/2023 09:12, Jan Ceuleers wrote:
> On 25/01/2023 21:22, Ian Cameron wrote:
>> I can only think that this is specific to mythexternalrecorder then.
>
> I also have an HDHR, and the out-of-order events also affect those
> recordings, so no, it is not specific to mythexternalrecorder.
>
> I'll do some code-reading.

Done some code-reading, but there's just too much code and logging for
me to be able to understand what's going on (and wrong).

But it is clear that the recording pending event is being sent after
recording has started. I know this because the SECS parameter is
negative (-24 in a recent run).

Open to advice on how to make progress.

Thanks, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
The REC_PENDING event is now coming before the REC_STARTED event, as
committed to master and fixes/33.
See Forum discussion https://forum.mythtv.org/viewtopic.php?f=9&t=5263
I think this was the same problem as what is discussed in this thread.

Klaas.
Re: Events at the beginning of a recording [ In reply to ]
On 03/02/2023 21:24, Klaas de Waal wrote:
> The REC_PENDING event is now coming before the REC_STARTED event, as
> committed to master and fixes/33.
> See Forum discussion https://forum.mythtv.org/viewtopic.php?f=9&t=5263
> <https://forum.mythtv.org/viewtopic.php?f=9&t=5263>
> I think this was the same problem as what is discussed in this thread.

I'm on fixes/32 so will have to upgrade, but thank you very much for
tracking this down.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On 04/02/2023 07:27, Jan Ceuleers wrote:
> On 03/02/2023 21:24, Klaas de Waal wrote:
>> The REC_PENDING event is now coming before the REC_STARTED event, as
>> committed to master and fixes/33.
>> See Forum discussion https://forum.mythtv.org/viewtopic.php?f=9&t=5263
>> <https://forum.mythtv.org/viewtopic.php?f=9&t=5263>
>> I think this was the same problem as what is discussed in this thread.
>
> I'm on fixes/32 so will have to upgrade, but thank you very much for
> tracking this down.
>

I upgraded to fixes/33, but I still see the incorrect ordering.

<190>Feb 4 07:50:50 mythtv[2909935]:
/home/mythtv/system-events/recording-started called with parameters 32
20230204075100 by PID 2909935
/home/mythtv/tuner_command[2909943] hdmicap1.xperim.be 121
<190>Feb 4 07:50:50 mythtv[2909938]: /home/mythtv/tuner_command called
with parameters hdmicap1.xperim.be 121 by PID 2909938
/home/mythtv/tuner_command[2909946] hdmicap1.xperim.be 121
<190>Feb 4 07:50:50 mythtv[2909938]: /home/mythtv/tuner_command called
with parameters hdmicap1.xperim.be 121 by PID 2909938
/home/mythtv/tuner_command[2909946] hdmicap1.xperim.be 121
<190>Feb 4 07:50:50 mythtv[2909951]:
/home/mythtv/system-events/recording-pending called with parameters 32
20230204075100 -241 by PID 2909951
/home/mythtv/have_video_lock: hdmicap1.xperim.be returns 0
/home/mythtv/start_streaming hdmicap1.xperim.be
/home/mythtv/start_streaming: URL
http://192.168.1.69/dev/info.cgi?action=streaminfo&rtp=on&multicast=on&mcastaddr=192.168.1.60

/home/mythtv/blast_arduino.sh: 1 121
/home/mythtv/tuner_command[2909946]: exit 0

This log is produced by my own scripts, including the recording-pending
and recording-started scripts, as well as various scripts invoked
through mythexternrecorder configuration.

As you can see the recording pending event is fired during the same
second as the recording started event, but later, and with a negative
SECS parameter (-241 in the above example). This log is for a recording
that was due to start (according to the schedule data) at 7:55am, with
zero preroll in the recording rule itself, with RecordPreRoll set to
250, and with WakeUpThreshold set to 5.

Perhaps the fix hasn't made it into the mythbuntu ppa yet; will test
again tomorrow.

Cheers, Jan


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On 04/02/2023 08:04, Jan Ceuleers wrote:
> I upgraded to fixes/33, but I still see the incorrect ordering.
>
> <190>Feb 4 07:50:50 mythtv[2909935]:
> /home/mythtv/system-events/recording-started called with parameters 32
> 20230204075100 by PID 2909935
> /home/mythtv/tuner_command[2909943] hdmicap1.xperim.be 121
> <190>Feb 4 07:50:50 mythtv[2909938]: /home/mythtv/tuner_command called
> with parameters hdmicap1.xperim.be 121 by PID 2909938
> /home/mythtv/tuner_command[2909946] hdmicap1.xperim.be 121
> <190>Feb 4 07:50:50 mythtv[2909938]: /home/mythtv/tuner_command called
> with parameters hdmicap1.xperim.be 121 by PID 2909938
> /home/mythtv/tuner_command[2909946] hdmicap1.xperim.be 121
> <190>Feb 4 07:50:50 mythtv[2909951]:
> /home/mythtv/system-events/recording-pending called with parameters 32
> 20230204075100 -241 by PID 2909951
> /home/mythtv/have_video_lock: hdmicap1.xperim.be returns 0
> /home/mythtv/start_streaming hdmicap1.xperim.be
> /home/mythtv/start_streaming: URL
> http://192.168.1.69/dev/info.cgi?action=streaminfo&rtp=on&multicast=on&mcastaddr=192.168.1.60
>
> /home/mythtv/blast_arduino.sh: 1 121
> /home/mythtv/tuner_command[2909946]: exit 0
>
> This log is produced by my own scripts, including the recording-pending
> and recording-started scripts, as well as various scripts invoked
> through mythexternrecorder configuration.
>
> As you can see the recording pending event is fired during the same
> second as the recording started event, but later, and with a negative
> SECS parameter (-241 in the above example). This log is for a recording
> that was due to start (according to the schedule data) at 7:55am, with
> zero preroll in the recording rule itself, with RecordPreRoll set to
> 250, and with WakeUpThreshold set to 5.
>
> Perhaps the fix hasn't made it into the mythbuntu ppa yet; will test
> again tomorrow.

Klaas,

This problem is not resolved for me. Based on the name of the package
that I now have installed (which includes a git hash) I believe that I
am running with your patch, but I still see out-of-order events very
much like the log I posted yesterday.

Should I open an issue?

root@dracor:~# dpkg -l | grep myth
ii libmyth
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64 Common
library code for MythTV and add-on modules (runtime)
ii libmyth-python
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all Python
library to access some MythTV features
ii libmythes-1.2-0:amd64
2:1.2.4-3build1 amd64 simple
thesaurus library
ii libmythtv-perl
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all Perl
library to access some MythTV features
rc mythbuntu-bare-client 2.7.2
all Mythbuntu Bare
Client
rc mythbuntu-common 0.78.2
all Mythbuntu
application support functions
rc mythbuntu-control-centre 0.64.1
all Mythbuntu
Configuration Application
ii mythes-en-us
1:6.4.3-1 all English
(USA) Thesaurus for LibreOffice
ii mythtv
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all
Personal video recorder application (client and server)
ii mythtv-backend
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64
Personal video recorder application (server)
ii mythtv-backend-master
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all
Metapackage to setup and configure a "Master Backend" profile of MythTV
ii mythtv-common
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64
Personal video recorder application (common data)
ii mythtv-database
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all
Personal video recorder application (database)
ii mythtv-frontend
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64
Personal video recorder application (client)
ii mythtv-transcode-utils
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64
Utilities used for transcoding MythTV tasks
ii mythweb
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all Web
interface add-on module for MythTV
ii php-mythtv
2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all PHP
Bindings for MythTV

Note that 761e7b05f7 is the current head in fixes/33.


Thanks, Jan

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On 05/02/2023 09:25, Jan Ceuleers wrote:

> On 04/02/2023 08:04, Jan Ceuleers wrote:
>> I upgraded to fixes/33, but I still see the incorrect ordering.
>>
>> <190>Feb 4 07:50:50 mythtv[2909935]:
>> /home/mythtv/system-events/recording-started called with parameters 32
>> 20230204075100 by PID 2909935
>> /home/mythtv/tuner_command[2909943] hdmicap1.xperim.be 121
>> <190>Feb 4 07:50:50 mythtv[2909938]: /home/mythtv/tuner_command called
>> with parameters hdmicap1.xperim.be 121 by PID 2909938
>> /home/mythtv/tuner_command[2909946] hdmicap1.xperim.be 121
>> <190>Feb 4 07:50:50 mythtv[2909938]: /home/mythtv/tuner_command called
>> with parameters hdmicap1.xperim.be 121 by PID 2909938
>> /home/mythtv/tuner_command[2909946] hdmicap1.xperim.be 121
>> <190>Feb 4 07:50:50 mythtv[2909951]:
>> /home/mythtv/system-events/recording-pending called with parameters 32
>> 20230204075100 -241 by PID 2909951
>> /home/mythtv/have_video_lock: hdmicap1.xperim.be returns 0
>> /home/mythtv/start_streaming hdmicap1.xperim.be
>> /home/mythtv/start_streaming: URL
>> http://192.168.1.69/dev/info.cgi?action=streaminfo&rtp=on&multicast=on&mcastaddr=192.168.1.60
>>
>> /home/mythtv/blast_arduino.sh: 1 121
>> /home/mythtv/tuner_command[2909946]: exit 0
>>
>> This log is produced by my own scripts, including the recording-pending
>> and recording-started scripts, as well as various scripts invoked
>> through mythexternrecorder configuration.
>>
>> As you can see the recording pending event is fired during the same
>> second as the recording started event, but later, and with a negative
>> SECS parameter (-241 in the above example). This log is for a recording
>> that was due to start (according to the schedule data) at 7:55am, with
>> zero preroll in the recording rule itself, with RecordPreRoll set to
>> 250, and with WakeUpThreshold set to 5.
>>
>> Perhaps the fix hasn't made it into the mythbuntu ppa yet; will test
>> again tomorrow.
> Klaas,
>
> This problem is not resolved for me. Based on the name of the package
> that I now have installed (which includes a git hash) I believe that I
> am running with your patch, but I still see out-of-order events very
> much like the log I posted yesterday.
>
> Should I open an issue?
>
> root@dracor:~# dpkg -l | grep myth
> ii libmyth
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64 Common
> library code for MythTV and add-on modules (runtime)
> ii libmyth-python
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all Python
> library to access some MythTV features
> ii libmythes-1.2-0:amd64
> 2:1.2.4-3build1 amd64 simple
> thesaurus library
> ii libmythtv-perl
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all Perl
> library to access some MythTV features
> rc mythbuntu-bare-client 2.7.2
> all Mythbuntu Bare
> Client
> rc mythbuntu-common 0.78.2
> all Mythbuntu
> application support functions
> rc mythbuntu-control-centre 0.64.1
> all Mythbuntu
> Configuration Application
> ii mythes-en-us
> 1:6.4.3-1 all English
> (USA) Thesaurus for LibreOffice
> ii mythtv
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all
> Personal video recorder application (client and server)
> ii mythtv-backend
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64
> Personal video recorder application (server)
> ii mythtv-backend-master
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all
> Metapackage to setup and configure a "Master Backend" profile of MythTV
> ii mythtv-common
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64
> Personal video recorder application (common data)
> ii mythtv-database
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all
> Personal video recorder application (database)
> ii mythtv-frontend
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64
> Personal video recorder application (client)
> ii mythtv-transcode-utils
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 amd64
> Utilities used for transcoding MythTV tasks
> ii mythweb
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all Web
> interface add-on module for MythTV
> ii php-mythtv
> 2:33.0+fixes.202302042148.761e7b05f7~ubuntu20.04.1 all PHP
> Bindings for MythTV
>
> Note that 761e7b05f7 is the current head in fixes/33.
>
>
> Thanks, Jan


Can you please show us what events you get and in what order without any
other logging so we can see what you mean?


It's possible the mythexternrecorder does things differently and messes
with the timings?


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
On 05/02/2023 12:27, Paul Harrison wrote:
> Can you please show us what events you get and in what order without any
> other logging so we can see what you mean?
>
>
> It's possible the mythexternrecorder does things differently and messes
> with the timings?

Here's an example from earlier today. As you requested I removed all
logging other than the events:

Feb 5 07:55:50 mythtv[1161172]:
/home/mythtv/system-events/recording-started called with parameters 32
20230205075600 by PID 1161172
Feb 5 07:55:55 mythtv[1161379]:
/home/mythtv/system-events/recording-pending called with parameters 32
20230205075600 -246 by PID 1161379

In this instance the recording pending event arrived 5 seconds after the
recording started event, but earlier examples (if you ignore all of the
non-event logging) showed that sometimes the recording pending event
arrives within a second of the recording started event.

In order to test your theory that mythexternrecorder might have
something to do with this I also ran a test recording with an HDHR (i.e.
not using mythexternrecorder). Here are the events:

Feb 5 13:07:50 mythtv[1740022]:
/home/mythtv/system-events/recording-started called with parameters 10
20230205130800 by PID 1740022
Feb 5 13:07:50 mythtv[1740026]:
/home/mythtv/system-events/recording-pending called with parameters 10
20230205130800 -241 by PID 1740026

So the order is the same in this case, although as described earlier the
events are less than a second apart.

Here's how the events have been set up:

mysql> select * from settings where value like "Event%"\G
*************************** 1. row ***************************
value: EventCmdLivetvStarted
data:
hostname: dracor
*************************** 2. row ***************************
value: EventCmdPlayChanged
data:
hostname: dracor
*************************** 3. row ***************************
value: EventCmdRecFinished
data: /home/mythtv/system-events/recording-finished %DIR% %FILE%
%CARDID% %CHANID% %STARTTIMEUTC"
hostname: dracor
*************************** 4. row ***************************
value: EventCmdRecPending
data: /home/mythtv/system-events/recording-pending %CARDID%
%STARTTIME% %SECS%
hostname: dracor
*************************** 5. row ***************************
value: EventCmdRecStarted
data: /home/mythtv/system-events/recording-started %CARDID% %STARTTIME%
hostname: dracor
5 rows in set (0.00 sec)

So as you can see, the "-246" or "-241" passed to recording-pending is
the SECS parameter.

Thanks, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
Hi Jan,

What are your values for the settings RecordPreRoll and WakeUpThreshold?

The RecordPreRoll is configured in mythfrontend with Setup / Video /
General / General (Advanced) / Time to record before start of show (secs).
In my system the RecordPreRoll is 180 seconds.

I am not aware of a GUI option to configure the value of WakeUpThreshold.
If it is not defined then a default value of 5 minutes is used.
If it is defined directly in the database then I think that the value
should be in seconds.
In my system the WakeUpThreshold is not defined so the default is used.

To show the events you can add the "-v network" option for mythbackend.
Then use "grep -e REC_PENDING -e REC_STARTED" to filter the log.

Thanks,
Klaas.


On Sun, 5 Feb 2023 at 13:22, Jan Ceuleers <jan.ceuleers@gmail.com> wrote:

> On 05/02/2023 12:27, Paul Harrison wrote:
> > Can you please show us what events you get and in what order without any
> > other logging so we can see what you mean?
> >
> >
> > It's possible the mythexternrecorder does things differently and messes
> > with the timings?
>
> Here's an example from earlier today. As you requested I removed all
> logging other than the events:
>
> Feb 5 07:55:50 mythtv[1161172]:
> /home/mythtv/system-events/recording-started called with parameters 32
> 20230205075600 by PID 1161172
> Feb 5 07:55:55 mythtv[1161379]:
> /home/mythtv/system-events/recording-pending called with parameters 32
> 20230205075600 -246 by PID 1161379
>
> In this instance the recording pending event arrived 5 seconds after the
> recording started event, but earlier examples (if you ignore all of the
> non-event logging) showed that sometimes the recording pending event
> arrives within a second of the recording started event.
>
> In order to test your theory that mythexternrecorder might have
> something to do with this I also ran a test recording with an HDHR (i.e.
> not using mythexternrecorder). Here are the events:
>
> Feb 5 13:07:50 mythtv[1740022]:
> /home/mythtv/system-events/recording-started called with parameters 10
> 20230205130800 by PID 1740022
> Feb 5 13:07:50 mythtv[1740026]:
> /home/mythtv/system-events/recording-pending called with parameters 10
> 20230205130800 -241 by PID 1740026
>
> So the order is the same in this case, although as described earlier the
> events are less than a second apart.
>
> Here's how the events have been set up:
>
> mysql> select * from settings where value like "Event%"\G
> *************************** 1. row ***************************
> value: EventCmdLivetvStarted
> data:
> hostname: dracor
> *************************** 2. row ***************************
> value: EventCmdPlayChanged
> data:
> hostname: dracor
> *************************** 3. row ***************************
> value: EventCmdRecFinished
> data: /home/mythtv/system-events/recording-finished %DIR% %FILE%
> %CARDID% %CHANID% %STARTTIMEUTC"
> hostname: dracor
> *************************** 4. row ***************************
> value: EventCmdRecPending
> data: /home/mythtv/system-events/recording-pending %CARDID%
> %STARTTIME% %SECS%
> hostname: dracor
> *************************** 5. row ***************************
> value: EventCmdRecStarted
> data: /home/mythtv/system-events/recording-started %CARDID% %STARTTIME%
> hostname: dracor
> 5 rows in set (0.00 sec)
>
> So as you can see, the "-246" or "-241" passed to recording-pending is
> the SECS parameter.
>
> Thanks, Jan
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
Re: Events at the beginning of a recording [ In reply to ]
On 05/02/2023 14:23, Klaas de Waal wrote:
> Hi Jan,
>
> What are your values for the settings RecordPreRoll andWakeUpThreshold?

From one of my earlier messages today:

"...zero preroll in the recording rule itself, with RecordPreRoll set to
250, and with WakeUpThreshold set to 5."

> To show the events you can add the "-v network" option for mythbackend.
> Then use "grep -e REC_PENDING -e REC_STARTED" to filter the log.

I can do that, but is it needed given the logging I already showed? The
logs I showed are produced by the recording-pending and
recording-started scripts doing the following (and nothing else):

logger --id=$PPID -p local7.info "$0 called with parameters $* by PID
$PPID" -s 2>> /home/mythtv/hdmicap.log

Both scripts are identical and contain only the following line (apart
from the shebang).


ALSO: it occurred to me that perhaps my tests were invalid, in that I
was scheduling "record once" recording rules using mythweb that are due
to start later than the preroll, and I was afraid that perhaps doing so
did not trigger a reschedule or something. So I just did another test,
scheduling the recording 20mins ahead of time and then running mythutil
--resched, but the same still happened:

Feb 5 16:00:50 mythtv[2071521]:
/home/mythtv/system-events/recording-started called with parameters 10
20230205160100 by PID 2071521
Feb 5 16:00:50 mythtv[2071532]:
/home/mythtv/system-events/recording-pending called with parameters 10
20230205160100 -241 by PID 2071532


Anyway, I will do another test run after running mythbackend
--setverbose network .

Cheers, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Events at the beginning of a recording [ In reply to ]
Hi Jan,

About

zero preroll in the recording rule itself, with RecordPreRoll set to
250, and with WakeUpThreshold set to 5.

Have you set the value for WakeUpThreshold in the database or are you
referring to the default value you find in the code that is used when there
is no setting in the database?

Thanks,
Klaas.


On Sun, 5 Feb 2023 at 16:10, Jan Ceuleers <jan.ceuleers@gmail.com> wrote:

> On 05/02/2023 14:23, Klaas de Waal wrote:
> > Hi Jan,
> >
> > What are your values for the settings RecordPreRoll andWakeUpThreshold?
>
> From one of my earlier messages today:
>
> "...zero preroll in the recording rule itself, with RecordPreRoll set to
> 250, and with WakeUpThreshold set to 5."
>
> > To show the events you can add the "-v network" option for mythbackend.
> > Then use "grep -e REC_PENDING -e REC_STARTED" to filter the log.
>
> I can do that, but is it needed given the logging I already showed? The
> logs I showed are produced by the recording-pending and
> recording-started scripts doing the following (and nothing else):
>
> logger --id=$PPID -p local7.info "$0 called with parameters $* by PID
> $PPID" -s 2>> /home/mythtv/hdmicap.log
>
> Both scripts are identical and contain only the following line (apart
> from the shebang).
>
>
> ALSO: it occurred to me that perhaps my tests were invalid, in that I
> was scheduling "record once" recording rules using mythweb that are due
> to start later than the preroll, and I was afraid that perhaps doing so
> did not trigger a reschedule or something. So I just did another test,
> scheduling the recording 20mins ahead of time and then running mythutil
> --resched, but the same still happened:
>
> Feb 5 16:00:50 mythtv[2071521]:
> /home/mythtv/system-events/recording-started called with parameters 10
> 20230205160100 by PID 2071521
> Feb 5 16:00:50 mythtv[2071532]:
> /home/mythtv/system-events/recording-pending called with parameters 10
> 20230205160100 -241 by PID 2071532
>
>
> Anyway, I will do another test run after running mythbackend
> --setverbose network .
>
> Cheers, Jan
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
Re: Events at the beginning of a recording [ In reply to ]
On 05/02/2023 16:10, Jan Ceuleers wrote:
> Anyway, I will do another test run after running mythbackend
> --setverbose network .

Would you believe it: this test ran correctly.


Feb 5 16:30:45 mythtv[2127696]:
/home/mythtv/system-events/recording-pending called with parameters 32
20230205163500 4 by PID 2127696
Feb 5 16:35:00 mythtv[2135457]:
/home/mythtv/system-events/recording-started called with parameters 32
20230205163500 by PID 2135457

Here is the corresponding mythbackend log:

root@dracor:~# tail -f /var/log/mythtv/mythbackend.log | grep -e
REC_PENDING -e REC_STARTED
Feb 5 16:30:45 dracor mythbackend: mythbackend[1125035]: I Scheduler
mythcorecontext.cpp:1725 (dispatch) MythCoreContext::dispatch():
MythEvent: SYSTEM_EVENT REC_PENDING SECS 4 CARDID 32 CHANID 2010
STARTTIME 2023-02-05T15:35:00Z RECSTATUS -1 VIDEODEVICE
/usr/bin/mythexternrecorder --conf /home/mythtv/mythexternrecorder1.conf
VBIDEVICE SENDER dracor
Feb 5 16:30:45 dracor mythbackend: mythbackend[1125035]: I
MythSocketThread(72) mythsocket.cpp:744 (WriteStringListReal)
MythSocket(557bd8fa0b30:72): write -> 72 237
BACKEND_MESSAGE[]:[]SYSTEM_EVENT REC_PENDING SECS 4 CARDID 32 CHANID
2010 STARTTIME 2023-02-05T15:35:00Z RE…
Feb 5 16:30:45 dracor mythbackend: mythbackend[1125035]: I SystemEvent
mythcorecontext.cpp:1725 (dispatch) MythCoreContext::dispatch():
MythEvent: SYSTEM_EVENT_RESULT REC_PENDING SENDER dracor RESULT 0
Feb 5 16:30:45 dracor mythbackend: mythbackend[1125035]: I
MythSocketThread(72) mythsocket.cpp:744 (WriteStringListReal)
MythSocket(557bd8fa0b30:72): write -> 72 84
BACKEND_MESSAGE[]:[]SYSTEM_EVENT_RESULT REC_PENDING SENDER dracor RESULT
0[]:[]empty
Feb 5 16:35:00 dracor mythbackend: mythbackend[1125035]: I Scheduler
mythcorecontext.cpp:1725 (dispatch) MythCoreContext::dispatch():
MythEvent: SYSTEM_EVENT REC_STARTED CARDID 32 CHANID 2010 STARTTIME
2023-02-05T15:35:00Z RECSTATUS -15 VIDEODEVICE
/usr/bin/mythexternrecorder --conf /home/mythtv/mythexternrecorder1.conf
VBIDEVICE SENDER dracor
Feb 5 16:35:00 dracor mythbackend: mythbackend[1125035]: I
MythSocketThread(72) mythsocket.cpp:744 (WriteStringListReal)
MythSocket(557bd8fa0b30:72): write -> 72 231
BACKEND_MESSAGE[]:[]SYSTEM_EVENT REC_STARTED CARDID 32 CHANID 2010
STARTTIME 2023-02-05T15:35:00Z RECSTATUS…
Feb 5 16:35:00 dracor mythbackend: mythbackend[1125035]: I SystemEvent
mythcorecontext.cpp:1725 (dispatch) MythCoreContext::dispatch():
MythEvent: SYSTEM_EVENT_RESULT REC_STARTED SENDER dracor RESULT 0
Feb 5 16:35:00 dracor mythbackend: mythbackend[1125035]: I
MythSocketThread(72) mythsocket.cpp:744 (WriteStringListReal)
MythSocket(557bd8fa0b30:72): write -> 72 84
BACKEND_MESSAGE[]:[]SYSTEM_EVENT_RESULT REC_STARTED SENDER dracor RESULT
0[]:[]empty
Feb 5 16:35:25 dracor mythbackend: mythbackend[1125035]: I ExternSH
mythcorecontext.cpp:1725 (dispatch) MythCoreContext::dispatch():
MythEvent: SYSTEM_EVENT REC_STARTED_WRITING CARDID 32 CHANID 2010
STARTTIME 2023-02-05T15:35:00Z RECSTATUS -2 VIDEODEVICE
/usr/bin/mythexternrecorder --conf /home/mythtv/mythexternrecorder1.conf
VBIDEVICE SENDER dracor
Feb 5 16:35:25 dracor mythbackend: mythbackend[1125035]: I
MythSocketThread(72) mythsocket.cpp:744 (WriteStringListReal)
MythSocket(557bd8fa0b30:72): write -> 72 238
BACKEND_MESSAGE[]:[]SYSTEM_EVENT REC_STARTED_WRITING CARDID 32 CHANID
2010 STARTTIME 2023-02-05T15:35:00Z R…

I'll see if the problem reproduces.

Cheers, Jan
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org

1 2 3  View All