TV Service takes 5 minutes to start. Cannot stream to other PCs. (1 Viewer)

Jamie Murdock

MP Donator
  • Premium Supporter
  • July 26, 2015
    26
    1
    63
    Rhode Island USA
    Home Country
    United States of America United States of America
    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
     

    Attachments

    • MediaPortalLogs_07_01_18__16_56.zip
      4.1 MB

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,577
    8,223
    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.

    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.
    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:
    [collapse]
    [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()[/collapse]

    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.
     

    Jamie Murdock

    MP Donator
  • Premium Supporter
  • July 26, 2015
    26
    1
    63
    Rhode Island USA
    Home Country
    United States of America United States of America
    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
     

    Jamie Murdock

    MP Donator
  • Premium Supporter
  • July 26, 2015
    26
    1
    63
    Rhode Island USA
    Home Country
    United States of America United States of America
    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.
     

    Jamie Murdock

    MP Donator
  • Premium Supporter
  • July 26, 2015
    26
    1
    63
    Rhode Island USA
    Home Country
    United States of America United States of America
    I exported the schedules table. I also exported the entire database, but not sure you want that!
     

    Attachments

    • schedules.xml
      90.8 KB
    • schedules.csv.txt
      14.1 KB

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,577
    8,223
    Home Country
    New Zealand New Zealand
    I need guidance on where to look and what to look for.
    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?
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,577
    8,223
    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:
    SELECT * FROM
    (SELECT id_Schedule, idChannel FROM schedule) s
    LEFT OUTER JOIN
    (SELECT idChannel FROM channel) c
    ON s.idChannel = c.idChannel
    WHERE c.idChannel IS NULL

    Any schedule records in the result set are invalid.
     

    Jamie Murdock

    MP Donator
  • Premium Supporter
  • July 26, 2015
    26
    1
    63
    Rhode Island USA
    Home Country
    United States of America United States of America
    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
     

    Attachments

    • MediaPortalLogs_09_01_18__00_23.zip
      3.3 MB

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,577
    8,223
    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:

    Jamie Murdock

    MP Donator
  • Premium Supporter
  • July 26, 2015
    26
    1
    63
    Rhode Island USA
    Home Country
    United States of America United States of America
    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.
     

    Attachments

    • MediaPortalLogs_09_01_18__22_45.zip
      3.1 MB

    Users who are viewing this thread

    Similar threads

    Anyone?
    Anyone?
    MediaPortal Version: 1.19.0 Description I have a standalone Mediaportal setup with recording to a NAS. Timeshifting is to a local...
    Replies
    6
    Views
    2K
    • Locked
    Hi guys, While I encountered the very same problem as @Fesnor last night, after successfully tuning the DVB-T2 channels I then tuned the DVB-S2 channels and at some point after doing some organising of the channels I encountered the issue. I was, however able to resolve it by simply repairing the install, that is re-running the...
    Hi guys, While I encountered the very same problem as @Fesnor last night, after successfully tuning the DVB-T2 channels I then...
    MediaPortal 2 Version: 2.1.3 Description Hi guys, This actually applies to all MP2 attempts at installation. As the topic says...
    Replies
    3
    Views
    3K
    Sorry for the long wait, with a baby in the house one is happy to get some sleep at all or to form a coherent tought for more than 15minutes. :) recording from 2 tuners at once is stable so far. With zapping I have BSOD after about 10-15 channel changes. Obviously I havent recorded that much. Channel change is slow at 5-6 seconds...
    Sorry for the long wait, with a baby in the house one is happy to get some sleep at all or to form a coherent tought for more than...
    Hi, I am a bit pressed for time now, but I have prepared the text below while my forum registration was pending. My apologies...
    Replies
    23
    Views
    3K
    OK, it's been a very long time, but for completeness: the MySQL problems persisted (slow startup) whatever I tried. Then a recent power cut messed up my HTPC and I had some repairs to do - and thought I'll have another go at getting MySQL to work properly. Tried a complete uninstall (including relevant program and app data folder...
    OK, it's been a very long time, but for completeness: the MySQL problems persisted (slow startup) whatever I tried. Then a recent...
    Oh dear, back again... Everything working except MP's TV service doesn't start automatically with Windows (MP 1.2, XP SP3, all the...
    Replies
    52
    Views
    6K
    Thanks for reporting back. I'm always happy to hear positive results. :) I don't know, but quite possibly. In theory trying to tune to the same channel over and over (or even tuning to different channels lots of times) as the EPG grabber was doing shouldn't cause a BSOD with a good driver. I think of the EPG grabber as...
    Thanks for reporting back. I'm always happy to hear positive results. :) I don't know, but quite possibly. In theory trying to...
    Hi, I have been using MediaPortal since at least December 2012 and am full of admiration for it and the developers and supporters...
    Replies
    6
    Views
    2K
    Top Bottom