TVE3 Threadsafe Using Reservation System. (2 Viewers)

elliottmc

Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    United Kingdom United Kingdom
    Country flag
    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.
     

    DJBlu

    Portal Pro
    August 14, 2007
    1,670
    813
    Llanelli
    United Kingdom United Kingdom
    Country flag
    Just looking at the code guys and there is no reservation for EPG, just Timeshifting and Recording.

    Is this an oversight?
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,447
    10,273
    France
    France France
    Country flag
    • Thread starter
    • Moderator
    • #15
    Euh Gibman can answer better but if i understand, in setuptv and then in user properties EPG Grabber can be set :)
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Denmark Denmark
    Country flag
    Euh Gibman can answer better but if i understand, in setuptv and then in user properties EPG Grabber can be set :)
    Disregard my post.

    I have found what I needed! :D
    EPG is using tickets just as well as normal timeshifting.

    Code:
    private bool TuneEPGgrabber(Channel channel, IChannel tuning, Card card, TvResult result)
        {
          try
          {
            _user.CardId = card.idCard;
            ITvCardHandler cardHandler;
            if (ServiceManager.Instance.InternalControllerService.CardCollection.TryGetValue(card.idCard, out cardHandler))
            {
              ICardTuneReservationTicket ticket = null;
              try
              {
                ICardReservation cardReservationImpl = new CardReservationTimeshifting();
                ticket = cardReservationImpl.RequestCardTuneReservation(cardHandler, tuning, _user);
     
                if (ticket != null)
                {
                  result = ServiceManager.Instance.InternalControllerService.Tune(ref _user, tuning, channel.idChannel,
                                                                                  ticket);
                  if (result == TvResult.Succeeded)
                  {
                    if (!_isRunning || false == ServiceManager.Instance.InternalControllerService.GrabEpg(this, card.idCard))
                    {
                      if (!_isRunning)
                        Log.Epg("Tuning finished but EpgGrabber no longer enabled");
                      ServiceManager.Instance.InternalControllerService.StopGrabbingEpg(_user);
                      _user.CardId = -1;
                      Log.Epg("Epg: card:{0} could not start dvbt grabbing", card.idCard);
                      return false;
                    }
                    _user.CardId = card.idCard;
                    return true;
                  }
                }
              }
              catch (Exception)
              {
                CardReservationHelper.CancelCardReservation((ITvCardHandler) cardHandler, ticket);
                throw;
              }
            }
            _user.CardId = -1;
            Log.Epg("Epg: card:{0} could not tune to channel:{1}", card.idCard, result.ToString());
            return false;
          }
          catch (Exception ex)
          {
            Log.Write(ex);
            throw;
          }
        }
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Denmark Denmark
    Country flag
    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:

    Pat Clark

    Portal Pro
    April 25, 2012
    264
    34
    Wisconsin
    United States of America United States of America
    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:

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

    OP Similar threads Forum Replies Date
    O General Merging various patches into TVE3 TV Engine 21
    toricred Using TMM, How to Stop Importer From Going to The Movie Database for Data General 1
    morpheus_xx [WiP] OnlineVideos: New browser based playback support using WebDriver, new Amazon siteutil MediaPortal 2 14
    toricred [solved] Configuring TV Server to use NAS General 5
    vvulture Using Windows 10 MediaPortal 1 Talk 8
    atlantic How to use Spotify inside Mediaportal? Listen Music 18
    Megane Too much RAM used (over 2 GB). General Support 18
    doskabouter 1.23.0 MatroskaTagInfo uses the wrong casing for tags Bugreports 27
    D how to disengage from one version of a plugin to use another Newcomers Forum 0
    D I just installed MP 1.23. Which version of Schedules Direct should I use, where do I obtain it from Newcomers Forum 6
    M Can i use my Vu+ Zero 4k Tuner for Mediaportal? General 0
    benicehavefun Using MePo TV Server 1.23 via MPExtended/WebMediaPortal as a Backend for Plex MPExtended 4
    G MP1 TV Server "failed to upgrade the database" using MS Sql Server Installation, configuration support 3
    1gkar Use Alternative Sites to Scrape Series Info My TVSeries 5
    T Can Emprex 3009ARF III MCE Remote Control be used to toggle Fullscreen/Windowed mode?? Remotes 7
    S [solved] Live TV subtitle issue if not using 100% font General 31
    N [Proposal] Make text input using remote control easier MediaPortal 2 4
    T Issues with MediaPortal not starting correctly using versions after 1.20 Final General Support 6
    erika jandova Using SD and MediaPortal 1 Newcomers Forum 4
    D Large xml database in My Movies Management. I remain unclear on use My Films as bridge to MP2.2 General 9
    N [solved] When MP2-Client is trying to register credentials, it uses the wrong machine name MediaPortal 2 7
    high [Help Me!] Atlassian Fisheye/Crucible still used? Team Lounge 8
    D [solved] HID remote for mp2 and w10 64 bit? using all tools: sony, cisco, homeworkx ng General 2
    Symphy Still being used? ASIO music player 0
    P no signal when scanning for channels using antenna and dual hd General Support 2
    Similar threads

























    Top Bottom