TV Service takes 5 minutes to start. Cannot stream to other PCs.

Discussion in 'Television (MyTV frontend and TV-Server)' started by Jamie Murdock, January 7, 2018.

  1. Jamie Murdock
    • Premium Supporter

    Jamie Murdock MP Donator

    Joined:
    July 26, 2015
    Messages:
    26
    Likes Received:
    1
    Gender:
    Male
    Occupation:
    Electrical Engineer / Product Developer
    Location:
    Rhode Island USA
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    I have so many symptoms that I am wondering if I shouldn't just uninstall and wipe everything and start over. #4 below is the only showstopper, but #6 is major.

    1) (not critical) I switched to Schedules Direct in December after IMDB stopped their TV Guide. Now TVService takes 5 minutes or more to start, which seems odd. I think my use / misues of the SchedulesDirect EPG plugin is correlated to some of these.

    2) (unreliable) When i start a show to record, the TVServer tries various tuners a few times before actually starting a recording. This means it can take a long time to start a recording. If I have used up all but one tuner, it tries that tuner a few times, then will finally record. I can watch this behavior in the Manual Control page of SetupTV. (New problem since December.)



    3) (annoying but workaround) Many times when streaming to my Kitchen computer, the first attempt to play a recording results in an error message like "unable to play 52F27D90" and this number changes. Simply trying it again would then play normally. (New problem since December.)

    4) (failure) BUT NOW I cannot stream anything to the Kitchen or Bedroom. I get these same errors on the two streaming client PCs, but on the TV Server these files play properly. The same error "unable to play 7D8C7773" for example, but now it is persistent instead of clearing up on a second attempt. (New as of today.)

    5) (system gets stuck 1-2 times a month) My HDHOMERUN Prime Tuners get stuck "busy" whenever recording problems occur (like disk full, or PC reboot), requiring a reboot of the Prime tuners. This has been a forever problem, but is quite annoying because what happens is that suddenly nothing is recorded without notice. The Tuners web admin say they are idle, and the HDHOMERUN TV App will play the 'locked' tuners fine, but MP still says they are busy. After I stop TVService, Power cycle the HDHOME rune tuners, then restart TV Service, it all works again. Why does MP think tuners are busy? I turned off my firewall a couple of years ago trying to fix this problem. (since day one)

    6) (reduced capacity) When restarting TVService, not all tuners get recognized. This is a recent problem, but I cannot remember changing anything to cause this. Here tuner 8 is not recognized. Next restart of TVService, it will be a different one, or maybe two.
    upload_2018-1-7_17-27-31.png


    7) I notice that the "schedules" page never renders. Notice in the screenshot below, it says Schedules, but is still showing the Manual Control page. I ran mysqlcheck mptvdb --auto-repair -e -u root -p and it completed saying everything was OK. (New since December). I don't need this Schedules page, but wonder if this is not a symptom of something bigger.

    upload_2018-1-7_17-14-22.png

    8) (cosmetic) SetupTV crashes 90% of the time I use the Stop Service button. It does stop the service, but crashes and I have to re-run it. Sometimes it never opens when I start the App, but I think that is correlated to when the TVService is still "starting" (which now takes at least 5 minutes). (been happening for a year, but not day one).

    9) (minor) TV channels are a mess after switching to SchedulesDirect. I must have done something wrong, because I keep getting "unknown" new channels populated. Is the SchedulesDirect EPG Client the best choice for EPG on Cox cable channels in the US? I thought it was going to eliminate all the text editing I used to do with the WEB EPG Grabber. The SchedulesDirect updates seem to keep up, but several channels say "No Data" in the guide. I don't think everything is synchronizing and I don't fully understand how that works to debug it myself.

    10) My wife hoards recordings and I don't expect this forum to help. Needless to say I have 5 USB drives on a USB3.0 card. I record onto 4 different disks and sometimes move files (and use "database import" and "remove invalid files" to clean up the database). Is there a better way to span disks? This is tedious.

    If there are fixes to all this, with #4 and #6 being a priority, I will try them. If I should uninstall MP1 and TV Server and start with a clean install, I will do that too. I would like guidance on what EPG to use and how to populate channels (HDHOMERUN PRIME import? Scan? SchedulesDIrect populate?)

    thanks for any assistance!
    Jamie
     

    Attached Files:

  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Hi Jamie

    First, may I say: what a mess!
    It's not going to be practical to provide a one-post solution/reply. Therefore, let's take things one at a time, with the most important first.

    Actually this is critical. The TV service is not starting successfully at all, and that is the underlying cause of a number of the issues you mentioned, including #4.

    The relevant exception in the log:
    Show Spoiler

    [2018-01-07 16:39:13,474] [Log ] [TVService] [INFO ] - TvControllerException: System.NullReferenceException: Object reference not set to an instance of an object.
    at TvDatabase.Schedule.GetProgramsForSchedule(Schedule schedule)
    at TvDatabase.Schedule.SynchProgramStates(Int32 idSchedule)
    at TvDatabase.Schedule.SynchProgramStatesForAll()
    at TvService.TVController.InitController()
    at TvDatabase.Schedule.GetProgramsForSchedule(Schedule schedule)
    at TvDatabase.Schedule.SynchProgramStates(Int32 idSchedule)
    at TvDatabase.Schedule.SynchProgramStatesForAll()
    at TvService.TVController.InitController()


    In short: it looks like there is an invalid schedule in TV Server's database. Incidentally, this is almost certainly the cause of #7 as well as #1 and #4.
    The only practical way to deal with such a problem would be to examine the schedule list in the database, identify the invalid schedule, and delete it.
     
  4. Jamie Murdock
    • Premium Supporter

    Jamie Murdock MP Donator

    Joined:
    July 26, 2015
    Messages:
    26
    Likes Received:
    1
    Gender:
    Male
    Occupation:
    Electrical Engineer / Product Developer
    Location:
    Rhode Island USA
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    This is helpful. How do I examine the schedule list? Is there a GUI for this? The Schedules page of SetupTV won't render. Inside MP GUI I see a list of programs in the Schedules menu. How would I tell if any one is invalid?

    Can I use MS Access to examine tables in the database?

    Thanks
    Jamie
     
  5. Jamie Murdock
    • Premium Supporter

    Jamie Murdock MP Donator

    Joined:
    July 26, 2015
    Messages:
    26
    Likes Received:
    1
    Gender:
    Male
    Occupation:
    Electrical Engineer / Product Developer
    Location:
    Rhode Island USA
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    For fun, I learned about and downloaded MYSQL workbench and opened the schedules table directly. What makes a schedule entry invalid is not obvious to me, but the last entry sure looks different! idParentSchedule is -1 for all except for Wisdom of the crowd which is 12582.
    upload_2018-1-7_20-50-3.png

    Can I just delete this row and see what happens?

    UPDATE: never mind, there are others with large numbers in this column. I need guidance on where to look and what to look for.
     
  6. Jamie Murdock
    • Premium Supporter

    Jamie Murdock MP Donator

    Joined:
    July 26, 2015
    Messages:
    26
    Likes Received:
    1
    Gender:
    Male
    Occupation:
    Electrical Engineer / Product Developer
    Location:
    Rhode Island USA
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    I exported the schedules table. I also exported the entire database, but not sure you want that!
     

    Attached Files:

  7. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Check that the channel referenced by each schedule record actually exists.

    For example, take schedule 12548 (id_Scedule value = 12548).
    The associated channel is denoted by the value of the idChannel column. In the case of schedule 12548 it is channel 194.
    Look at the channel table in the same way as you did for the schedule table. You should be able to find a record in the channel table with ID (idChannel value) of 194.

    Clear?
     
  8. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    If you can figure out how to run an SQL query in Workbench, try the following to save time identifying the invalid schedule(s):
    Code (Text):
    1. SELECT * FROM
    2. (SELECT id_Schedule, idChannel FROM schedule) s
    3. LEFT OUTER JOIN
    4. (SELECT idChannel FROM channel) c
    5. ON s.idChannel = c.idChannel
    6. WHERE c.idChannel IS NULL
    Any schedule records in the result set are invalid.
     
    • Informative Informative x 1
  9. Jamie Murdock
    • Premium Supporter

    Jamie Murdock MP Donator

    Joined:
    July 26, 2015
    Messages:
    26
    Likes Received:
    1
    Gender:
    Male
    Occupation:
    Electrical Engineer / Product Developer
    Location:
    Rhode Island USA
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    YAY! Running a query was easy, I pasted your text and ran it in MySQL Workbench, with this result of three bad entries. :

    upload_2018-1-8_22-33-38.png

    upload_2018-1-8_23-59-37.png


    I deleted these three entries, clicked Apply to run the delete script, and now I can stream to my other clients without error. I can now stop and restart the service without the long delays.

    At the moment, I can only seem to use two tuners, and new recordings seem to have to restart 3 times before they remain recordings. This is what I observer watching the Manual Control list.

    Thanks for the help!!!
    Jamie
     

    Attached Files:

  10. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Right, so presumably at some point you deleted the channel that those schedules referred to. TV Server should have deleted the schedules at the same time. I can't explain that, sorry. :confused:

    Let's recap. By my reckoning we've definitely or probably solved #1, #2, #3, #4, #7 and #8. Please confirm.

    Next issue I'd like to address (because I'm hoping it's going to be easy!) is #6. My bet is that you didn't apply the CableCARD tuner patch when you updated to MP 1.18. Please refer my comment at the top of the first post in -->this<-- thread, and install the linked patch.

    [edit: In case I wasn't clear, for the foreseeable future, that patch must be reapplied each time you upgrade or reinstall MediaPortal.]
     
    Last edited: January 9, 2018
  11. Jamie Murdock
    • Premium Supporter

    Jamie Murdock MP Donator

    Joined:
    July 26, 2015
    Messages:
    26
    Likes Received:
    1
    Gender:
    Male
    Occupation:
    Electrical Engineer / Product Developer
    Location:
    Rhode Island USA
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    I do believe that you solved 1,3,4 and 7.

    2,5,6 and 8 are still there even after reinstalling the patch. I did this patch once a long time ago, assumed it was merged in subsequent updates. I just power cycled my tuners, and restarted the service and started several shows recording in the attached. Every show tried several tuners before recording, according to what I see in the Manual Control page.
     

    Attached Files:

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!