PowerScheduler wakes up but does not start recording

Discussion in 'TV-Server Plugins' started by jmarc, August 9, 2015.

  1. jmarc
    • Premium Supporter

    jmarc MP Donator

    Joined:
    August 21, 2008
    Messages:
    63
    Likes Received:
    9
    Ratings:
    +9 / 0
    Home Country:
    Hi,

    Sorry if this is not the correct forum category.

    I am using the latest MP1.12 in a single seat mode with MySQL 5.6

    I have a strange situation where PowerScheduler would wake up the computer at the right time for recording but then would NOT start the recording and would go back to sleep 15 minutes. See log extract attached with comments.

    I have disabled PS for the time being.



    Any thoughts as to why this would happen?

    Thanks!

    JM
     

    Attached Files:

  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. HTPCSourcer
    • Team MediaPortal
    • Administrator

    HTPCSourcer MP2 Product Manager

    Joined:
    May 16, 2008
    Messages:
    11,176
    Likes Received:
    1,145
    Gender:
    Male
    Ratings:
    +2,458 / 22
    Home Country:
    Germany Germany
    Show System Specs
    Hello,

    Posting a portion of the log file is not really helpful as you have cut out the important information. Please zip the full log files, ideally the complete directory, and upload it here.
     
  4. jmarc
    • Premium Supporter

    jmarc MP Donator

    Joined:
    August 21, 2008
    Messages:
    63
    Likes Received:
    9
    Ratings:
    +9 / 0
    Home Country:
    Thanks. Here are all the log files. The portion I highlighted comes from TVService.6.log
     
  5. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,541
    Likes Received:
    4,752
    Ratings:
    +8,220 / 17
    Home Country:
    New Zealand New Zealand
    Looks like the scheduler locked up here at the point where it should be getting the current set of schedules from the database:
    [2015-08-09 08:28:01,822] [Log ] [PowerEventThread] [INFO ] - Scheduler: started

    There's no indication of errors in our log files.
    Can you please check your MySQL DB log files for errors and/or slow queries at around that time.
     
  6. jmarc
    • Premium Supporter

    jmarc MP Donator

    Joined:
    August 21, 2008
    Messages:
    63
    Likes Received:
    9
    Ratings:
    +9 / 0
    Home Country:
    Thanks. Not too sure how to do that. I went to "C:\programdata\MySQL\MySQL Server 5.6\data" but found nothing relevant and also I opened tables "General_log" and "Slow_log" in Mysql DB, but they were empty. I don't know how to enable logging if needed.

    The issue happens only when waking up, and not with all scheduled recordings. If I disable PowerScheduler then all recordings start normally.

    I imported most of the scheduled recordings from another MP installation as I have rebuilt MP on a new hardware (Windows 7 64 bit in both instances). I need to do more testing but it could be that newly created recordings do start correctly. Could imported schedules be an issue?

    Cheers,
     
  7. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,541
    Likes Received:
    4,752
    Ratings:
    +8,220 / 17
    Home Country:
    New Zealand New Zealand
    In the past I've only ever used the administration section of MySQL Workbench to check MySQL logs... but I suppose what you've checked is equivalent. Note that the options for log level etc. are also accessible via MySQL Workbench admin (or the mysql .ini/my.ini file if you're very brave).

    If disabling PS helps then perhaps the problem is that sometimes (when you're unlucky!) not enough time is given for the PC to resume properly?
    I say this because the DB query that seems to be getting stuck is a query for all schedules. Therefore it shouldn't matter which recording is triggering the resume. You can see this for yourself here:
    https://github.com/MediaPortal/Medi...Library/TvService/Scheduler/Scheduler.cs#L122

    Remember that in the log we see:
    [2015-08-09 09:03:50,748] [Log ] [PowerEventThread] [INFO ] - Scheduler: started

    The code tells us the next line to expect should be "Scheduler: loaded X schedules"... but we don't see that. Therefore something is getting stuck in that "gap". The gap contains the request/query for all schedules...
    I wouldn't have thought importing schedules would be a problem... but maybe I'm wrong. Nothing is certain at this time.
     
  8. jmarc
    • Premium Supporter

    jmarc MP Donator

    Joined:
    August 21, 2008
    Messages:
    63
    Likes Received:
    9
    Ratings:
    +9 / 0
    Home Country:
    Thanks. Yeah there might be an issue with the PC not resuming fast enough and TV service being unable to query the DB. Is there a parameter I could change in TV service to tell it to wait a little before starting operations after a wake up?

    In TVService.6.log it looks like the scheduler is trying to run a second time a second later as if it failed the first time.

    Also does TVservice use localhost or host name to resolve the address of mySQL server? I'm asking because name resolution on my home network is a bit slow (router not very good) so using a host name could be an issue.

    * Starts correctly after 1st wake up at 5.38 *
    [2015-08-09 05:38:06,008] [Log ] [PowerEventThread] [INFO ] - TvController.OnResume()
    [2015-08-09 05:38:06,009] [Log ] [PowerEventThread] [INFO ] - Controller: setup HeartBeat Monitor
    [2015-08-09 05:38:06,028] [Log ] [HeartBeatMonitor] [INFO ] - Controller: Heartbeat Monitor initiated, max timeout allowed is 30 sec.
    [2015-08-09 05:38:06,147] [Log ] [PowerEventThread] [INFO ] - Scheduler: started
    [2015-08-09 05:38:06,188] [Log ] [PowerEventThread] [INFO ] - Scheduler: loaded 23 schedules
    [2015-08-09 05:38:06,188] [Log ] [PowerEventThread] [DEBUG] - Scheduler: thread started.

    * Doesn't start recording *
    [2015-08-09 08:28:01,821] [Log ] [PowerEventThread] [INFO ] - TvController.OnResume()
    [2015-08-09 08:28:01,821] [Log ] [PowerEventThread] [INFO ] - Controller: setup HeartBeat Monitor
    [2015-08-09 08:28:01,822] [Log ] [HeartBeatMonitor] [INFO ] - Controller: Heartbeat Monitor initiated, max timeout allowed is 30 sec.
    [2015-08-09 08:28:01,822] [Log ] [PowerEventThread] [INFO ] - Scheduler: started
    then nothing...

    * Same 1 second later *
    [2015-08-09 08:28:02,957] [Log ] [PowerEventThread] [INFO ] - TvController.OnResume()
    [2015-08-09 08:28:02,957] [Log ] [PowerEventThread] [INFO ] - Controller: setup HeartBeat Monitor
    [2015-08-09 08:28:02,976] [Log ] [HeartBeatMonitor] [INFO ] - Controller: Heartbeat Monitor initiated, max timeout allowed is 30 sec.
    [2015-08-09 08:28:02,977] [Log ] [PowerEventThread] [INFO ] - Scheduler: started
    then nothing...
     
  9. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,541
    Likes Received:
    4,752
    Ratings:
    +8,220 / 17
    Home Country:
    New Zealand New Zealand
    It would be a PS setting if such a parameter existed. I'm not a PS expert, but it doesn't look like such a setting exists. Sorry.

    Yes, it did fail the first time... and the second time also.

    Ahhh, I see. TV Server uses whatever you put in the gentle.config file. If you put an IP address in there then an IP address will be used; same for a host name.
     
  10. jmarc
    • Premium Supporter

    jmarc MP Donator

    Joined:
    August 21, 2008
    Messages:
    63
    Likes Received:
    9
    Ratings:
    +9 / 0
    Home Country:
    Ok I'll try a few things tomorrow.

    By the way there is this option in PS: "Reinitialize TV controller on wakeup (also reinitializes tuner)". Would it possibly help if I turn it on?

    Thanks.
     
  11. jmarc
    • Premium Supporter

    jmarc MP Donator

    Joined:
    August 21, 2008
    Messages:
    63
    Likes Received:
    9
    Ratings:
    +9 / 0
    Home Country:
    TV server has been waking up and recording correctly for the last 6 days so I assume it's fixed, The only change I made was to replace the host name with the IP address in gentle.config. Thanks for the help. I'll report back if it misbehaves again.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!