[no Bug] Problem in scheduled recording and recorded TV (1 Viewer)

Hivanoe

Portal Member
November 21, 2006
42
0
Home Country
Italy Italy
Hello

My system was in sleep state and was reset due to a power failure.
I started it manually, and after some minutes it switched OFF but it didn't wake up automatically to process a "series" scheduled recording (that was running fine all the past days)
When I saw it was OFF during the TV event (for the recording) I waked it up manually, it was in the middle of the event to be recorded, but it seems it didn't started the recording
Since this moment I always have problems going into the the recorded TV list (screen remain with the blue3 background continuosly, I have to kill mp)
I have also problem trying to record manually the tv eveng from epg guide.
looking on tv server error log it seems powerscheduler try continuosly to see for the "missed" event .... but I may be wrong, you are the expert !

Attached the log

NOTE (not related to the reported problem): the xml files created by the tv recordings are all named as unknown_nn.xml (nn = progressive number). Shouldn't they have the name of the EPG event name (if scheduled with tvguide/epg as my recordings are) ?

Bye !

PS: very happy with MP ;)
 

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Possibly MySQL has some issues if power just died

    Open up a command prompt (as admin if Vista / Win7)
    navigate to MySQL Bin folder (is C:\Program Files\MySQL\MySQL Server 5.1\bin for me) and enter
    Code:
    mysqlcheck --user=root --pass=MediaPortal --auto-repair MPTVDB

    See if that throws up anything
     

    Hivanoe

    Portal Member
    November 21, 2006
    42
    0
    Home Country
    Italy Italy
    this is the result
    ========================================================
    mptvdb.canceledschedule OK
    mptvdb.card OK
    mptvdb.cardgroup OK
    mptvdb.cardgroupmap OK
    mptvdb.channel
    warning : 7 clients are using or haven't closed the table properly
    status : OK
    mptvdb.channelgroup OK
    mptvdb.channellinkagemap OK
    mptvdb.channelmap OK
    mptvdb.conflict OK
    mptvdb.diseqcmotor OK
    mptvdb.favorite OK
    mptvdb.groupmap
    warning : 1 client is using or hasn't closed the table properly
    status : OK
    mptvdb.history OK
    mptvdb.keyword OK
    mptvdb.keywordmap OK
    mptvdb.personaltvguidemap OK
    mptvdb.program
    warning : 3 clients are using or haven't closed the table properly
    status : OK
    mptvdb.radiochannelgroup OK
    mptvdb.radiogroupmap OK
    mptvdb.recording
    warning : 2 clients are using or haven't closed the table properly
    error : Recordlink that points outside datafile at 4332
    error : Corrupt
    mptvdb.satellite OK
    mptvdb.schedule OK
    mptvdb.server OK
    mptvdb.setting OK
    mptvdb.timespan OK
    mptvdb.tuningdetail OK
    mptvdb.tvmoviemapping OK
    mptvdb.version OK

    Repairing tables
    mptvdb.recording
    info : Found block that points outside data file at 4332
    warning : Number of rows changed from 33 to 32
    status : OK
    ========================================================

    so recording table was broken ...
    I resterted TVservice after the fix, and mediaportal too. Now I can access to tv recordings, :D

    consider however that PC was in suspend when I had the power supply loss, it was not running ...
    does every powerdown will cause this type of problem ? I think no... I had to force htpc shutdown many times for other reasons .... he he
    I may be wrong but I my opinion the problem happened in one of the point with (*) in the sequence:
    1. pc was in suspend since 10 hours
    2. power supply loss
    3. manual turn on
    4. automatic switch to suspend (due to powerscheduler) (*)
    5. after 10 min it had to automatically wake up for a scheduled recording (not done)
    6. manually turned ON during the event to be recorded
    7. mp didn't started to record (no REC icon) (*)
    8. tried to start manually the recording through tvguide (*)
    9. all locked .....

    Thanks however
    Bye
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    consider however that PC was suspend when I had the power supply loss, it was not running ...
    does every powerdown will cause this type of problem ? I think no... I had to force htpc shutdown many times for other reasons
    MySQL is not really designed for standby but does normally cope with it. Power failure (especially during or around standby) can mess up a lot of things.

    Glad it is sorted. Marking this as no-bug.
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    You will always get disk corruption if power is removed while in suspend. If you run chkdsk you will see that even the file system needs a repair.

    Hibernation (and hybrid suspend in Win7) do not suffer from this issue.

    Edit: To be accurate: you are lucky if you do not get disk corruption.
     

    Hivanoe

    Portal Member
    November 21, 2006
    42
    0
    Home Country
    Italy Italy
    chkdsk gives no errors
    may be because at PC restart it made chkdsk itself and it fixed problems ... (or I I was lucky ... he he )
    I know powerloss can give problems ... but not to give a so "locked" state to MP

    I have vista and I'm sure, even If now it's not available in my pc for and unknown reason, it's present hybrid suspend.
    The "problem" I remember is that it's just much more slower to go in suspend and also to wakeup ....

    However, for an htpc that could work "also" as a dvr a "need to recover notify" or a popup that tells to "fix" the database could be useful

    Bye ... and :D
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    Hybrid mode is slow to suspend, fast to resume unless power was lost in which case it is the same as hibernation.

    It is not possible to know if database is corrupt. The corruption could be anything from lost data that could go by undetected to inaccessible tables or table rows that usually return a generic error that could be anything.
     

    doornjoostje

    Portal Pro
    December 6, 2007
    432
    14
    Home Country
    Netherlands Netherlands
    You will always get disk corruption if power is removed while in suspend. If you run chkdsk you will see that even the file system needs a repair.

    Hibernation (and hybrid suspend in Win7) do not suffer from this issue.

    Edit: To be accurate: you are lucky if you do not get disk corruption.

    :D for the info.


    I've had the issue before with the corrupted database.
    I have windows vista and can select hibernate and suspend in the mediaportal config and the tv-server.

    I think mp should make clear to users to use hibernate and is suspend is selected a warning should be displayed, do you agree?
     

    Hivanoe

    Portal Member
    November 21, 2006
    42
    0
    Home Country
    Italy Italy
    hybrid suspend is something between hibernate and suspend:
    I know it's a like a suspend (to RAM ...STR) but the application data are saved to disk and does not remain in RAM.
    PC can wakeup automatically. Not so fast as suspend, but more safe on powerloss.
    May be this is the right to use in general ... but I it's available in vista and up only

    classic hibernate saves all the RAM image on disk (sure but quite slow) (PC will remain completely off, I don't think it can auto wakeup except from bios timer)
    classic suspend mantain all RAM powered just to hold the data (it's the fastest to enter/exit into the state), I think also some cpu code with very slow cpu clock can be executed (example for auto wakeup).


    it should be interesting if possible to flush sql data to disk before forcing the low power mode (made by powerscheduler). This would save from many problems on powerloss ....
    It may be not possible instead do the same if pressing the htpc power button (but not sure...) ...

    Bye
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    Suspend To RAM (STR) saves most of the processor state in RAM. The processor and RAM are still powered but processor clock is halted. While in this state the only thing actually running is the motherboard MCU (microcontroller) that monitors USB/mouse/keyboard and other activity in order to wake up system. It also handles wakeup timers (alarm clock is handled by separate MCU embedded in the RTC which is battery powered). When any wake up event is detected, an interrupt is issued to the processor that brings it out of deep sleep and restores its state from RAM. System continues to where it left off.

    Hibernate saves processor state in RAM, then all the contents of RAM is dumped to the hibernation file (which is marked active) and then the system shuts down. Power is removed from processor and RAM but the motherboard MCU is still running normally and monitors for events and wakeup timers like in STR. When any wake up event is detected, the processor and RAM is power up and normal boot sequence starts (with BIOS POST etc). OS detects the active hibernation file, loads all data from the hibernation file to RAM and restores the processor state from RAM (which was just loaded from HDD). System continues to where it left off.

    In Hybrid mode, suspend follows the pattern for hibernation but does not power down processor or RAM. When any wake up event is detected,it follows the pattern used for STR. If however in between the power is lost, all RAM contents and processor state is also lost. In that case the system boots normally, OS detects active hibernation file and continues to resume from hibernation.

    So to sum it up:

    1. All 3 modes allow wakeup timers, and thus scheduled recordings will work.
    2. Power loss while in STR is equivalent to power loss while system is running.
    3. Hybrid mode takes as much time as hibernation to suspend, but takes as much time as STR to resume.
    4. In all 3 modes the processor is stalled or powered off and cannot execute any code.
     

    Users who are viewing this thread

    Top Bottom