Hi there
A full or not available disk causes a endless lopp of TimerStart and EmergencyExit if a timer is active.
To avoid this, I added this code to cRecordControls::Start() :
menu.c:3518 bool cRecordControls::Start(cTimer *Timer, bool Pause) { ChangeState(); if (!VideoFileSpaceAvailable(300)) { Skins.Message(mtInfo, tr("No disk space!")); if (Timer) Timer->Delete();
return false; }
Now the message pops up endlessly, because the timer is still aktive??? Any suggestions?
regards Markus
Markus Hahn wrote:
Maybe a better place for this would be in the main VDR loop:
// Start new recordings: if (VideoFileSpaceAvailable(300)) { cTimer *Timer = Timers.GetMatch(Now); if (Timer) { if (!cRecordControls::Start(Timer)) Timer->SetPending(true); else LastTimerChannel = Timer->Channel()->Number(); } } else if (/*TimeSinceLastNoDiskSpaceMessageGreaterLimit*/) { Skins.Message(mtWarning, tr("No disk space!")); // reset timeout limit }
BTW: brutally deleting that timer is probably not a good idea. This could be a repeating timer, or disk space could become available later. Also, the cRecordControls::Start() function is called from a loop through all timers, so if you delete it, strange things might happen ;-)
Klaus
Markus Hahn wrote:
Well, that might work, since you disable the timer. But that would disable them for good, and would lose the VPS bit and everything else.
But thanks for the code. I will try this right now.
I guess I'll also implement this in the next version - if the disk is full there is actually no point in starting a recording. Thanks for the suggestion.
Klaus
Klaus Schmidinger wrote:
It just crossed my mind that with the previous modification it would no longer be possible for a timer with a higher priority to force deletion of existing recordings with lower priority. Therefore the attached patch (to be applied after the previous one) makes sure AssertFreeDiskSpace() is called before checking for free disk space.
Klaus
Klaus Schmidinger wrote:
Ok, one more small detail:
--- menu.c 2006/01/20 17:19:46 1.398 +++ menu.c 2006/01/21 10:02:19 @@ -3524,8 +3524,10 @@ { static time_t LastNoDiskSpaceMessage = 0; int FreeMB = 0; - if (Timer) - AssertFreeDiskSpace(Timer->Priority(), true); + if (Timer) { + AssertFreeDiskSpace(Timer->Priority(), !Timer->Pending()); + Timer->SetPending(true); + } VideoDiskSpace(&FreeMB); if (FreeMB < MINFREEDISK) { if (!Timer || time(NULL) - LastNoDiskSpaceMessage > NODISKSPACEDELTA) {
Otherwise AssertFreeDiskSpace() would issue too many messages.
Since my disk is normally not full, it's hard for me to test this under real live conditions. So maybe somebody with a notoriously full disk should do some testing here.
Klaus
Am Samstag, 21. Januar 2006 11:05 schrieb Klaus Schmidinger:
thank you, Klaus for fast patches. I do the tests on a smaller partition with 100% use: /export/nospace
The patch does a good job, but sometimes, if timerStat is set to 11 apears the message constantly "Low disk space". If that happend, user interaction is not possible anymore.
regards markus
Markus Hahn wrote:
What do you mean by "vdr wants to record out of EPG"?
I added Timer->ClearFlags(tfActive);
I don't think it's a good idea to deactivate a timer. If this is a repeating timer and the user doesn't realize that it has been deactivated, it won't record next time.
Your diff doesn't seem to be made against the latest VDR 1.3.40. It also contained several test outputs.
Klaus
Am Mittwoch, 25. Januar 2006 17:14 schrieb Klaus Schmidinger:
What do you mean by "vdr wants to record out of EPG"?
call up EPG -> OK on running programm -> kRed ->kOk will set an instant timer. Few minutes later you will get the message Skins.Message(mtWarning, tr("Not enough disk space to start recording!") or "Low disk space!" endlessly.
This is caused by cRecordControl::Process();
regards Markus
Markus Hahn wrote:
When I simulate a full disk by doing
VideoDiskSpace(&FreeMB); FreeMB = 0;//XXX if (FreeMB < MINFREEDISK) {
in cRecordControls::Start(), then go into the EPG and program a timer as you suggested, I immediately get the message
Not enough disk space to start recording...
and no recording is started. This message is repeated every five minutes, which I guess is ok since if there actually is somebody watching TV at that time, they probably want to do something about this. You could increase NODISKSPACEDELTA if you want this message to be displayed less often.
If there is enough free disk space at the time the timer is programmed, the recording will start and once the free disk space falls below MINDISKSPACE the message
Low disk space!
will be displayed every DISKCHECKDELTA (100) seconds to make the user aware of the fact that the disk is running full.
Since there are reasonable timeouts between these messages, I'm afraid I don't see the actual problem. Maybe I didn't have the exact test case you are running?
Klaus
On Sat, Jan 28, 2006 at 02:23:32PM +0100, Klaus Schmidinger wrote:
Imagine some PVR boxes just used for watching live-TV... There's no hard disk installed. So the repeating message may be a bit annoying ;-)
Am Freitag, 20. Januar 2006 17:32 schrieb Klaus Schmidinger:
After some more thinking I believe cRecordControls::Start() actually is the better place for this check, since it is called several times.
Yes, beside, the main loop is large enough ;)
I tryed to set flags with timer->SetFlags(timer->Flags() & 0xFFFE) Dosn`t have any effect at all.
Please try the attached patch.
I just want to complain, but here it comes. ;) thanks a lot.
Markus