recording tv just stopped :( HELP!!! (1 Viewer)

JJDoherty

MP Donator
  • Premium Supporter
  • July 10, 2013
    143
    73
    47
    Dublin
    Home Country
    Ireland Ireland
    Just a small update on this. I've been looking at this and Windows 8 comes with .Net Framework 4.5 and Windows 8.1 comes with .Net Framework 4.5.1, both of which include .Net 4.0, which can't be uninstalled from the OS.

    Visual Studio 2010 won't allow .Net Framework 4.5 to be selected as the "Target Framework" since it is not supported, so re-compiling the TV Service to target .Net 4.5 isn't an option using VS 2010. I may look at using VS 2012, when I get around to it, if I'm prepared to installed more development tools on my HTPC!
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Even if you could connect the debugger sometime after the time when the scheduler thread has locked up and find out where it has locked up that would probably be enough to give us a good clue what the problem is and how to solve it.
     

    JJDoherty

    MP Donator
  • Premium Supporter
  • July 10, 2013
    143
    73
    47
    Dublin
    Home Country
    Ireland Ireland
    Hi @mm1352000, only getting back to this now and have a couple of things I need a little help with.

    I've finally got the development environment setup and have been looking at how to start debugging the TV Service. I'm just not too sure how things all hang together when debugging, can I compile the TVLibrary solution in debug mode with my inserted breakpoint and then run the Mediaportal solution in debug mode to start and stop a recording schedule to try and see what I can see?

    I do hope that makes sense. Is there any other things I should be aware of when trying to run the code in debug mode? Just a bit hesitant to dive in since this is my running HTPC despite having created a restore point!

    Thanks as always...
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I've finally got the development environment setup and have been looking at how to start debugging the TV Service. I'm just not too sure how things all hang together when debugging, can I compile the TVLibrary solution in debug mode with my inserted breakpoint and then run the Mediaportal solution in debug mode to start and stop a recording schedule to try and see what I can see?
    You could try that. Personally I would first try this...
    Simply run the TV service and let the problem occur.
    Open the TVLibrary solution in VS.
    Top menu: debug > attach to process > select attach to managed v4.0 code > tick show processes from all users > select TVService.exe > attach.

    Then you can look at the state, threads etc. etc. etc.
    All that we really need to see is what the "scheduler thread" thread is doing.
     

    JJDoherty

    MP Donator
  • Premium Supporter
  • July 10, 2013
    143
    73
    47
    Dublin
    Home Country
    Ireland Ireland
    @mm1352000 that worked a treat, thanks for that.

    Unfortunately the information I've been able to garner has been minimal because I don't have access to the debug (.pdb) files since I'm attaching to the existing process (TVService.exe). The "scheduler thread" appears to have hung, the call stack location is "[In a sleep, wait, or join]". The thread priority is set to lowest. I've included a screenshot below.

    upload_2014-4-24_14-55-17.png

    It looks like I may have to go with the compile in debug mode to try and get more information unless anyone has any other suggestions or have I missed something, which is well within the realms of possibility!
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Unfortunately the information I've been able to garner has been minimal because I don't have access to the debug (.pdb) files since I'm attaching to the existing process (TVService.exe).
    But you have access to the source, so you can always build the PDBs. ;)
    You can (and should - for this task) replace [at least] the standard TvService.exe and TVControl.dll with debug versions and their corresponding PDBs. I had assumed that you knew to do that. My mistake.

    To be clear:
    1. Switch/checkout with git to the tag that matches the release that you installed:
      upload_2014-4-25_2-17-27.png
    2. Open the TVLibrary solution in VS.
    3. Change to the debug x86 build mode.
    4. Clean and rebuild the solution.
    5. Open Windows explorer.
    6. Backup the TvService.exe and TvControl.dll in the TV Server install folder.
    7. Stop the TV service.
    8. Copy the TvService.exe, TvService.pdb, TvControl.dll and TvControl.pdb from TvEngine3\TVLibrary\TvService\bin\Debug to the TV Server install folder.
    9. Start the TV service.
    Now you can do the attach and see the source code. You should be able to see the exact line of code where the scheduler thread is locked. That is what I need to know.

    The "scheduler thread" appears to have hung, the call stack location is "[In a sleep, wait, or join]". The thread priority is set to lowest. I've included a screenshot below.
    This info isn't really any help, sorry. I see the same on my PC even though the thread is not locked. I think it just means the thread is not active.

    It looks like I may have to go with the compile in debug mode to try and get more information unless anyone has any other suggestions or have I missed something, which is well within the realms of possibility!
    See my comments above. :)
     

    JJDoherty

    MP Donator
  • Premium Supporter
  • July 10, 2013
    143
    73
    47
    Dublin
    Home Country
    Ireland Ireland
    But you have access to the source, so you can always build the PDBs. ;)

    Unfortunately all my fears confirmed! Was hoping to avoid for two reasons, time and the fact that it's my "live" HTPC, so was hoping for an easy way out! Ah well, such is life! Should manage it, thanks @mm1352000 for the step-by-step too.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Unfortunately all my fears confirmed! Was hoping to avoid for two reasons, time and the fact that it's my "live" HTPC, so was hoping for an easy way out!
    You can't easily have live and debug versions of TV service running at the same time on the same PC. Port sharing and all of that stuff. Sorting out how to get that working would have been much more time consuming. Even if you managed to sort that out, you'd have to create a new database in order to avoid double recordings (because both instances would connect to the same DB by default). It would just be trouble. This way is the easier way. ;)
     

    JJDoherty

    MP Donator
  • Premium Supporter
  • July 10, 2013
    143
    73
    47
    Dublin
    Home Country
    Ireland Ireland
    This way is the easier way. ;)

    Totally agree, when I say "easy way out" what I really mean is lazy, non-effort like way! :sleep:[DOUBLEPOST=1398353165][/DOUBLEPOST]Okay, the preliminary results are in, the line where the service seems to have halted can be seen in the screenshot below:

    upload_2014-4-24_16-25-27.png
     
    Last edited:

    JJDoherty

    MP Donator
  • Premium Supporter
  • July 10, 2013
    143
    73
    47
    Dublin
    Home Country
    Ireland Ireland
    Additionally, here is the complete call stack for the "scheduler thread":

    upload_2014-4-24_16-37-11.png

    In case that's too small to read the list is:
    • TVService.exe!TvService.TVController.Fire(object sender, System.EventArgs args) Line 4101 + 0x1a bytes
    • TVService.exe!TvService.Scheduler.RecordingStartedNotification(TvService.RecordingDetail recDetail) Line 1387 + 0xa7 bytes
    • TVService.exe!TvService.Scheduler.SetupAndStartRecord(TvService.RecordingDetail recDetail, ref TvControl.IUser user, TvService.CardDetail cardInfo, TvService.ICardTuneReservationTicket ticket, TvService.CardReservationRec cardResImpl) Line 1198 + 0xc bytes
    • TVService.exe!TvService.Scheduler.FindFreeCardAndStartRecord(TvService.RecordingDetail recDetail, TvControl.IUser user, System.Collections.Generic.ICollection<TvService.CardDetail> cards, int maxCards, System.Collections.Generic.IDictionary<TvService.CardDe...
    • TVService.exe!TvService.Scheduler.IterateTicketsUntilRecording(TvService.RecordingDetail recDetail, TvControl.IUser user, System.Collections.Generic.ICollection<TvService.CardDetail> cards, TvService.CardReservationRec cardRes, int maxCards, System.Collecti...
    • TVService.exe!TvService.Scheduler.IterateCardsUntilRecording(TvService.RecordingDetail recDetail, TvControl.IUser user, System.Collections.Generic.ICollection<TvService.CardDetail> cardsForReservation, TvService.CardReservationRec cardRes) Line 996 + 0x1e b...
    • TVService.exe!TvService.Scheduler.StartRecordOnCard(TvService.RecordingDetail recDetail, ref TvControl.IUser user, System.Collections.Generic.ICollection<TvService.CardDetail> cardsForReservation) Line 955 + 0x17 bytes
    • TVService.exe!TvService.Scheduler.StartRecordOnFreeCard(TvService.RecordingDetail recDetail, ref TvControl.IUser user) Line 1044 + 0x12 bytes
    • TVService.exe!TvService.Scheduler.StartRecord(TvService.RecordingDetail recDetail) Line 936 + 0x10 bytes
    • TVService.exe!TvService.Scheduler.StartAnyDueRecordings() Line 459 + 0xc bytes
    • TVService.exe!TvService.Scheduler.DoScheduleWork() Line 382 + 0x9 bytes
    • TVService.exe!TvService.Scheduler.SchedulerWorker() Line 355 + 0x9 bytes
     

    Users who are viewing this thread

    Top Bottom