Analog TV scheduling error: orphaned once schedules are not deleted (1 Viewer)

Kimmeridgien

Portal Member
November 16, 2007
20
1
Stockholm
Home Country
Sweden Sweden
Hi,

Through several releases of MP1, I've had a problem with scheduling analog TV recordings. It works a few times after a fresh installation, but then for no apparent reason I can no longer make the schedules stay/appear in the list. I have tried 3 different Hauppauge HW-encoding analog cards (PVR-350, HVR-1300, and the USB external tuner), all developing the same problem after a few schedulings. Windows XP SP3 32-bit and Windows 7 HP 64-bit alike. Manually started recordings work.

Oddly enough, all 3 FloppyDTV-C and previous FireDTV-C cards I've used work flawlessly with scheduling.

I have set logging to maximum, but the only entry is in TVService.log, saying:
"[scheduler thread] [DEBUG] - Scheduler: Orphaned once schedule found 51 - removing"
"[scheduler thread] [DEBUG] - Scheduler: Orphaned once schedule found 52 - removing" and so on.
There's one entry for each (=every) failed attempt to schedule the analog card.

When creating a schedule, the analog cards have extra quality options. Could it be them causing some inconsistency?

Just guessing from the below code, could it be that the scheduler then (correctly) deletes the faulty schedule entry?

Please help me get to the bottom of this. It has been a nuisance to me for several years on an otherwise very good application.

Kind regards

Niclas

http://sources.team-mediaportal.com...e3/TVLibrary/TvService/Scheduler/Scheduler.cs

[MethodImpl(MethodImplOptions.Synchronized)]
private void DoScheduleWork()
{
StopAnyDueRecordings();
StartAnyDueRecordings();
CheckAndDeleteOrphanedRecordings();
CheckAndDeleteOrphanedOnceSchedules();
HandleSleepMode();
}

private void CheckAndDeleteOrphanedOnceSchedules()
{
//only delete orphaned schedules when not recording.
if (!IsRecordingsInProgress())
{
IList<Schedule> schedules = Schedule.FindOrphanedOnceSchedules();
foreach (Schedule orphan in schedules)
{
Log.Debug("Scheduler: Orphaned once schedule found {0} - removing", orphan.IdSchedule);
orphan.Delete();
}
}
}
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hello Niclas

    It works a few times after a fresh installation, but then for no apparent reason I can no longer make the schedules stay/appear in the list.
    Which list are you looking at?


    I have set logging to maximum, but the only entry is in TVService.log, saying:

    "[scheduler thread] [DEBUG] - Scheduler: Orphaned once schedule found 51 - removing"

    "[scheduler thread] [DEBUG] - Scheduler: Orphaned once schedule found 52 - removing" and so on.

    There's one entry for each (=every) failed attempt to schedule the analog card.

    These entries should only be generated when the end time for the schedule has passed (ie. schedule should have been recorded) but the schedule is still in the schedule list.


    mm
     

    Kimmeridgien

    Portal Member
    November 16, 2007
    20
    1
    Stockholm
    Home Country
    Sweden Sweden
    Hi mm and thanks for your reply

    The list I'm referring to is the listing of planned (scheduled) recordings that you reach from the TV menu. (From where you can make new scheduling.)

    Hmm, the recordings I tried to schedule tonight were one starting a short time (1-2 hours) after the time of making the scheduling. (On the same calendar date.) That scheduling seemed to "stick" until I tried to make another scheduling for Sunday and a different analog channel. When I finalized this second scheduling, it lost both of them.

    In other words, the DateTime for the start of recording was ~2 hours later and ~2 days later (so end time definitely not passed when writing to log). Could it be date-related? I'm in Sweden, northern Europe, so CET (GMT+1) but I'm using English (or possibly US English) language settings on the TV server.

    I have posted all log entries dating to the day when I had the problem. I have also tried looking after the scheduler database, but I only find Music.db3 and Video.db3. (No other db3 files.) Is there any particular log file you want or should I just attach all of them?

    Is it much work to get the MP source code up and running so I can debug it myself? Can I use VS Express edition? If so, which version? Could I ask you to direct me to instructions for this?

    I'll be away until Monday, so I'll get back then.

    Thanks again.

    Niclas
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hmmmm, this is a strange issue...

    The list I'm referring to is the listing of planned (scheduled) recordings that you reach from the TV menu. (From where you can make new scheduling.)
    Okay.



    Hmm, the recordings I tried to schedule tonight were one starting a short time (1-2 hours) after the time of making the scheduling. (On the same calendar date.) That scheduling seemed to "stick" until I tried to make another scheduling for Sunday and a different analog channel. When I finalized this second scheduling, it lost both of them.
    Okay.



    In other words, the DateTime for the start of recording was ~2 hours later and ~2 days later (so end time definitely not passed when writing to log). Could it be date-related? I'm in Sweden, northern Europe, so CET (GMT+1) but I'm using English (or possibly US English) language settings on the TV server.
    I guess it could be date/timezone related. I just don't understand why only analog schedules would be affected if that is the case. I think the best way to investigate this is by examining the contents of the DB when you create the schedules (before TV Server deletes them).



    I have posted all log entries dating to the day when I had the problem. I have also tried looking after the scheduler database, but I only find Music.db3 and Video.db3. (No other db3 files.)
    This is a good idea. (y)
    The TV Server database is a MySQL or SQL Server database, not SQLite. There are many tools available for examining the contents of such databases. For example, with MySQL you can use MySQL Workbench (or older GUI Tools). For more general programs such as Squirrel SQL you usually just need a JDBC driver for the DB.

    Is there any particular log file you want or should I just attach all of them?
    All please. Best to use the watchdog tool:
    http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/16_Support/3_Forums/2_Log_Files


    Is it much work to get the MP source code up and running so I can debug it myself?
    No, not at all. :)
    Getting the C++ code compiling can be troublesome for some people... but you don't have to worry about that for this problem (the service scheduler and TV plugin code is fully in C#).
    http://wiki.team-mediaportal.com/1_.../Building_MediaPortal_from_source/1_Git_Setup

    Don't worry about YASM and all of the other stuff. You only need the code + VS.

    Can I use VS Express edition?
    Yes.

    If so, which version?
    2010

    Could I ask you to direct me to instructions for this?
    See the link above. It should be as simple as getting the code with Git, then opening the solution file with VS 2010 and building.



    mm
     

    Kimmeridgien

    Portal Member
    November 16, 2007
    20
    1
    Stockholm
    Home Country
    Sweden Sweden
    Hi and sorry for my long silence.

    I have not been able to look at the schedules before they are deleted, as this seems to happen instantly. I have however looked at all the MySQL DB tables and see nothing strange.

    I attach all log files including the DB. I have excluded some old large files, but all recent files are included.

    Yesterday evening I failed to schedule an analog recording. I (as always) succeeded in scheduling digital recordings. I then tuned to an analog channel manually and started an analog recording with "Record now". This also always works.

    This morning (~10:21) I tested creating a number of 1/2-hour analog schedules. The first ~3 were successful but then the subsequent schedules failed. Either they weren't written to the schedules table (unlikely) or they were immediately deleted as orphans. Then the first scheduled recording started and I could for no apparent reason create more schedules. I don't know if there is a connection between successfully recording and successfully scheduling, but it is currently my best idea.

    As you can see from the attached DB, table schedules, there seems to be no DateTime or timezone problem as I first suspected. All analog channels seem to be schedulable and all schedules were made with "Undefined" quality settings.

    Unless you find some clue in the logs, I guess my next step will be to debug the application. Is it possible to change DB permissions so it is only possible to create but not delete records in the schedules table?

    Kind regards

    Niclas
     

    Attachments

    • MySQL data.zip
      372.4 KB

    Users who are viewing this thread

    Top Bottom