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:
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?
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
Am Donnerstag, 19. Januar 2006 18:04 schrieb Klaus Schmidinger:
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 ;-)
Yes, I agree but looping through all timers objects, and t->SetFlags(tfNone); ( for prove of concept ;) dosen`t have any effect at all!?
But thanks for the code. I will try this right now.
Markus
Markus Hahn wrote:
Am Donnerstag, 19. Januar 2006 18:04 schrieb Klaus Schmidinger:
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 ;-)
Yes, I agree but looping through all timers objects, and t->SetFlags(tfNone); ( for prove of concept ;) dosen`t have any effect at all!?
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
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.
There could also a treatment in cRecordControls::Shutdown() or Timers::Shutdown() at Minimum a warning for less space at Shutdown.
Markus
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.
There could also a treatment in cRecordControls::Shutdown() or Timers::Shutdown() at Minimum a warning for less space at Shutdown.
What would that be good for?
Besides: there is no cTimers::Shutdown().
Klaus
Klaus Schmidinger wrote:
Markus Hahn wrote:
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?
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 }
After some more thinking I believe cRecordControls::Start() actually is the better place for this check, since it is called several times.
Please try the attached patch.
Klaus
Klaus Schmidinger wrote:
Klaus Schmidinger wrote:
Markus Hahn wrote:
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?
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 }
After some more thinking I believe cRecordControls::Start() actually is the better place for this check, since it is called several times.
Please try the attached patch.
Sorry, forgot the attachment...
Klaus
Klaus Schmidinger wrote:
...
After some more thinking I believe cRecordControls::Start() actually is the better place for this check, since it is called several times.
Please try the attached patch.
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:
Klaus Schmidinger wrote:
...
After some more thinking I believe cRecordControls::Start() actually is the better place for this check, since it is called several times.
Please try the attached patch.
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.
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:
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.
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
Am Samstag, 21. Januar 2006 11:05 schrieb Klaus Schmidinger:
Klaus Schmidinger wrote:
After some more thinking I believe cRecordControls::Start() actually is the better place for this check, since it is called several times.
Please try the attached patch.
Hi Klaus, because vdr wants to record out of EPG, I added Timer->ClearFlags(tfActive);
regards Markus
Markus Hahn wrote:
Am Samstag, 21. Januar 2006 11:05 schrieb Klaus Schmidinger:
Klaus Schmidinger wrote:
After some more thinking I believe cRecordControls::Start() actually is the better place for this check, since it is called several times.
Please try the attached patch.
Hi Klaus, because vdr wants to record out of EPG,
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.
diff -x '[A-Z]*' -x '*.bak' -Nu /home/markus/svn-vdr/vdr-current/i18n.c vdr-rbox/i18n.c --- /home/markus/svn-vdr/vdr-current/i18n.c 2006-01-12 18:12:18.000000000 +0100 +++ vdr-rbox/i18n.c 2006-01-24 18:31:33.000000000 +0100 ...
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:
Markus Hahn wrote:
Klaus Schmidinger wrote:
After some more thinking I believe cRecordControls::Start() actually is the better place for this check, since it is called several times.
Please try the attached patch.
Hi Klaus, because vdr wants to record out of EPG,
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
diff -x '[A-Z]*' -x '*.bak' -Nu /home/markus/svn-vdr/vdr-current/i18n.c vdr-rbox/i18n.c --- /home/markus/svn-vdr/vdr-current/i18n.c 2006-01-12 18:12:18.000000000 +0100 +++ vdr-rbox/i18n.c 2006-01-24 18:31:33.000000000 +0100 ...
Your diff doesn't seem to be made against the latest VDR 1.3.40. It also contained several test outputs.
Klaus
vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Markus Hahn wrote:
Am Mittwoch, 25. Januar 2006 17:14 schrieb Klaus Schmidinger:
Markus Hahn wrote:
Klaus Schmidinger wrote:
After some more thinking I believe cRecordControls::Start() actually is the better place for this check, since it is called several times.
Please try the attached patch.
Hi Klaus, because vdr wants to record out of EPG,
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();
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:
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?
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 ;-)
Georg Acher wrote:
On Sat, Jan 28, 2006 at 02:23:32PM +0100, Klaus Schmidinger wrote:
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?
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 ;-)
Well, in that case the whole timer/recording feature should probably be disabled altogether, shouldn't it?
But then again, who would want a PVR without a hard disk ;-)
Klaus
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