TVE3 Threadsafe Using Reservation System. | Page 2

Discussion in 'Area 51 - Testing Area' started by Sebastiii, May 11, 2012.

  1. elliottmc
    • Premium Supporter

    elliottmc Retired Team Member

    Joined:
    August 7, 2005
    Messages:
    14,927
    Likes Received:
    4,011
    Gender:
    Male
    Location:
    Cardiff, UK
    Ratings:
    +5,503 / 13
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    This has now been included in MediaPortal 1.3.0alpha, which will be released quite soon.



    There have been a couple of last-minute glitches which have delayed things, but we are getting there.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. DJBlu

    DJBlu Portal Pro

    Joined:
    August 14, 2007
    Messages:
    1,670
    Likes Received:
    789
    Location:
    Llanelli
    Ratings:
    +894 / 1
    Home Country:
    United Kingdom United Kingdom
  4. corvy
    • Premium Supporter

    corvy MP Donator

    Joined:
    January 3, 2007
    Messages:
    209
    Likes Received:
    19
    Gender:
    Male
    Occupation:
    Director for Customer Services, Proact IT Norway
    Location:
    Rykkinn, Akershus
    Ratings:
    +34 / 0
    Home Country:
    Norway Norway
    Grand! Looking 4ward 2 test :)
     
  5. DJBlu

    DJBlu Portal Pro

    Joined:
    August 14, 2007
    Messages:
    1,670
    Likes Received:
    789
    Location:
    Llanelli
    Ratings:
    +894 / 1
    Home Country:
    United Kingdom United Kingdom
    Just looking at the code guys and there is no reservation for EPG, just Timeshifting and Recording.

    Is this an oversight?
     
  6. Sebastiii
    • Team MediaPortal

    Sebastiii Development Group

    Joined:
    November 12, 2007
    Messages:
    16,270
    Likes Received:
    6,221
    Gender:
    Male
    Location:
    France
    Ratings:
    +10,229 / 9
    Home Country:
    France France
    Show System Specs
    Euh Gibman can answer better but if i understand, in setuptv and then in user properties EPG Grabber can be set :)
     
  7. DJBlu

    DJBlu Portal Pro

    Joined:
    August 14, 2007
    Messages:
    1,670
    Likes Received:
    789
    Location:
    Llanelli
    Ratings:
    +894 / 1
    Home Country:
    United Kingdom United Kingdom
    Disregard my post.

    I have found what I needed! :D
     
    • Like Like x 1
  8. 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
    EPG is using tickets just as well as normal timeshifting.

    Code (Text):
    1. private bool TuneEPGgrabber(Channel channel, IChannel tuning, Card card, TvResult result)
    2.     {
    3.       try
    4.       {
    5.         _user.CardId = card.idCard;
    6.         ITvCardHandler cardHandler;
    7.         if (ServiceManager.Instance.InternalControllerService.CardCollection.TryGetValue(card.idCard, out cardHandler))
    8.         {
    9.           ICardTuneReservationTicket ticket = null;
    10.           try
    11.           {
    12.             ICardReservation cardReservationImpl = new CardReservationTimeshifting();
    13.             ticket = cardReservationImpl.RequestCardTuneReservation(cardHandler, tuning, _user);
    14.  
    15.             if (ticket != null)
    16.             {
    17.               result = ServiceManager.Instance.InternalControllerService.Tune(ref _user, tuning, channel.idChannel,
    18.                                                                               ticket);
    19.               if (result == TvResult.Succeeded)
    20.               {
    21.                 if (!_isRunning || false == ServiceManager.Instance.InternalControllerService.GrabEpg(this, card.idCard))
    22.                 {
    23.                   if (!_isRunning)
    24.                     Log.Epg("Tuning finished but EpgGrabber no longer enabled");
    25.                   ServiceManager.Instance.InternalControllerService.StopGrabbingEpg(_user);
    26.                   _user.CardId = -1;
    27.                   Log.Epg("Epg: card:{0} could not start dvbt grabbing", card.idCard);
    28.                   return false;
    29.                 }
    30.                 _user.CardId = card.idCard;
    31.                 return true;
    32.               }
    33.             }
    34.           }
    35.           catch (Exception)
    36.           {
    37.             CardReservationHelper.CancelCardReservation((ITvCardHandler) cardHandler, ticket);
    38.             throw;
    39.           }
    40.         }
    41.         _user.CardId = -1;
    42.         Log.Epg("Epg: card:{0} could not tune to channel:{1}", card.idCard, result.ToString());
    43.         return false;
    44.       }
    45.       catch (Exception ex)
    46.       {
    47.         Log.Write(ex);
    48.         throw;
    49.       }
    50.     }
     
    • Like Like x 2
  9. 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
    regarding 'multiple tuningdetails on the same card' :
    https://forum.team-mediaportal.com/threads/no-cards-available.109338/page-5

    so summarize the problem.

    This is done when tuning a channel:

    1) fetch a list of carddetails from cardallocation
    2) request card reservations (tickets) for all those carddetails from (1)
    3) cancel superfluous tickets, eg. we want max. 2 tickets per timeshifting session.
    4) now iterate tickets, and tune each card until either succesfull or all cards exhausted.
    5) if all tickets are spent, then a new iteration will occur (see step#2) although it keeps track of already tried cards, and avoids those.

    This works fine as long as the list of carddetails (from step#1) does not have the same cardID multiple times.'
    and sadly this is the case with the bug mentioned.

    eg. we have 2 carddetails (for a channel with 2 tuningdetails on dvb-t).
    detail#1 (frequency 111111) with cardid=1
    detail#1 (frequency 222222) with cardid=1

    requesting a cardres. ticket for detail#1 works, now reserved.
    requesting a cardres. ticket for detail#2 fails, since card is already reserved.

    so it looks like it's not possible to request a bunch of tickets based on a list of carddetails containing the same cardId multiple times in one go.

    would an alternative be :
    1) fetch a list of carddetails from cardallocation
    2) iterate carddetails, and request 1 card reservation (ticket) per carddetail
    3) now tune each card until either succesfull or all cards exhausted.
    5) if all tickets are spent, then a new iteration will occur (see step#2) although it keeps track of already tried cards, and avoids those.

    /gibman
     
    Last edited: July 25, 2012
    • Like Like x 2
  10. Pat Clark

    Pat Clark Portal Pro

    Joined:
    April 25, 2012
    Messages:
    264
    Likes Received:
    24
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Wisconsin
    Ratings:
    +34 / 2
    Home Country:
    United States of America United States of America
    Show System Specs
    I thought I should mention that my hybrid cards show separate tuning details for each analog channel, but only one for each QAM channel. I have 3 hybrid cards, so in TV Server Config each analog channel shows 3 tuning details. (And I can't use 1.3.0 Alpha because of the no card available problem.)
     
    Last edited: July 30, 2012
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!