Hauppauge Driver PropertySets
Custom Tuning
Version: 1.6
Support
This document is provided for informational purposes only and is not supported by Hauppauge Technical Services Department.
The following document is specific to driver versions 2.117.24199 or later.
The document assumes that the reader is already familiar with the DiSEqC specifications found at http://www.eutelsat.com/satellites/4_5_5.html
Structures and Enums
const GUID KSPROPSETID_BdaTunerExtensionProperties =
{0xfaa8f3e5, 0x31d4, 0x4e41, {0x88, 0xef, 0x00, 0xa0, 0xc9, 0xf2, 0x1f, 0xc7}};
typedef enum
{
BDA_TUNER_NODE = 0,
BDA_DEMODULATOR_NODE
}BDA_NODES;
typedef enum
{
KSPROPERTY_BDA_DISEQC = 0,
KSPROPERTY_BDA_PILOT = 0x20,
KSPROPERTY_BDA_ROLL_OFF = 0x21
} KSPROPERTY_BDA_TUNER_EXTENSION;
typedef enum DiseqcVer
{
DISEQC_VER_1X=1,
DISEQC_VER_2X,
ECHOSTAR_LEGACY, // (not supported)
DISEQC_VER_UNDEF=0 // undefined (results in an error)
} DISEQC_VER;
typedef enum RxMode
{
RXMODE_INTERROGATION=1, // Expecting multiple devices attached
RXMODE_QUICKREPLY, // Expecting 1 rx (rx is suspended after 1st rx received)
RXMODE_NOREPLY, // Expecting to receive no Rx message(s)
RXMODE_DEFAULT=0 // use current register setting
} RXMODE;
const BYTE DISEQC_TX_BUFFER_SIZE = 150; // 3 bytes per message * 50 messages
const BYTE DISEQC_RX_BUFFER_SIZE = 8; // reply fifo size, do not increase
typedef struct _DISEQC_MESSAGE_PARAMS
{
UCHAR uc_diseqc_send_message[DISEQC_TX_BUFFER_SIZE+1];
UCHAR uc_diseqc_receive_message[DISEQC_RX_BUFFER_SIZE+1];
ULONG ul_diseqc_send_message_length;
ULONG ul_diseqc_receive_message_length;
ULONG ul_amplitude_attenuation;
BOOL b_tone_burst_modulated;
DISEQC_VER diseqc_version;
RXMODE receive_mode;
BOOL b_last_message;
} DISEQC_MESSAGE_PARAMS, *PDISEQC_MESSAGE_PARAMS;
typedef enum
{
TONE_BURST_UNMODULATED = 0,
TONE_BURST_MODULATED
} TONE_BURST_MODULATION_TYPE;
typedef enum Roll_Off {
HCW_ROLL_OFF_NOT_SET = -1,
HCW_ROLL_OFF_NOT_DEFINED = 0,
HCW_ROLL_OFF_20 = 1, // .20 Roll Off (DVB-S2 Only)
HCW_ROLL_OFF_25, // .25 Roll Off (DVB-S2 Only)
HCW_ROLL_OFF_35, // .35 Roll Off (DVB-S2 Only)
HCW_ROLL_OFF_MAX,
} Roll_Off;
typedef enum Pilot {
HCW_PILOT_NOT_SET = -1,
HCW_PILOT_NOT_DEFINED = 0,
HCW_PILOT_OFF = 1, // Pilot Off (DVB-S2 Only)
HCW_PILOT_ON, // Pilot On (DVB-S2 Only)
HCW_PILOT_MAX,
} Pilot;
DiSEqC
Programming example
DISEQC_MESSAGE_PARAMS DiSEqCMessageParams;
CComPtr <IKsPropertySet> PropSet;
DWORD type_support = 0;
KSP_NODE instance_data;
// Setup a command. Check the DiSEqC for the correct values.
DiSEqCMessageParams_polarity.uc_diseqc_send_message[0] = 0xe0;
DiSEqCMessageParams_polarity.uc_diseqc_send_message[1] = 0x10;
DiSEqCMessageParams_polarity.uc_diseqc_send_message[2] = 0x38;
DiSEqCMessageParams_polarity.uc_diseqc_send_message[3] = 0xf0;
DiSEqCMessageParams_polarity.ul_diseqc_send_message_length = 4;
DiSEqCMessageParams_polarity.ul_diseqc_receive_message_length = 0;
DiSEqCMessageParams_polarity.ul_amplitude_attenuation = 3;
DiSEqCMessageParams_polarity.b_tone_burst_modulated = TRUE;
DiSEqCMessageParams_polarity.diseqc_version = DISEQC_VER_1X;
DiSEqCMessageParams_polarity.receive_mode = RXMODE_NOREPLY;
DiSEqCMessageParams_polarity.b_last_message = TRUE;
// DiSEqC access is made through the “Input0” pin on the DirectShow
// “Hauppauge WinTV 88x DVB-S Tuner/Demod” tuner filter.
// You will need to write a function to find the correct pin depending on
// your specific needs.
IPin *pTunerPin = FindTheTunerPin();
// Get the generic property set interface from the pin
HRESULT hr = pTunerPin->QueryInterface(
IID_IKsPropertySet,
reinterpret_cast<void**>(&PropSet)
);
// Check to see that the Hauppauge PropertySet interface is supported
hr = PropSet->QuerySupported(
KSPROPSETID_BdaTunerExtensionProperties,
KSPROPERTY_BDA_DISEQC,
&type_support);
// Send the previously prepared message to the driver
hr = PropSet->Set(
KSPROPSETID_BdaTunerExtensionProperties,
KSPROPERTY_BDA_DISEQC,
&instance_data,
sizeof(instance_data),
&DiSEqCMessageParams,
sizeof(DISEQC_MESSAGE_PARAMS)
);
// Now release any interfaces etc.
// That’s it!
Driver Extensions for S2 Tuning
Set Pilot Mode
Pilot p = HCW_PILOT_OFF;
IPin *pTunerPin = FindTheTunerPin();
// Get the generic property set interface from the pin
HRESULT hr = pTunerPin->QueryInterface(
IID_IKsPropertySet,
reinterpret_cast<void**>(&PropSet)
);
// Check to see that the Hauppauge PropertySet interface is supported
hr = PropSet->QuerySupported(
KSPROPSETID_BdaTunerExtensionProperties,
KSPROPERTY_BDA_PILOT,
&type_support);
// Send the pilot setting to the driver
hr = PropSet->Set(
KSPROPSETID_BdaTunerExtensionProperties,
KSPROPERTY_BDA_PILOT,
&instance_data,
sizeof(instance_data),
(ULONG)&p,
sizeof(ULONG)
);
Roll Off Mode
Roll_Off r = HCW_ROLL_OFF_35;
IPin *pTunerPin = FindTheTunerPin();
// Get the generic property set interface from the pin
HRESULT hr = pTunerPin->QueryInterface(
IID_IKsPropertySet,
reinterpret_cast<void**>(&PropSet)
);
// Check to see that the Hauppauge PropertySet interface is supported
hr = PropSet->QuerySupported(
KSPROPSETID_BdaTunerExtensionProperties,
KSPROPERTY_BDA_ROLL_OFF,
&type_support);
// Send the rolloff setting to the driver
hr = PropSet->Set(
KSPROPSETID_BdaTunerExtensionProperties,
KSPROPERTY_BDA_ROLL_OFF,
&instance_data,
sizeof(instance_data),
(ULONG)&r,
sizeof(ULONG)
);
Tuning DVB-S2 (Modulation / FEC settings)
DVB-S2 currently requires the setting of the inner FEC and modulation parameters correctly, they are:
// There are added constants to support KSPROPERTY_BDA_INNER_FEC_RATE extensions
// for DVB-S2
#define HCW_BCC_RATE_1_4 (BDA_BCC_RATE_7_8+1)
#define HCW_BCC_RATE_1_3 (HCW_BCC_RATE_1_4+1)
#define HCW_BCC_RATE_2_5 (HCW_BCC_RATE_1_3+1)
#define HCW_BCC_RATE_6_7 (HCW_BCC_RATE_2_5+1)
#define HCW_BCC_RATE_8_9 (HCW_BCC_RATE_6_7+1)
#define HCW_BCC_RATE_9_10 (HCW_BCC_RATE_8_9+1)
#define HCW_BCC_RATE_MAX (HCW_BCC_RATE_9_10+1)
// These are added constants to support KSPROPERTY_BDA_MODULATION_TYPE extensions for
// DVB-S2
#define HCW_MOD_8PSK (BDA_MOD_ANALOG_FREQUENCY+1)
#define HCW_MOD_RF (HCW_MOD_8PSK+1) // analog TV (Video standards such as
// NTSC/PAL/SECAM specified in
// IAnalogLocator VideoStandard property)
#define HCW_MOD_16APSK (HCW_MOD_RF+1) // DVB-S2 modulation 16-Level APSK
// not supported on Chesterfield2)
#define HCW_MOD_32APSK (HCW_MOD_16APSK+1) // DVB-S2 modulation 32-Level APSK
// not supported on Chesterfield2)
#define HCW_MOD_NBC_QPSK (HCW_MOD_32APSK+1) // DVB-S2 Non-Backwards Compatible QPSK
#define HCW_MOD_NBC_8PSK (HCW_MOD_NBC_QPSK+1) // DVB-S2 Non-Backwards Compatible 8PSK
#define HCW_MOD_DIRECTV (HCW_MOD_NBC_8PSK+1) // DIRECTV DSS
#define HCW_MOD_MAX (HCW_MOD_DIRECTV+1)
Driver Extensions for QAM/ATSC Tuning
The Hauppauge drivers can be tuned for ATSC using the normal DirectShow ATSC tuning techniques. The Microsoft SDK has no concept of QAM tuning that is standard on XP and Vista. To overcome this, the following driver PropertySet can be used to force modulation on either XP or Vista, and the driver will obey it.
Put_Modulation()
/* See the DirectX SDK for a description of ModulationType */
/* Set the modulation type to QAM256 to enable autodetect of QAM64 or 256.*/
/* Valid arguments are:
* BDA_MOD_256QAM
* BDA_MOD_64QAM
* BDA_MOD_8VSB
*/
ModulationType modType = BDA_MOD_256QAM;
IPin *pTunerPin = FindTheTunerPin();
// Get the generic property set interface from the pin
HRESULT hr = pTunerPin->QueryInterface(
IID_IKsPropertySet,
reinterpret_cast<void**>(&PropSet)
);
// Check to see that the PropertySet interface is supported
hr = PropSet->QuerySupported(
KSPROPSETID_BdaDigitalDemodulator,
KSPROPERTY_BDA_MODULATION_TYPE,
&type_support);
// Send the modulation setting to the driver
hr = PropSet->Set(
KSPROPSETID_ BdaDigitalDemodulator,
KSPROPERTY_ BDA_MODULATION_TYPE,
&instance_data,
sizeof(instance_data),
(ULONG)& modType,
sizeof(ULONG)
);
Tuning Order
Some of the tuning parameters have to be set in a specific order. Performing these tuning calls out of order can cause general tuning problems or unexpected driver behavior.
The driver can ignore specific property calls if the filter is STOPPED, ensure your filter is in the PAUSE or RUN state before attempting a tune request.
The following order is suggested:
1. Submit any pre-tuning demodulator or tuner related properties including, SetPilot, SetRollOn, PutModulation.
2. Now submit your traditional BDA tunerequest to the driver
3. Submit any DiSEqC requirements
If the filter or graph is subsequently stopped, you have to resubmit again to guarantee the correct settings are re-applied.