help on debugging. 20 sec to start,stop,channel change (1 Viewer)

lar282

Portal Pro
July 11, 2004
414
2
Hi
I really need help tracking down a problem. Do not really think its mp or tvservers fault but still I need help.
Problem is that everything takes 20 sec in tv module. Stop tv =20 Sec. start tv=20 sec. channel change=20 sec. First I thought it was my disc that started to act funny and after I did a scandisc /f /r it actually worked once. Then it came back. I replaced the disk but still have the issue now. Didn’t care much before since I rarely used mp client on the server and it works flawless from a different computer! Now I bought a new projector and starting to use mp on the machine where the tvserver is and 20 sec is a long time….

Setup:
Computer A: Tv server and mediaportal - This is where I have trouble. It’s a xp mce 2005 fully patched with two dvb-T cards
Computer B: Mediaportal connected to Computer A’s TvServer  Works perfect


Code in TvHome.cs. Added some debug to see where it stops:
//tv off
Log.Debug("Before saving settings");
Log.Info("TVHome:turn tv off");
SaveSettings();
Log.Debug("After saving settings");
TVHome.Card.User.Name = new User().Name;
Log.Debug("After new user");
TVHome.Card.StopTimeShifting();
Log.Debug("After stop time shifting");


The log shows this from MP:
2008-11-25 13:19:03.265625 [Info.][MPMain]: TVHome:turn tv off
2008-11-25 13:19:03.265625 [Info.][MPMain]: Going to save settings
2008-11-25 13:19:03.265625 [Info.][MPMain]: Done saving settings
2008-11-25 13:19:03.265625 [Debug][MPMain]: After saving settings
2008-11-25 13:19:03.312500 [Debug][MPMain]: After new user
2008-11-25 13:19:24.500000 [Debug][MPMain]: After stop time shifting
2008-11-25 13:19:24.500000 [Debug][MPMain]: g_Player.doStop() - stop
2008-11-25 13:19:24.500000 [Info.][MPMain]: TSReaderPlayer:cleanup DShow graph False
2008-11-25 13:19:24.500000 [Info.][MPMain]: TSReaderPlayer: vmr9 disable
2008-11-25 13:19:25.078125 [Info.][MPMain]: state:confused:topped 0

So one can see that mp stalls on TVHome.Card.StopTimeShifting();
Why? I have no clue, but is sits there for 20 sec and then goes on.

Same log from tvserver shows that the server doesn’t get the call to stop tv until 20 sec later!
So, I need some help figuring out where the prob is. I shut down firewalls and antivirus but still same issue. No apperant entries in app log or system log. I think it’s a tcp connection timeout but have no clue how to verify. I do not want to install Visual studio on that machine since it’s a “production” htpc! And I can’t figure out how to attach to the tvservice.exe process and debug. Any here can help with that? I got so far that I started remote deb tool on that machine and I can attach to the process from my dev machine but then what? How can I insert breaks and step through code? Yes I built a debug verion and replced all files, but how and what then?


Please help me out because I am stuck

//Lasse
 

lar282

Portal Pro
July 11, 2004
414
2
added alot of log entries in tvserver and it gets "stuck" when it is Firing the event for timeshifting in TvController.cs line 1545
It just sits there for 20 sec. Now its way over my leag. HELP!

Log.Info("DEBUG: Above Fire this");
Fire(this, new TvServerEventArgs(TvServerEventType.StartTimeShifting, GetVirtualCard(user), user));
Log.Info("DEBUG: Below Fire this");



2008-11-26 15:03:14.328125 [10]: ***** SIGNAL LEVEL: 85, SIGNAL QUALITY: 97 *****
2008-11-26 15:03:14.328125 [10]: **************************************************
2008-11-26 15:03:14.328125 [10]: card: tuned user: cnu6412s61 subchannel: 0
2008-11-26 15:03:14.328125 [10]: user:cnu6412s61 add
2008-11-26 15:03:14.328125 [10]: card2:cnu6412s61 2 0
2008-11-26 15:03:14.328125 [10]: Controller: cnu6412s61 2 0
2008-11-26 15:03:14.343750 [10]: control2:cnu6412s61 2 0
2008-11-26 15:03:14.343750 [10]: Controller: delete timeshift files C:\Storage\TimeShift\Card1\live2-0.ts
2008-11-26 15:03:14.343750 [10]: DEBUG: Controller: delete timeshift files. Above for xxxx
2008-11-26 15:03:14.343750 [10]: DEBUG: Controller: ALl done delete timeshift files. Above for xxxx
2008-11-26 15:03:14.343750 [10]: DEBUG: Just above result = StartTimeShifting(ref userCopy, ref timeshiftFileName)
2008-11-26 15:03:14.359375 [10]: Inside public TvResult StartTimeShifting(ref User user, ref string fileName)
2008-11-26 15:03:14.359375 [10]: DEBUG: Above Fire this
2008-11-26 15:03:36.328125 [10]: DEBUG: Below Fire this
2008-11-26 15:03:36.343750 [10]: DEBUG:starting TS.
2008-11-26 15:03:36.343750 [10]: DEBUG:starting TS. inside lock
2008-11-26 15:03:36.343750 [10]: DEBUG:starting TS. Hostname is checked:
2008-11-26 15:03:36.343750 [10]: card: StartTimeShifting 2 C:\Storage\TimeShift\Card1\live2-0.ts
2008-11-26 15:03:36.343750 [10]: card: CAM enabled : True
2008-11-26 15:03:36.343750 [10]: DEBUG:inside ts row 311
2008-11-26 15:03:36.343750 [10]: subch:0 SetTimeShiftFileName:C:\Storage\TimeShift\Card1\live2-0.ts
2008-11-26 15:03:36.343750 [10]: Set video / audio observer
2008-11-26 15:03:36.359375 [10]: subch:0 SetTimeShiftFileName fill in pids
2008-11-26 15:03:36.359375 [10]: subch:0-0 tswriter StartTimeshifting...
2008-11-26 15:03:36.359375 [10]: card: WaitForTimeShiftFile - waiting _eventAudio & _eventVideo
2008-11-26 15:03:36.421875 [12]: PID seen - type = Video
2008-11-26 15:03:36.421875 [12]: audioVideoEventHandler Video
2008-11-26 15:03:36.421875 [12]: PID seen - type = Audio
2008-11-26 15:03:36.421875 [12]: audioVideoEventHandler Audio
2008-11-26 15:03:36.421875 [10]: card: WaitForTimeShiftFile - video and audio are seen after 0,0625 seconds
2008-11-26 15:03:36.656250 [10]: DEBUG:TvResult.Succeeded
2008-11-26 15:03:36.656250 [10]: user:cnu6412s61 card:2 sub:0 add stream:C:\Storage\TimeShift\Card1\live2-0.ts.tsbuffer
2008-11-26 15:03:36.656250 [10]: RTSP: start streamer
 

lar282

Portal Pro
July 11, 2004
414
2
tried more stuff. This time fiddled with the client code and it seems like the server stitches channel superfast BUT it takes 20 sec for the server to get the confirmation needed for it to go on!!! Wierd. I can't follow the code so I'm still stuck.


//Lasse
 

rtv

Retired Team Member
  • Premium Supporter
  • April 7, 2005
    3,622
    301
    Osnabruck
    Home Country
    Germany Germany
    added alot of log entries in tvserver and it gets "stuck" when it is Firing the event for timeshifting in TvController.cs line 1545
    It just sits there for 20 sec. Now its way over my leag. HELP!

    Log.Info("DEBUG: Above Fire this");
    Fire(this, new TvServerEventArgs(TvServerEventType.StartTimeShifting, GetVirtualCard(user), user));
    Log.Info("DEBUG: Below Fire this");

    So your first guess:
    Code:
    if (false == _cards[cardId].IsLocal)
    definitely is not to blame...

    I guess you don't use one of those plugins either?
    ComSkipLauncher
    ConflictsManager
    ServerBlaster

    If not then please check EpgCard.cs as well:
    void controller_OnTvServerEvent(object sender, EventArgs eventArgs)
     

    lar282

    Portal Pro
    July 11, 2004
    414
    2
    Fixed

    HA, found it. It was a plugin that created the prob. Why didn't I remove all the plugins first and then tried.

    All solved now. Sorry for bothering u all.


    //Lasse
     

    lar282

    Portal Pro
    July 11, 2004
    414
    2
    It was my own plugin that nobody has, so it was totally my fault. Feel really stupid not removing all plugins first
    The plugin sent tcp packets when recieving an event from tvserver and when the ip number was not online it took 10 + 10 sec to finish. When I used the plugin on the other machine then all worked because then both machines where alive and the tcp packet only took 10 milliseconds to send. I fixed it by letting the plugin send the packets in its own thread instead.


    //Lasse
     

    Users who are viewing this thread

    Top Bottom