TBS: CI/CAM support and other improvements (2 Viewers)

jonm

Portal Pro
January 12, 2009
429
26
Wales
Home Country
Wales Wales
That is a bit crap. Shouldn't the driver "know" based on what we're asking it to tune to? Or am I missing something?
 

onelegend

MP Donator
  • Premium Supporter
  • July 16, 2010
    351
    42
    39
    Bournemouth
    Home Country
    United Kingdom United Kingdom
    Indeed, I did ask the question originally but had no mention of it in reply

    We know the card can tune both dvbs and dvbs2 fast atleast :p - need tbs to sort their code out so both can tune fast at same time
     

    DJBlu

    Portal Pro
    August 14, 2007
    1,670
    813
    Llanelli
    Home Country
    United Kingdom United Kingdom
    typedef struct _BDA_NBC_PARAMS
    {
    int rolloff;
    int pilot;
    int dvbtype;// 1 for dvbs 2 for dvbs2 0 for auto
    int fecrate;
    int modtype;
    } BDA_NBC_PARAMS, *PBDA_NBC_PARAMS;
    dvbtype default value is 0 ,if you lock DVBS2 TP,driver will lock DVBS first then lock DVBS2 ,so it will longer
    const GUID KSPROPSETID_BdaTunerExtensionProperties =
    {0xfaa8f3e5, 0x31d4, 0x4e41, {0x88, 0xef, 0xd9, 0xeb, 0x71, 0x6f, 0x6e, 0xc9}};
    typedef enum {
    KSPROPERTY_BDA_RESERVED = 0,
    KSPROPERTY_BDA_NBC_PARAMS = 10,
    KSPROPERTY_BDA_BLIND_SCAN = 11,
    KSPROPERTY_BDA_TBSACCESS = 21
    } KSPROPERTY_BDA_TUNER_EXTENSION;
    BDA_NBC_PARAMS DVBType;
    DVBType.dvbtype = type; 1 for dvbs 2 for dvbs2 0 for auto
    //Only need to set dvbtype other parameter do not need to set.
    if (m_pKsCtrl->Set(KSPROPSETID_BdaTunerExtensionProperties,
    KSPROPERTY_BDA_NBC_PARAMS,
    &DVBType,sizeof(DVBType),
    &DVBType, sizeof(DVBType)) == S_OK)
    {
    bRet = TRUE;
    }
    else
    {
    OutputDebugString("SetDVBType setInterface Failed");
    }

    Good News.

    We can set the DVB-S/S2 setting.

    I'll add it later and give it a whirl.
     

    DJBlu

    Portal Pro
    August 14, 2007
    1,670
    813
    Llanelli
    Home Country
    United Kingdom United Kingdom
    I have only tested this out on a 6984 and 6981 card.

    Works with 6981 not with 6984

    View attachment TVLibrary_fasterDVB-S2.zip

    You need the following driver too.

    6981 Drivers

    It gets the tune time to around 1 second from 3-3.5 seconds

    not lightning quick but faster than before.

    Just emailed to ask if they are updating their drivers to allow the rest of the TBS cards to have this feature. Will keep you posted.

    The following goes in Turbosight.cs

    Code:
    /// Turbosight.cs
    
        private enum BdaExtensionProperty
        {
          Reserved = 0,
          NBC_PARAMS = 10,     // Property for setting the DVB-S2 parameter
          BlindScan = 11,     // Property for accessing and controlling the hardware blind scan capabilities.
          TbsAccess = 21      // TBS property for enabling control of the common properties in the BdaExtensionCommand enum.
        }
    
        private struct BDA_NBC_PARAMS
        {
            public int rolloff;
            public int pilot;
            public int dvbtype;// 1 for dvbs 2 for dvbs2 0 for auto
            public int fecrate;
            public int modtype;
        }
    
        private const int TbsNBCParamsSize = 20;
    
       /// <summary>
        /// Sets the DVB-Type for TBS PCIe Card.
        /// </summary>
        /// <param name="reply">The reply message.</param>
        /// <returns><c>true</c> if a reply is successfully received, otherwise <c>false</c></returns>
        public void SetDVBS2(DVBSChannel channel)
        {
            //Set the Pilot
            Log.Log.Info("Turbosight: Set DVB-S2");
            if(channel.ModulationType != ModulationType.ModNbc8Psk && channel.ModulationType != ModulationType.ModNbcQpsk)
                return;
            int hr;
            KSPropertySupport supported;
            _propertySet.QuerySupported(BdaExtensionPropertySet, (int)BdaExtensionProperty.NBC_PARAMS,
                                        out supported);
            if ((supported & KSPropertySupport.Set) == KSPropertySupport.Set)
            {
                BDA_NBC_PARAMS DVBNBCParams = new BDA_NBC_PARAMS();
                DVBNBCParams.fecrate = (int)channel.InnerFecRate;
                DVBNBCParams.modtype = (int)channel.ModulationType;
                DVBNBCParams.pilot = (int)channel.Pilot;
                DVBNBCParams.rolloff = (int)channel.Rolloff;
                DVBNBCParams.dvbtype = 2; //DVB-S2
                Log.Log.Info("Turbosight: Set DVB-S2: {0}", DVBNBCParams.dvbtype);
                Marshal.StructureToPtr(DVBNBCParams, _generalBuffer, true);
                DVB_MMI.DumpBinary(_generalBuffer, 0, TbsNBCParamsSize);
    
                hr = _propertySet.Set(_propertySetGuid,(int)BdaExtensionProperty.NBC_PARAMS,
                  _generalBuffer, TbsNBCParamsSize,
                  _generalBuffer, TbsNBCParamsSize
                );
    
                if (hr != 0)
                {
                    Log.Log.Info("Turbosight: Set DVB-S2 returned {0}", hr, DsError.GetErrorText(hr));
                }
            }
           else
           {
                Log.Log.Info("Turbosight: Set DVB-S2 not supported");
           }
        }

    And call it in SendDiseqcCommand

    Code:
          SetDVBS2(channel); // Don't need to know the result of this.
          
          return (successDiseqc && successTone);
        }
     

    onelegend

    MP Donator
  • Premium Supporter
  • July 16, 2010
    351
    42
    39
    Bournemouth
    Home Country
    United Kingdom United Kingdom
    Thanks DjBlu!

    Will I get away with just running these files in your custom data grabber install or does it need the TBSV2 svn?

    Thanks again, been trying to get to bottom of the slow changes for ages!
     

    DJBlu

    Portal Pro
    August 14, 2007
    1,670
    813
    Llanelli
    Home Country
    United Kingdom United Kingdom
    Thanks DjBlu!

    Will I get away with just running these files in your custom data grabber install or does it need the TBSV2 svn?

    Thanks again, been trying to get to bottom of the slow changes for ages!

    You'll have to modify it yourself.

    The patch file is in the Custom Data Grabber thread.

    Then you will just have to add this code in the Turbosight.cs
     

    onelegend

    MP Donator
  • Premium Supporter
  • July 16, 2010
    351
    42
    39
    Bournemouth
    Home Country
    United Kingdom United Kingdom
    No prob DJBlu

    Thanks for the code - I attempted last night but to compile I need the Win SDK installed, I downloaded over night and in typical MS style - failed to install :D

    I only have 3g web access atm (yes it's painful) and it used up most of my months download allowance

    I'll download the full sdk iso when I'm next at my parents house.

    Thanks for your help
     

    DJBlu

    Portal Pro
    August 14, 2007
    1,670
    813
    Llanelli
    Home Country
    United Kingdom United Kingdom
    No prob DJBlu

    Thanks for the code - I attempted last night but to compile I need the Win SDK installed, I downloaded over night and in typical MS style - failed to install :D

    I only have 3g web access atm (yes it's painful) and it used up most of my months download allowance

    I'll download the full sdk iso when I'm next at my parents house.

    Thanks for your help

    Talk about laying it on thick! :D lol

    I'll have a look into it in the week if you can wait.
     

    onelegend

    MP Donator
  • Premium Supporter
  • July 16, 2010
    351
    42
    39
    Bournemouth
    Home Country
    United Kingdom United Kingdom
    Talk about laying it on thick! :D lol

    I'll have a look into it in the week if you can wait.

    Thanks - Yeh np waiting, Just sticking with your build for time being and put up with the slow changes :).

    Moved house and broadband supplier can only provide a 1mb connection (2 doors down gets 50! - Currently getting 3 mb on my 3g dongle), if I wait a couple of months I'll be connected on a nice 1gb fibre line though :D
     

    Users who are viewing this thread

    Top Bottom