[WiP] - TV Server hardware-specific code refactoring | Page 5

Discussion in 'Submit: code patches (MediaPortal/TV-Server/etc.)' started by mm1352000, October 2, 2010.

  1. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Okay, understood. Why not resend the DiSEqC command after waiting 1-2 seconds for lock?

    The new algorithm could be:

    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.
    4. If lock is not aquired after x seconds in LockedInOnSignal() then resend the DiSEqC command again.

    Thoughts?



    [Edit: By the way, the reason I asked about the motor is because of this issue...]
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. gibman
    • Premium Supporter

    gibman Retired Team Member

    Joined:
    October 4, 2006
    Messages:
    2,998
    Likes Received:
    1,321
    Occupation:
    Developer
    Location:
    Aarhus
    Ratings:
    +1,372 / 0
    Home Country:
    Denmark Denmark
    hi!

    1,2, and 3 seems ok.
    but waiting too long in i step 4 (LockedInOnSignal) and it could cause an unnecessary delay - so resending the command ASAP would be good.

    I guess this can all defined in the diseqc provider class or similar that u have for each card ?

    I have no motor setup. not sure anyone in the team has btw.

    /gibman
     
  4. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    I fully agree. The problem is how to detect as early as possible that the DiSEqC command needs to be resent. In your specific case (Hauppauge), at each step in the proposed algorithm:

    1. Send DiSEqC command: the provider returns success.
    2. Run graph: still okay.
    3. Resend: assumed not required because the provider returned success.

    It is impossible to detect that the command failed to be sent or the switch didn't change until you find that you can't lock. Perhaps we need to be more proactive? A better algorithm (???):

    1. Try send DiSEqC command normally (before graph is running).
    2. Run graph.
    3. Before checking for lock, resend the DiSEqC command if the provider (for example, Hauppauge) often fails to send the command properly. This can be customised to each provider.
    4. Resend the DiSEqC command every 2 seconds during LockedInOnSignal().

    The only concern I would have about this 2nd algorithm is that some hardware/drivers might not handle this. I don't know of any cards like that but there are bound to be some out there.

    Also, resending a DiSEqC command can take quite a lot of time. According to the standard you have to wait 100ms after sending each command. That is on top of the time it takes for the driver to send the command. It adds up pretty quickly. Also, what happens when someone (probably me ;) ) comes along and extends DiSEqC support to cascaded switches/motors?

    The providers each have an OnRunGraph() callback so it is easy to resend the DiSEqC command after the graph has started. Anything that needs to be done while checking for lock (LockedInOnSignal()) would have to be done for all providers in TvCardDvbBase/TvCardDVBS.

    It should definitely be possible to add an optional interface to hardware providers that allows them to specify their lock detection behaviour (perhaps as an extension to the custom tuning interface?). For example, for some cards, signal quality > 0 might indicate that the card is locked. If you add such an interface then it would be possible to define custom DiSEqC behaviour for the LockedInOnSignal() function. I'd much rather leave that until after the main refactoring is complete and confirmed as stable. There is already quite a high risk involved in this patch...

    Okay - thanks for mentioning that.
     
  5. MaxT
    • Premium Supporter

    MaxT MP Donator

    Joined:
    December 9, 2009
    Messages:
    112
    Likes Received:
    13
    Ratings:
    +13 / 0
    Home Country:
    Russian Federation Russian Federation
    Hi mm1352000!

    I reply here to your post in MP1 https://forum.team-mediaportal.com/television-mytv-frontend-tv-server-90/there-option-retune-tuned-channel-errors-76465/index6.html#post684710. I tried the patch with my MP 1.2a setup, but unfortunately it pops an error for TV Library and TV Library Interfaces :( (for sure before trying it, I restored from backup files overwritten by your V6 from that thread). I tried TvLibrary[v5][SVN_HEAD_26867].zip

    Are there any chanced to have MP 1.2a version of this patch? or should I better try with older MP version?

    Regards,

    MaxT
     
  6. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Absolutely - you can have a version for 1.2.0a :)
    You can find the DLLs and patch in the first post as usual.
     
  7. MaxT
    • Premium Supporter

    MaxT MP Donator

    Joined:
    December 9, 2009
    Messages:
    112
    Likes Received:
    13
    Ratings:
    +13 / 0
    Home Country:
    Russian Federation Russian Federation
    Hi mm1352000!

    Tested on MP 1.2a and Twinhan support does work! However, as expected can't tune to another sat from a first tune attempt.

    Please let me know if you need more testing from my side.

    BR

    MaxT
     
    • Like Like x 1
  8. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Great, and thank you so much for testing! :)
    Only one other thing - do you mind posting your tv.log so I can double check that everything looks correct.

    Thank you *very* much once again for your time :D
     
  9. MaxT
    • Premium Supporter

    MaxT MP Donator

    Joined:
    December 9, 2009
    Messages:
    112
    Likes Received:
    13
    Ratings:
    +13 / 0
    Home Country:
    Russian Federation Russian Federation
    Hi again mm1352000!

    Here are the logs. FTAs works fine, but not scrambled ones while using MD*** :( Then I just restored from the backup and MD*** is working. May be there are some settings there which I do not know and could try out?

    Regards,

    MaxT
     
  10. ColinT

    ColinT Portal Pro

    Joined:
    January 21, 2007
    Messages:
    72
    Likes Received:
    1
    Ratings:
    +1 / 0
    Home Country:
    United Kingdom United Kingdom
    As 1.1.2 is now out, is the 1.1.2a patch usable on this latest release? If not can you do a new one.
    I am working well on 1.1.0 with the patch (no more card problems, but some of the 1.1.2 fixes are worth having

    BTW I see the thread is WIP now. Do you think you can get it absorbed as full WP? I would think it would be useful for many, but I was worried the the extent of the change were such that they wouldnt risk it.

    Keep up the good work and :D for this lifesave forme.

    ColinT
     
  11. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    Hi ColinT

    No, definitely *don't* use the 1.2.0a patch with 1.1.2. It won't work. I can do a patch for 1.1.2 - will post it tonight after I get home from work (in 8 hours or so). It will of course include all the new refactoring I have done as well as the BGT3595 DiSEqC support. It would be difficult to separate that out now. Please report any errors you encounter...

    In response to your other comments: what does "WP" stand for? I can tell you that this patch won't be in 1.2.0. It just isn't ready. 1.3.0 is an outside chance (??? - not sure about the general feeling of the rest of the team), but I think the changes are so radical that they may realistically only be accepted for MP 2. Don't worry too much about that. I'll be providing support for you whether this patch makes it into SVN in a few months or a few years (let's hope it doesn't take that long!!!). Remember that my cards require this patch to work too :D.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!