UnSupported tryout for NoVideoAudio & Scrambled errors. (1 Viewer)

te3hpurp

Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    I've been looking and testing and testing these annoying NoVideoAudio & Channel is scrambled
    that are popped every now or then. There is also some wreid hangs after channel change,
    when one must manually use skip button to skip to the end of timeshifting before live tv starts
    again. these problems are related to the communication between TsWriter filter and Timeshifter.cs codeblock.

    When TimeShifter.cs starts to wait for audio video pids in line 587 for radio and for tv in line 607,
    things too often starts to go wrong. This is mainly because, events are not triggered, even when
    tswriter filter sends them, they never arrive to TimeShifter.cs codeblock. very quick&dirty hack is to comment out
    this waiting part and manually reset these events. For me it works. i made this small change and tested it with stress tesing by doing 600 channell changes and i got picture every time, with no errors. It should not affect for detecting scrambled channels, but it's not yet tested. it reduced average zapping time close to 1 second.
    testing was done with FTA channels.

    Of course In real releases this should be fixed by more sophisticated way. Shoud there be for example a blocking direct function call to filter through interface or what ?, i don't know, but current solution is not performing wery well.

    // changed in TimeShifter.cs
    //if (isRadio)
    //{
    // Log.Write("card: WaitForTimeShiftFile - waiting _eventAudio");
    // // wait for audio PID to be seen
    // if (_eventAudio.WaitOne(waitForEvent, true))
    // {
    // // start of the video & audio is seen
    // Log.Write("card: WaitForTimeShiftFile - start of audio is seen");
    // _eventVideo.Reset();
    // _eventAudio.Reset();

    // // give some breathing room for TsReader
    // Thread.Sleep(200);
    // return true;
    // }
    //}
    //else
    //{
    Log.Write("card: WaitForTimeShiftFile - waiting _eventAudio & _eventVideo");
    // block until video & audio PIDs are seen or the timeout is reached
    //if (_eventAudio.WaitOne(waitForEvent, true))
    //{
    // _eventAudio.Reset();
    // if (_eventVideo.WaitOne(waitForEvent, true))
    // {
    // // start of the video & audio is seen
    // Log.Write("card: WaitForTimeShiftFile - start of the video & audio is seen");
    // _eventVideo.Reset();

    // // give some breathing room for TsReader
    // Thread.Sleep(200);
    // return true;
    // }
    //}
    _eventAudio.Reset();
    _eventVideo.Reset();
    //}

    added:
    return true; // a teh end of method..... :-(
    regs,
    te3hpurp
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    Seems like a very bad idea.

    How sure are u when u claim that "tswriter filter sends the events to tve3, but are not caught".

    Why not send us the logs generated when a problem occurs. Looking at tswriter.log should shed some light on what happens.

    /gibman
     

    te3hpurp

    Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    Okay Here is some logs.

    I tried to start timeshifting with 10 times from tester.
    First and last attempt failed.

    As you can see from TV.log forst attempt started at: 13:41:24.366319 and waiting for audio & video events started
    at: 13:41:26.647584 and waiting stopped(5 s timeout) at: 13:41:31.647616.

    in same time from tswriter log we see that at:13:41:26.538 timeshiting file was created.
    and notification for video was sent in "13:41:26.600 Recorder: TIMESHIFT start of video detected"
    and for audio in: "13:41:26.616 Recorder: TIMESHIFT start of audio detected". So basically this was my point. :)
    line in tswriter.ax code for "start of audio detected" is 967. there are two possible reasons. Managed/unmanaged code missuse: Garbage collector has killed m_pVideoAudioObserver, so that tswriter can't see it anymore, or then there is some other problem that prevents event to be launched.

    regs,
    te3hpurp
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    thx.

    look at;

    private void AudioVideoEventHandler(PidType pidType)
    {
    Log.Info("audioVideoEventHandler {0}", pidType);
    // we are only interested in video and audio PIDs
    if( pidType == PidType.Audio )
    {
    _eventAudio.Set();
    }

    if (pidType == PidType.Video)
    {
    _eventVideo.Set();
    }
    }


    it seems like only the audio event seen event is being caught by c# code.

    are u able to compile the c++ filters ?

    in tswriter.cpp

    STDMETHODIMP CMpTs::confused:etVideoAudioObserver(int handle, IVideoAudioObserver* callback)
    {
    CTsChannel* pChannel=GetTsChannel(handle);
    if (pChannel==NULL) return S_FALSE;
    pChannel->m_pTimeShifting->SetVideoAudioObserver(callback);
    return S_OK;
    }

    It seems like the
    "pChannel->m_pTimeShifting->SetVideoAudioObserver(callback);"
    comes too late, since the first video PID has already been detected.

    I can see this by looking at tswriter.log

    13-10-2008 13:41:55.335 Recorder: TIMESHIFT start of video detected
    13-10-2008 13:41:55.350 Recorder: TIMESHIFT SetVideoAudioObserver observer ok
    13-10-2008 13:41:55.397 Recorder: TIMESHIFT start of audio detected

    so the video is detected but the videoaudioobserver is still not connected, so no events to c# code.

    then the videoaudioobserver is connected.
    and audio is detected and c# is notified.






    /gibman
     

    te3hpurp

    Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    I'll try that in late night.... Just to inform: Yes i can compile DS filters.
    Sorry i should have noticed that observer setting too late, by myself :-(. It was first time for
    looking that code.

    regs,
    tehpurp
     

    te3hpurp

    Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    It worked.

    :D

    Although tv service crashes without a trace sometimes,
    and i haven't been able to catch any log that can point
    to right direction.

    But I'll get back to it

    regs,
    te3hpurp
     

    Users who are viewing this thread

    Top Bottom