"Save timeshift" incorrect on standby when "Timeshift save action on zap" is not "Ask user"

Issue #495 resolved
prl created an issue

If MENU>Setup>TV>Timeshift settings>Show warning when timeshift is stopped is enabled and MENU>Setup>TV>Timeshift settings>Timeshift save action on zap is not Ask user, when the user asks for "save timeshift" and goes to shutdown, shutdown is not properly entered.

The "temporary" Screens.Standby.Standby screen does not close and start the Screens.Standby.Standby2 screen. It is the Standby2 screen that implements standby mode.

So, the A/V output is not shut down and the current service is not stopped. Not stopping the current service means that the timeshift buffer is not stopped. However, the timer to save the remainder of the event and the event padding is started.

The process to merge the two parts of the timeshift save is not affected, so when the timer completes, the timeshift buffer and the timer recording will overlap in time, and when they are merged by concatenating them, there will be a large backward jump in the timecodes in the recording (the jump will be the remaining run time of the event when standby was entered). This appears to make the recording fail to play properly in some circumstances.

Because Standby2 is not entered, the ActionMap for standby is not installed, and the remote and front panel POWER buttons have no effect on the power state. In particular, they cannot bring the PVR out of standby.

The problem is due to the fact that in Standby.__init__(), closing Standby and opening Standby2 is initiated by:

self.onHide.append(self.close)

The conditions for that to trigger are met if a MessageBox is started when Screens.InfoBar.InfoBar.checkTimeshiftRunning() when it is called from Standby.showMessageBox(), but that doesn't happen if Timeshift save action on zap is not Ask user, or if Show warning when timeshift is stopped, but the latter is also the subject of Bug #494, which prevents this bug being triggered in the latter case.

This bug can be fixed by changing the trigger for the close of Standby to:

self.onShow.append(self.close)

Replication steps

Enable MENU>Setup>TV>Timeshift settings>Show warning when timeshift is stopped.

Set MENU>Setup>TV>Timeshift settings>Timeshift save action on zap to any action other than Ask user.

Return to live TV, and use REC>Select an event to save>Current event: ... to request that timeshift is saved.

Enter standby either using a POWER press tied to the Standby action or my using the Power / Restart>Standby menu action.

Standby is not fully entered. The A/V output remains on and the currently playing setvice remains on, and the timeshift buffer continues being written to until the end of the current event.

A record timer is started on shutdown to record from the shutdown time to the end of the event plus its padding time. At the end of the recording, the merge of the two parts of the timeshift save is done, but the timeshift buffer is longer than it should be, because there is an overlap in time between the saved timeshift buffer and the timer recording. This can cause problems when the recording is played back, because it can have a large backwards jump in its time codes.

In this state, POWER on either the remote or the front panel won't restart the PVR from standby, because the ActionMap that does that is only created when Standby2 opens. The Standby screen is supposed to be transitory.

The system can be recovered by waiting for the timeshift save/merge to complete and then logging in to the PVR's commandline interface and running:

init 4
init 3

Comments (1)

  1. Peter Urbanec

    Fix Bug #495: "Save timeshift" incorrect on standby when "Timeshift save action on zap" is not "Ask user"

    [Standby]

    Trigger the close of the (temporary) Standby screen on self.onShow instead of self.onHide. The latter isn't triggered if the "You have chosen to save the current timeshift event, but the event has not yet finished. What do you want to do?" popup isn't shown.

    Using self.onShow triggers the close whether the popup is shown or not.

    → <<cset f782730e7d0e>>

  2. Log in to comment