[TV] - HD-PVR TV freezes After Channel Change When using SPDIF (1 Viewer)

cwchapma

Portal Pro
October 15, 2006
56
34
48
Home Country
Canada Canada
When it gets stuck, what happens if you pause TV for a few seconds - does it fix it ?

I don't even need to wait - a quick pause and play and it starts up again. Of course, I'm always waiting to make sure it's stuck (even though it always is) and it's buffering data on the server as soon as the stream sorts itself out even though my client video is frozen.

Does that help?

Clint
 

Owlsroost

Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Using TsReader v73, open regedit and go to HKEY_CURRENT_USER\Software\Team MediaPortal\TsReader, and set 'EnableBufferLogging' to 1.

    This will make it log the internal video/audio/RTSP buffer status every 4 seconds, which should tell us what is running out of data (or not using it, if the video decoder is hanging etc.)
     

    cwchapma

    Portal Pro
    October 15, 2006
    56
    34
    48
    Home Country
    Canada Canada
    Done. See attached logs. Hope that helps.

    Edit: To be clear. I started Live TV, changed the channel, waited about 5 seconds, paused and unpaused, and then shutdown.

    Clint
     
    Last edited:

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Thanks for the logs - I'll take a look when I get back from vacation in a few days time.
     

    LesD

    Portal Member
    May 10, 2012
    8
    0
    Home Country
    United States of America United States of America
    Have the same exact problem here, so if there is a need for additional logs, let me know.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Thanks for the logs - I'll take a look when I get back from vacation in a few days time.

    OK - shortly after the channel change, TsReader stops receiving data (as far as I can tell):

    Code:
    02-05-2013 18:00:47.697 [13380048] [180c] Vid/Ref : 84.515, ?-frame(00), Compensated = 0.447 ( 0.448 A/V buffers=11/07), Clk : 0.000000, SampCnt 2, stallPt 2.500
    02-05-2013 18:00:47.704 [13380048] [15f0] CTsReaderFilter::Run(81515.21) state 1 seeking 0
    02-05-2013 18:00:47.704 [13380048] [15f0] Run() - Elapsed time from pause to Audio/Video ( total zapping time ) : 1604 mS
    02-05-2013 18:00:47.704 [13380048] [15f0] CTsReaderFilter::Run(81515.21) state 2 -->done
    02-05-2013 18:00:47.705 [13380048] [180c] Vid/Ref : 84.548, ?-frame(00), Compensated = 0.497 ( 0.496 A/V buffers=10/05), Clk : 0.001000, SampCnt 4, stallPt 2.500
    02-05-2013 18:00:47.706 [13380048] [ 690] Aud/Ref : 84.214, Compensated = 0.492 ( 0.489 A/V buffers=10/04), Clk : 0.003000, SampCnt 6, Sleep 1 ms, stallPt 0.800
    02-05-2013 18:00:47.706 [13380048] [180c] Vid/Ref : 84.548, ?-frame(00), Compensated = 0.497 ( 0.494 A/V buffers=09/04), Clk : 0.003000, SampCnt 5, stallPt 2.500
    02-05-2013 18:00:47.708 [13380048] [ 690] Aud/Ref : 84.246, Compensated = 0.524 ( 0.520 A/V buffers=09/03), Clk : 0.004000, SampCnt 7, Sleep 1 ms, stallPt 0.800
    02-05-2013 18:00:47.708 [13380048] [180c] Vid/Ref : 84.582, ?-frame(00), Compensated = 0.547 ( 0.544 A/V buffers=08/03), Clk : 0.004000, SampCnt 6, stallPt 2.500
    02-05-2013 18:00:47.710 [13380048] [ 690] Aud/Ref : 84.278, Compensated = 0.556 ( 0.550 A/V buffers=08/02), Clk : 0.006000, SampCnt 8, Sleep 1 ms, stallPt 0.800
    02-05-2013 18:00:47.711 [13380048] [ 64c] Demux : Audio to render 0.806 Sec
    02-05-2013 18:00:47.711 [13380048] [ 64c] Demux : Video to render 1.020 Sec
    02-05-2013 18:00:47.723 [13380048] [ 64c] Demux : Video to render 0.908 Sec
    02-05-2013 18:00:48.460 [13380048] [ 64c]  H.264 2nd GOP found 85.683000
    02-05-2013 18:00:51.168 [13380048] [1180] Buffers : A/V = 0/0, RTSP = 0, A last : 86.006, V Last : 86.217
    02-05-2013 18:00:55.457 [13380048] [1180] Buffers : A/V = 0/0, RTSP = 0, A last : 86.006, V Last : 86.217
    02-05-2013 18:00:59.745 [13380048] [1180] Buffers : A/V = 0/0, RTSP = 0, A last : 86.006, V Last : 86.217
    02-05-2013 18:01:04.033 [13380048] [1180] Buffers : A/V = 0/0, RTSP = 0, A last : 86.006, V Last : 86.217
    02-05-2013 18:01:04.739 [13380048] [ 2cc] CTsReaderFilter::Pause() - IsTimeShifting = 1 - state = 2
    02-05-2013 18:01:04.739 [13380048] [ 2cc]  -- Pause()  ->pause rtsp at position: 103.290000
    02-05-2013 18:01:04.739 [13380048] [ 2cc] CRTSPClient::Pause()
    02-05-2013 18:01:04.739 [13380048] [ 2cc] CRTSPClient::Pause() stopthread

    There are four identical "Buffers : A/V = 0/0, RTSP = 0, A last : 86.006, V Last : 86.217" messages, which means it's not received any new RTSP data for at least 12 seconds (but it has received enough to start playing initially), so presumably the server has stopped sending it. When you pause in RTSP mode, it stops/closes the current session and then starts a new session when you un-pause it - which is presumably why it fixes the freeze.

    On the evidence so far, this looks like a TV server problem, but I can't help much more because I know nothing about how the RTSP side of TV server works at the moment.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    My guess as to why it only has the problem with SPDIF input is because the SPDIF receiver takes time to lock onto the new signal, and while it's unlocked the HDPVR probably doesn't produce any output data stream (to MP TV-server).

    I can't tell without matching server + client logs, but maybe the RTSP server is timing out because it keeps hitting timeshift buffer end-of-file in this situation ?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hmmm...
    I've never looked at the streaming server code so this will be a new adventure for me as well.
    Just thinking out loud...
    If the problem is that either the streaming server or TsReader are running out of data then it is directly due to the fact that the HD-PVR has stopped delivering data. We could increase the size of the buffer on the streaming server (with the implication that channel switching would take longer), however that seems like it isn't really solving the problem. In principle I don't really like the solution.

    What would solve the problem is to halt the channel change in the TV library until the proper PMT is received.

    Now, there are several issues with doing that.
    1. TsWriter will not event PMT when it is identical to the previous PMT in all but version number.
    2. It is difficult (if not impossible) to recognise the proper PMT when it arrives.

    The first point is really annoying but apparently necessary. (@morpheus_xx do you remember any details about this problem? Maybe we could loosen the checking?)
    http://mantis.team-mediaportal.com/view.php?id=2886

    Maybe it could be reworked so that TsWriter events the PMT but TV library (instead of TsWriter) checks whether the streams have changed.
    In the case of DVB/ATSC, if there is no stream change => don't do anything with the PMT.
    In the case of capture => *might* represent channel change.

    The second point: due to the first point and different device behaviours, one cannot easily count PMTs. One also can't know whether the audio should be AAC or AC3/DD... and this wouldn't always tell us whether the PMT represents a completed channel change either.

    No obvious solution here in my opinion.
     

    CanadianEh

    MP Donator
  • Premium Supporter
  • July 21, 2011
    130
    16
    Home Country
    United States of America United States of America
    I'm pretty sure I am now having this issue with MediaPortal 1.6 Pre-release, although the behavior is a little different than above. I am using the UNC paths for the remote client in the advanced settings, and when it freezes, the Pause-then-Play again doesn't do anything for me. In order to undo the freeze, I have to hit Stop, and then select the channel again in order for it to play.

    My config is using an HD-PVR with SP/DIF audio from a DirectTV receiver.

    If someone can specify which logs would be helpful on both the client and the server, I will capture them and pass them along. I'd really love to get this fixed if it's possible. The Dolby Digital sound is so much better than the stereo audio output :)[DOUBLEPOST=1387759364][/DOUBLEPOST]@cwchapma , what HD-PVR drivers are you using? I'm curious as to why you are able to use the UNC fileshares without issue, while I'm still seeing the freezing.

    Thanks!!
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Presumably you only experience this problem when playing live TV on remote clients, right?

    If someone can specify which logs would be helpful on both the client and the server, I will capture them and pass them along.
    All log files from both client and server are required.

    1. Before doing anything, make sure that TV Server log level is set to debug:
    http://wiki.team-mediaportal.com/1_.../TV-Server_Configuration/06_General#Log_Level

    2. Restart the TV service.

    3. Use the watchdog/debug tool with option 1 on the client to reproduce the problem and acquire the client log files:
    http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/16_Support/3_Forums/2_Log_Files

    4. Grab the server log files. If you don't have MediaPortal installed on the server you'll have to grab the TV Server logs manually:
    1. Open TV Server configuration.
    2. Click "open log directory" in the top left corner.
    3. Zip all the files you find in that folder.​

    Otherwise, use the watchdog [on the server] with option 3.

    5. Post/attach the two zip files from steps 3 and 4 here.

    Thanks,
    mm
     

    Users who are viewing this thread

    Top Bottom