[WiP] TV Server hardware-specific code refactoring (1 Viewer)

ColinT

Portal Pro
January 21, 2007
72
1
United Kingdom United Kingdom
Sorry about the delay, Ive been on holiday.
Test build apears to work now!, Logs attached. Not sure if the previous failure was finger trouble on my part, I was a bit rushed.
This time I disabled all other recievers, and only had 7 enabled.

I will try your latest build tomorrow, time willing:D

Regards Colin
 

mm1352000

Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    • Thread starter
    • Moderator
    • #32
    Great to hear from you again ColinT :)
    I confess I was getting a little concerned. Hope you enjoyed your holiday though...

    Your log looks perfect to me now. I can see that your card is being detected correctly and all 3 of the DiSEqC port switching commands that you use are working. I have to say that it is much easier to read the log with the other cards disabled ;)
    The previous build failure was *definitely not your fault*. You can blame that completely on me. I made a small mistake with that build that I corrected in the debug build. I've added that change to the "main" builds in the first post so absolutely feel free to try them. The build for 1.1.1 should work now too. I'd be interested to know if everything still works fine when you disable all the other cards. There shouldn't be a problem but it doesn't hurt to make sure.

    Oh, one other thing.

    I don't know if you still use analog TV but apparently the analog TV tuner on the BGT3595 doesn't work with MediaPortal. I'm trying to help out some other people with that over here. No solution yet, but I've found one cause and a bug in TV Server so I'm making good progress. Like I said, I don't know if you use analog TV or FM but I'd appreciate having another tester just to confirm that things work correctly. No pressure at all. Just thought you might possibly be interested...

    Ciao
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Denmark Denmark
    Country flag
    I just gave this patch a spin.

    It seems to work for my 3 dvb-s devices (4xlnb diseqc switches)-

    skystar2 (wdm)
    floppydtv
    hauppauge nova dvb-s2

    morpheus, as u know, did do some nice refactoring that I personally would love to see brought up to date.

    /gibman
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    • Thread starter
    • Moderator
    • #34
    Hi gibman

    Great to hear that the refactoring works for you :)
    I have had a really good look at morpheus_xx's branch. He has some fantastic ideas! I wasn't sure whether to throw away what I've done and update his code or to continue refactoring the existing code to integrate his ideas (reusing his code where possible). I'll see how I go but I'm hoping to have something new to test in the next 1-2 weeks...
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,487
    7,019
    Germany Germany
    Country flag
    AW: TV Server hardware-specific code refactoring

    one part that is not yet implemented in the branch is the custom graph building that is required for some CI:

    i.e. WinTV CI needs an additional filter, and DigitialDevices also.

    this means, if you continue there, you should also make changes to the graph building: i.e. when constructing the graph all providers should be checked, if they require additional filters and let them to the work.

    (doing this refactoring should also keep MD*PI in mind, it should be treated like any other ConditionalAccess provider!)
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    • Thread starter
    • Moderator
    • #36
    Yes, that will need to be done (I don't know anything about MD*** so I might need some help when I get to that point). I notice that you didn't get to fully integrate the DiSEqC_Helper class either. I want to be really careful with the DiSEqC interfaces/implementation to reuse code where possible but also allow room for future extensions such as Unicable...
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    • Thread starter
    • Moderator
    • #37
    Hi again everyone

    It's been a month since I posted the last version of this patch (so much for two weeks! ;)). Since then I have been working hard to integrate the ideas and code from morpheus_xxx's branch. There is now a new version (v5) of the patch for 1.1.0, 1.1.1, and SVN head attached to the first post in this thread. I have implemented support for providers that require filters to be added to the graph (ie. WinTV CI, DigitalDevices) and refactored the CI/CAM code. Although I am not quite finished - I still need to add morpheus_xxx's plugin loader - I think the code is now at the point where it can and *needs* to be tested.

    I'd really appreciate anyone that would be willing to take the time try the patch. FTA channels should work, but descrambling and DiSEqC functionality needs to be tested. In particular, I'd be really happy if anyone with DigitalDevices or WinTV CIs could try the patch (remember that support for DigitalDevices is only available in 1.2.0a so you need to use the SVN head patch).

    mm1352000

    p.s. I wanted to build a version for 1.2.0a but I couldn't find the tag revision number. I think the patch for SVN head should work with 1.2.0a installations...
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Denmark Denmark
    Country flag
    Im currently running SVN version of tvservice.

    using the stress test tool found on setupTV I realized that I did not have a 100% stable diseqc switching.

    atleast not on my hauppauge card (nova hd dvb-s2).

    I randomly get a "no signal" exception.

    If I do this quick and dirty hack, then all is working.
    stresstest have been running 80 tunings, and no one failed yet :)


    in method:
    public override bool LockedInOnSignal()

    Code:
    ....
    if (!isLocked)
            {
              ts = DateTime.Now - timeStart;
              Log.Log.WriteFile("dvb:  LockedInOnSignal waiting 20ms");
    
              if (System.IO.File.Exists("c:\\diseqc.txt"))
              {
                if (_previousChannel is DVBSChannel)
                {
                  bool diseqCsucceded = _conditionalAccess.SendDiseqcCommand(_parameters, (DVBSChannel)_previousChannel);
                }
              }
    
              System.Threading.Thread.Sleep(20);
            }
    _previousChannel is actually the current channel at this time in code.
    but the main thing is it seems do wonders to do an additional SendDiseqcCommand CMD for those card drivers.

    why is this even a problem ?

    do we call SendDiseqcCommand from the wrong place in code ?

    no idea how this fares on your patch.
    probably the same.

    /gibman
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    • Thread starter
    • Moderator
    • #39
    Hi gibman

    Thank you for the comment!
    There is currently a very bad (in my opinion) hack in the code to try and support DiSEqC switching on Hauppauge cards. What it does is to:

    1. Try send DiSEqC command normally (before graph is running).
    2. Run graph.
    If DiSEqC command failed:
    3. Don't check for lock.
    4. Stop the graph.
    5. Tune again.

    I am aware through experience with my card that some cards require the DiSEqC commands to be sent *after* the graph is running. This is exactly why I even started making this patch - to support DiSEqC switching on my card which was not working unless the command was sent after the graph was started. MediaPortal currently sends the command *before* the graph is running and most cards seem to work okay. In fact there are probably some cards that require the commands to be sent at that time. Maybe some of the Hauppauge cards are like mine?

    We could try to take out the hack and do the following (for all cards - more robust):
    1. Try send DiSEqC command normally (before graph is running).
    2. Run graph.
    3. Before checking for lock, resend the DiSEqC command if the first command failed.

    Very easy to implement for switch control from within the ConditionalAccess class after my refactoring :D
    Not so easy to implement for motor control. Do you have a dish motor?
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Denmark Denmark
    Country flag
    no motor here.

    Please take note of this: Even though I get an ok reply back (=0) from the driver when setting DiseqC, I often end up with "no lock" when tuning.

    easy to repro with stress test and 2 channels, one on each diseqc switch.

    So could we set the diseqC again after a failed lock as it seems we cant trust the return value from the driver, atleast not from my card?

    and yes, the work-around is ugly.

    /gibman

    Hi gibman

    Thank you for the comment!
    There is currently a very bad (in my opinion) hack in the code to try and support DiSEqC switching on Hauppauge cards. What it does is to:

    1. Try send DiSEqC command normally (before graph is running).
    2. Run graph.
    If DiSEqC command failed:
    3. Don't check for lock.
    4. Stop the graph.
    5. Tune again.

    I am aware through experience with my card that some cards require the DiSEqC commands to be sent *after* the graph is running. This is exactly why I even started making this patch - to support DiSEqC switching on my card which was not working unless the command was sent after the graph was started. MediaPortal currently sends the command *before* the graph is running and most cards seem to work okay. In fact there are probably some cards that require the commands to be sent at that time. Maybe some of the Hauppauge cards are like mine?

    We could try to take out the hack and do the following (for all cards - more robust):
    1. Try send DiSEqC command normally (before graph is running).
    2. Run graph.
    3. Before checking for lock, resend the DiSEqC command if the first command failed.

    Very easy to implement for switch control from within the ConditionalAccess class after my refactoring :D
    Not so easy to implement for motor control. Do you have a dish motor?
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    MrGrymReaper Hardware Accelerated Encoding of TV Server Watch / Listen Media 5
    J Clock speed vs multi-core CPU's Can MediaPortal benefit from multi core cpu's? General 0
    E [solved] TV-Server Configuration Missing TV-Server 9
    F MediaPortal 1.16 server crashing due to user error? General Support 5
    E TV-SERVER control TV-Server 3
    CanadianEh MP TV server rebuild with Colossus 2 - Kodi clients receive PMT error when playing videos recoreded by Colossus 2 TV-Server 1
    M 1.25.0 Tv Server Configuration Italian Dvb-t2 test channel preview error Television (MyTV frontend and TV-Server) 7
    M TV Server Preview Window is blank, sounds works Television (MyTV frontend and TV-Server) 3
    catalpa ...immer mal wird der Server abgekoppelt :( Allgemeines Support- und Diskussionsforum 0
    A Keine Verbindung mit Kodi auf Server Allgemeines Support- und Diskussionsforum 11
    CyberSimian Unhandled exception in TV Server TV-Server 0
    Grisu002 Failed to startup - TV Server funktioniert nicht Allgemeines Support- und Diskussionsforum 0
    ajs [WiP] 5030: Add UHD Thumb size to TV Server MediaPortal 1 0
    toricred [solved] Configuring TV Server to use NAS General 5
    T Client / Server slow channel-to-channel change (zapping) General Support 1
    T Server / client channel logo location Installation, configuration support 6
    framug [solved] Some changes/fix in MP1 configuration client and server Submit: code patches (MediaPortal/TV-Server/etc.) 14
    S TV-Server MP1 - Automatic search doesn't work Installation, configuration support 2
    M TV Server can't tune to some DVB-S multiplexes while other software can General 0
    J TV Server setup question Newcomers Forum 0
    D [solved] Changed username in Win10, now TV Server config crashes on fresh install Installation, configuration support 1
    I [solved] Connection to TV Server MySQL General Support 8
    mrmojo666 [Tv Server Plugin ]Direct Show Video Control Plugin 0.0.0.1 for Hauppauge PVR cards MediaPortal 1 Plugins 0
    F After resume, TV Server connection screen is shown General Support 4
    R TV server crash with WintTV quadHD General 0
    Similar threads

























    Top Bottom