Power timer start time permanently changed by timer backoff

Issue #448 resolved
prl created an issue

If a power timer fires to go to shutdown, reboot or restart GUI while a recording is being made, the power timer backs off, initially by 5 minutes, and doubling up to a maximum of 30 min if the backoff continues.

When the backoff is applied, the power timer's start time is incremented by the backoff amount, and if that makes the start time after the end time, then the end time is set to the start time.

Replication steps

Set a recording timer and then set a repeating power timer to send the PVR into deep standby 4 minutes before the end of the recording timer (to separate the backed off shutdown time from the recording end time). Wait for the shutdown, then reboot. Go to the power timer screen with SLEEP, and check the start time for the power timer; it will now be 5 minutes later than before the backoff, and its next invocation will be 5 minutes later than the user's intention.

I have used a repeat timer to highlight the fact that the backoff affects future timer activation times.

Comments (6)

  1. Peter Urbanec

    Fix bug #448: Power timer start time permanently changed by timer backoff

    [PowerTimer]

    Save "original" begin/end times at timer creation/time change and restore it when timer finishes. Also write "original" times when writing the timer file in PowerTimer.saveTimer().

    [PowerTimerEntry]

    Save timer begin/end in "original" times in TimerEntry.keyGo().

    → <<cset 580cc3931bf3>>

  2. Peter Urbanec

    Fix bug #448: [PowerTimer] tidy code

    Put common code for "recording running or starting soon" in a function.

    Replace some uses of integers for timer state comparisone with symbolic values.

    Replace some repeated tests against the same variable with "in tuple" or "not in tuple".

    Simplified test wake up timer return value from PowerTimerEntry.getNextWakeup().

    Replace "intVal and True or False" with "bool(intVal)" in PowerTimerEntry.activate() when testing whether the wakeup was from a power timer "wake to standby".

    → <<cset 39aedeb9d0e8>>

  3. prl reporter

    The commits that fixed this bug have disappeared from the code and the code logs! I would re-open the issue, but I can't work out how to.

  4. prl reporter

    This bug has in fact been fixed and remains fixed. I was looking at a checkout of an old commit when I thought I saw that the problem had come back.

  5. Log in to comment