;==============================================================================
; Elgato Video Capture
; Driver Install Script (64 bit)
; Copyright (c) 2010, Elgato Systems GmbH
;------------------------------------------------------------------------------        
; History:
;------------------------------------------------------------------------------
; 18-Aug-10 MS 1st Driver Version
; 18-Mar-11 MS Version for the ElgatoVideoCapture Software
; 02-Apr-13 MS Set Default Video Standard to NTSC
; 07-May_14 MS Fix "Tremble" issue
; 22-Oct-14 MS new driver
;------------------------------------------------------------------------------
; Notes:
;------------------------------------------------------------------------------
;
;==============================================================================

[Version]
signature="$CHICAGO$"
Class=Media
ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318}
Provider=%Provider%
DriverVer=09/22/2018,7.07.0.127
CatalogFile=Elgato_Video_Capture_2010.cat


[SourceDisksNames]
1=%DiskName%,,

[SourceDisksFiles]
elvidcap.sys=1
cpnotify.ax=1
cxtvrate.dll=1
y8cnvt.ax=1
merlind.bin=1
CxPolaris.ax=1

[DestinationDirs]
EyeTV.CopySys   = 12                  ; driver files
EyeTV.CopyDll32 = 10,SysWow64         ; 32-bit DLLs

[Manufacturer]
%Provider% = Elgato, NTamd64

[Elgato.NTamd64]
%EyeTV.DeviceDesc% = EyeTV,USB\VID_0FD9&PID_0037&MI_01     
%EyeTV_CIR.DeviceDesc%    = EyeTV.CIR,USB\VID_0FD9&PID_0037&MI_00
;prototyp ID's
;%EyeTV.DeviceDesc% 	  = EyeTV,USB\VID_1F4D&PID_0102&MI_01 
;%EyeTV_CIR.DeviceDesc%    = EyeTV.CIR,USB\VID_1F4D&PID_0102&MI_00


[EyeTV.CopySys]
elvidcap.sys


[EyeTV.CopyDll32]
cpnotify.ax
cxtvrate.dll
y8cnvt.ax
CxPolaris.ax


[DSFilters.RegDLL]
11,,cpnotify.ax,1
11,,cxtvrate.dll,1
11,,y8cnvt.ax,1
11,,CxPolaris.ax,1

[EyeTV.CIR.NTamd64]



[EyeTV.NTamd64]
Include=    ks.inf, kscaptur.inf,ksfilter.inf, wdmaudio.inf, bda.inf
Needs=      KS.Registration, KSCAPTUR.Registration.NT,MSPCLOCK.Installation, WDMAUDIO.Registration, BDA.Registration, bda.Installation.NT
AddReg=     EyeTV.AddReg,EyeTVVID.AddReg, EyeTV.AddReg, EyeTVXBAR.AddReg
CopyFiles=  EyeTV.CopySys, EyeTV.CopyDll32
RegisterDlls=DSFilters.RegDLL  

;===============================================================
;                R e g i s t r y
;===============================================================

[EyeTVVID.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,elvidcap.sys
HKR,,OkToHibernate,3,01
; Disable driver page out
HKR,,PageOutWhenUnopened,3,0
;HKR,,PageOutWhenUnopened,3,01
HKR,,DontSuspendIfStreamsAreRunning,3,01
HKLM,%MediaCategories%\%POLARIS_GUID.PINNAME_ANALOG_AUDIO_IN%,Name,,%Pin.p2AnalogAudioIn%
HKLM,%MediaCategories%\%POLARIS_GUID.PINNAME_AUDIO_OUT%,Name,,%PinName.AnalogAudioOut%

HKLM,%MediaInterfaces%\{0A7AF963-6805-4f99-B284-29B680975542},,,"Copy Protect Notification Filter"
HKLM,%MediaInterfaces%\{0A7AF963-6805-4f99-B284-29B680975542},IID,1,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

;Add the property pages
;
HKCR,CLSID\%GUID.DriverVersion_Properties%\InprocServer32,,,Cxpolaris.ax
HKCR,CLSID\%GUID.DriverVersion_Properties%\InprocServer32,ThreadingModel,,Both
HKLM,%MediaSets%\%GUID.POLARIS_VERSION_INFORMATION_PROPERTIES%\PropertyPages\%GUID.DriverVersion_Properties%,,,

;Wave in audio device registration
HKR,Drivers,SubClasses,,"wave"
HKR,Drivers\wave\wdmaud.drv, Driver,,wdmaud.drv
HKR,Drivers\wave\wdmaud.drv,Description,,%PolarisAudioFriendlyName%

;Copy protection method enforced by driver
HKR,"DriverData","CpMethod",0x00010001, 0xFE, 0x00, 0x00, 0x00


[EyeTVXBAR.AddReg]
;-------------------------------------------------------------------
; Crossbar AddReg sections
;
;---Crossbar registry values---
;
; Note: For each pin on the crossbar, specify the following:
; (1) Pin type
;     0 - SVIDEO
;     1 - Tuner
;     2 - Composite
;     3 - audio tuner in
;     4 - audio line in
;     7 - YUV
; (2) InputMux - input mux to use for the selected pin
; (3) RelatedPinIndex
;-------------------------------------------------------------------


;---Crossbar registry values---
;Pin 0 - Tuner In
; Input Mux       : VIN2_1 for Tuner input from Nxp18271
;HKR,"DriverData\XBarPin0","PinType",0x00010001, 0x01,0x00,0x00,0x00
;HKR,"DriverData\XBarPin0","InputMux",0x00010001, 0x01,0x00,0x00,0x00
;HKR,"DriverData\XBarPin0","RelatedPinIndex",0x00010001, 0x03,0x00,0x00,0x00

;Pin 1 - Composite in
; Input Mux       : VIN2_1 for Composite
HKR,"DriverData\XBarPin0","PinType",0x00010001, 0x02,0x00,0x00,0x00
HKR,"DriverData\XBarPin0","InputMux",0x00010001, 0x02,0x00,0x00,0x00
HKR,"DriverData\XBarPin0","RelatedPinIndex",0x00010001, 0x02,0x00,0x00,0x00

;Pin 2 - S-Video in
; Input Mux       : VIN1_1 for Luma, VIN1_2 for Chroma
HKR,"DriverData\XBarPin1","PinType",0x00010001, 0x00,0x00,0x00,0x00
HKR,"DriverData\XBarPin1","InputMux",0x00010001, 0x01,0x03,0x00,0x00
HKR,"DriverData\XBarPin1","RelatedPinIndex",0x00010001, 0x02,0x00,0x00,0x00

;Pin 3 - Tuner Audio
;HKR,"DriverData\XBarPin3","PinType",0x00010001, 0x03,0x00,0x00,0x00
;HKR,"DriverData\XBarPin3","InputMux",0x00010001, 0x00,0x00,0x00,0x00
;HKR,"DriverData\XBarPin3","RelatedPinIndex",0x00010001, 0x00,0x00,0x00,0x00

;Pin 4 - Audio Line in
HKR,"DriverData\XBarPin2","PinType",0x00010001, 0x04,0x00,0x00,0x00
HKR,"DriverData\XBarPin2","InputMux",0x00010001, 0x00,0x00,0x00,0x00
HKR,"DriverData\XBarPin2","RelatedPinIndex",0x00010001, 0x00,0x00,0x00,0x00
HKR,"DriverData\XBarPin2","GpioMask",0x00010001, 0x01,0x00,0x00,0x00
HKR,"DriverData\XBarPin2","GpioSettings",0x00010001, 0x00,0x00,0x00,0x00

;Tuner in video input is the default
HKR,"DriverData","VideoInputPin",0x00010001, 0x00,0x00,0x00,0x00

;Tuner in audio in input is the default audio
HKR,"DriverData","AudioInputPin",0x00010001, 0x02,0x00,0x00,0x00

HKR,"DriverData","ForceAudioWithVideoPin",0x00010001, 0x01,0x00,0x00,0x00




[EyeTV.AddReg]

; Sony format = 1, Philips format = 0
HKR,"DriverData","I2SInputFormat",0x00010001, 0x00, 0x00, 0x00, 0x00

HKR,"DriverData","EnableAFAudio",0x00010001, 0x01, 0x00, 0x00, 0x00
HKR,"DriverData","GpioMaskFM",0x00010001, 0x01, 0x00, 0x00, 0x00
HKR,"DriverData","GpioSettingFM",0x00010001, 0x01, 0x00, 0x00, 0x00

HKR,"DriverData","VideoStandard",0x00010001, 0x01,0x00,0x00,0x00

;Gain has 7 levels in volume up and down directions. each level gives 6db gain or attenuation
;for attenuation we need to use 2's complement values. 
;for Gain we use levels 1-7, for attenuation we use levels 0x9(-7) - 0xF (-1)
HKR,"DriverData","FMAudioGain",0x00010001, 0x1, 0x00, 0x00, 0x00


; for Polaris testing, select HANC to transfer Audio
HKR,"DriverData","EnableHANCAudioOut",0x00010001, 0x00, 0x00, 0x00, 0x00

; ----GPIO Pin values -----
; IMPORTANT !!! if any GPIO is not used - just delete the corresponding entry !!!

; AGC_Analog_Digitial_Select_Gpio_Bit is controlled by GPIO 28
HKR,"DriverData","AGC_Analog_Digitial_Select_Gpio_Bit", 0x00010001, 0x1C, 0x00, 0x00, 0x00
;gpio pin status mask, useless pin bit is 0 ;useful pin bit is 1
;HKR,"DriverData","gpio_pin_status_mask",0x00010001, 0x4001000

;PIN_CTRL pin status mask, useless pin bit is 0 ;useful pin bit is 1
HKR,"DriverData","ctrl_pin_status_mask",0x00010001, 0xFFFFFFC4



;gpio pin status mask, useless pin bit is 0 ;useful pin bit is 1
HKR,"DriverData","gpio_pin_status_mask",0x00010001, 0x400000A
;DVT=0,EVK=1,FPGA=2,RDU253S = 9, RDU253S =10
HKR,"DriverData","BoardType",0x00010001, 0x0A, 0x00, 0x00, 0x00

;---Tuner registry values------
;Tuner Type - Sidewinder = 0X22=34D  
;Tuner Type - xceive5000= 0x25=37D.
;Tuner Type - nxp18271 = 0x28 = 40D
HKR,"DriverData","TunerType",0x00010001, 0x28, 0x00, 0x00, 0x00

;Tuner I2c address sidewinder :0xc6,0x0a,0x00
;Tuner I2c address xceive5000 :0xC2
;Tuner I2c address nxp18271 :0xC0
HKR,"DriverData","TunerI2CAddress",0x00010001, 0xC0, 0x00, 0x00, 0x00

;Tuner xceive5000  crystal frequency=32M
;Tuner nxp18271    crystal frequency=16M
HKR,"DriverData","AnalogTunerXTALFreq",0x00010001, 0x10, 0x00, 0x00, 0x00

;Saw filter type: Temex=0,TRIQUINT/SAWTEK=1,EPCOS=2, Bypass=3
;for sidewinder :Temex =>xtal_freq=1218600000(1218.6Mhz)
HKR,"DriverData","SawFilterType",0x00010001, 0x3, 0x00, 0x00, 0x00

;I2C speed: 0-1M,1-400K,2-100K,3-5M
HKR,"DriverData","I2CSpeed",0x00010001, 0x1, 0x00, 0x00, 0x00

;I2C mode: 0-STOP, 1-NON STOP
HKR,"DriverData","I2CMode",0x00010001, 0x0, 0x00, 0x00, 0x00


;Enable SoftEncode - TRUE
HKR,"DriverData","Enable_SW_Encoder",0x00010001, 0x01, 0x00, 0x00, 0x00

; for creating unique serial number to Tuners on the board
HKR,"DriverData","NoOfTuners",0x00010001, 0x00, 0x00, 0x00, 0x00

;tuner category : 0 - Analog, 1 - Digital , 2 - Hybrid
HKR,"DriverData","TunerCategory",0x00010001, 0x02, 0x00, 0x00, 0x00

;Enable TS capture and BDA filter registration
HKR,"DriverData","Enable_BDA",0x00010001, 0x00, 0x00, 0x00, 0x00
HKR,"DriverData","ShutdownTunerInCVBS",0x00010001, 0x00, 0x00, 0x00, 0x00
HKR,"DriverData","EnableAutoFormatDetection",0x00010001, 0x01, 0x00, 0x00, 0x00

; BDA_Demod_Tuner_Type
; ALTAIR_SIDEWINDER = 2
; GEMINI3_SIDEWINDER = 5
; AQUARIUS_XC5000 = 6
; GEMINI3_XC5000 = 9
;AQUARIUS_NXP18271 = 0x0b
;GEMINI3__NXP18271 = 0x0c
HKR,"DriverData","BDA_Demod_Tuner_type",0x00010001, 0xc, 0x00, 0x00, 0x00

; Demod Crystal Freq
; Altair:56M(0xDAC0),  GeminiIII : 24.69M(0x6072),Aquarius: 24MHz(0x5dc0 kHz).  NOTE: unit is KHz
HKR,"DriverData","DemodXTALFreqKHz",0x00010001, 0x72, 0x60, 0x00, 0x00

; digital Demod I2C address 
; Altair:0x0A,  GeminiIII : 0x32, Aquarius: 0x02
HKR,"DriverData","DemodI2CAddress",0x00010001, 0x32, 0x00, 0x00, 0x00

; GPIO Pin values 
; IMPORTANT !!! if any GPIO is not used - just delete the corresponding entry !!!
;only for xc5000 tuner
;HKR,"DriverData","tuner_reset_gpio_bit", 0x00010001, 0x03, 0x00, 0x00, 0x00

;HKR,"DriverData","tuner_sif_fm_gpio_bit", 0x00010001, 0x05, 0x00, 0x00, 0x00

;The GPIO pin used for XC5000 GPIO emulated I2C bus SCL, GPIO26->SCL
;HKR,"DriverData","XC_GPIO_I2C_SCL", 0x00010001, 0x1A, 0x00, 0x00, 0x00

;The GPIO pin used for XC5000 GPIO emulated I2C bus SDA, GPIO27->SDA
;HKR,"DriverData","XC_GPIO_I2C_SDA", 0x00010001, 0x1B, 0x00, 0x00, 0x00


;Demod Comm mode : 0x00 = Serial, 0x01 = Parallel
;HKR,"DriverData","DemodTransferMode",0x00010001, 0x00, 0x00, 0x00, 0x00

;Tuner I2C master selection
;Polaris I2C master 3--3, Polaris I2C master 2--2
HKR,"DriverData","TunerI2CMaster",0x00010001, 0x03, 0x00, 0x00, 0x00


;Demod I2C master selection
;Polaris I2C master 3--3, Polaris I2C master 2--2
HKR,"DriverData","DemodI2CMaster",0x00010001, 0x02, 0x00, 0x00, 0x00



;===============================================================
;                I n t e r f a c e s
;===============================================================

[EyeTV.NTamd64.Interfaces]
AddInterface={65e8773d-8f56-11d0-a3b9-00a0c9223196},%KsNameFilter%,VID_Polaris_RDU253S_Interface,
AddInterface={6994AD05-93EF-11D0-A3CC-00A0C9223196},%KsNameFilter%,VID_Polaris_RDU253S_Interface,
AddInterface={a799a802-a46d-11d0-a18c-00a02401dcd4},%PolarisTVAudioReferenceGuid%,TvAudio_PolarisInterface,
AddInterface={a799a801-a46d-11d0-a18c-00a02401dcd4},%PolarisXBARReferenceGUID%,CXXBAR_PolarisInterface,
;AddInterface={a799a800-a46d-11d0-a18c-00a02401dcd4},%PolarisTunerReferenceGuid%,CXTUNE_PolarisInterface,
;AddInterface=%KSCATEGORY_AUDIO%,%PolarisAudioReferenceGuid%,AUD_PolarisInterface,
;BDA Tuner
;AddInterface =%KSCATEGORY_BDATUNER%,%KSSTRING_BdaPolarisSWTunerFilter%,CXBDATUNE_Interface,
;AddInterface={FD0A5AF4-B41D-11d2-9C95-00C04F7971E0},%KsTSNameFilter%,TS_Interface



;[CXBDATUNE_Interface]
;AddReg = CXBDATUNE_Interface.AddReg

;[CXBDATUNE_Interface.AddReg]
;HKR,,CLSID,,%Proxy.CLSID%
;HKR,,FriendlyName,,%BdaTunerFriendlyName_PolarisDVBT%



[VID_Polaris_RDU253S_Interface]
AddReg=VID_PolarisInterface.AddReg
AddReg=POLARIS_RDU253S_DESCRIPTION.AddReg


[VID_PolarisInterface.AddReg]
HKR,,CLSID,,%Proxy.CLSID%       ; {17CCA71B-ECD7-11D0-B908-00A0C9223196}
HKR,,FriendlyName,,%PolarisVIDFriendlyName%


[POLARIS_RDU253S_DESCRIPTION.AddReg]
HKR,,Description,,%EyeTV.DeviceDesc%


;[AUD_PolarisInterface]
;AddReg=AUD_PolarisInterface.AddReg

;[AUD_PolarisInterface.AddReg]
;HKR,,CLSID,,%Proxy.CLSID%       ; {17CCA71B-ECD7-11D0-B908-00A0C9223196}
;HKR,,FriendlyName,,%PolarisAudioFriendlyName%


[TvAudio_PolarisInterface]
AddReg=TvAudio_PolarisInterface.AddReg

[TvAudio_PolarisInterface.AddReg]
HKR,,CLSID,,%CLSID_TVAudioFilter%
HKR,,FriendlyName,,%PolarisTVAudioFriendlyName%

[CXXBAR_PolarisInterface]
AddReg=CXXBAR_PolarisInterface.AddReg

[CXXBAR_PolarisInterface.AddReg]
HKR,,CLSID,,%CLSID_CrossbarFilter%
HKR,,FriendlyName,,%PolarisXBARFriendlyName%

;[CXTUNE_PolarisInterface]
;AddReg=CXTUNE_PolarisInterface.AddReg

;[CXTUNE_PolarisInterface.AddReg]
;HKR,,CLSID,,%CLSID_CTVTunerFilter%
;HKR,,FriendlyName,,%PolarisTunerFriendlyName%


;[TS_Interface]
;AddReg=TS_Interface.AddReg

;[TS_Interface.AddReg]
;HKR,,CLSID,,%Proxy.CLSID%       ; {17CCA71B-ECD7-11D0-B908-00A0C9223196}
;HKR,,FriendlyName,,%TSFriendlyName%


;===============================================================
;                S e r v i c e s
;===============================================================

[EyeTV.CIR.NTamd64.Services]
AddService = , 2  ; null service install

[EyeTV.NTamd64.Services]
AddService = CXPLRCAP,2,EyeTVVID.CAPTURE.ServiceInstall



[EyeTVVID.CAPTURE.ServiceInstall]
DisplayName   = "EVC2010"
ServiceType   = 1
StartType     = 3
ErrorControl  = 1
ServiceBinary = %10%\system32\drivers\elvidcap.sys

;===============================================================
;                S t r i n g s
;===============================================================



[Strings]

;
;---------------------------------------------------------------
; Non-localizable (this driver)
;---------------------------------------------------------------
; Reference GUIDS
;
KsNameFilter                      = "{9B365890-165F-11D0-A195-0020AFD156E4}"
PolarisTVAudioReferenceGuid         = "{D8D86791-A570-4a10-8457-08C957E90ECD}"
PolarisXBARReferenceGUID            = "{47B00748-34A2-4000-A892-BA2ABF2E2BE4}"
PolarisTunerReferenceGuid           = "{F7CCD5C2-8766-4401-BF9D-ECF5FE0A07C0}"
PolarisAudioReferenceGuid           = "{5EAF914D-2212-4034-8C4C-02CAFD15D68A}"
;
; Pin Name GUIDS
;
POLARIS_GUID.PINNAME_ANALOG_AUDIO_IN = "{3E2D189F-B15C-4447-96F1-BD1D64FB99BA}"
POLARIS_GUID.PINNAME_AUDIO_OUT       = "{13FFFECC-3C46-4e52-8B07-4ED850E5FB49}"

;
; Pin Names
;
PinName.AnalogAudioOut            = "Audio Out"
Pin.p2AnalogAudioIn               = "Analog Audio In"

;
; PROPSETIDs in the driver
;
GUID.POLARIS_VERSION_INFORMATION_PROPERTIES = "{2038EEA5-AE84-4a00-B174-9673AB35F1DC}"

;
; Property page GUIDS
;
GUID.DriverVersion_Properties="{1979C7E7-FB3B-42ff-B070-0D8F49A1A42D}"

KSCATEGORY_AUDIO             = "{6994AD04-93EF-11D0-A3CC-00A0C9223196}"
CLSID_TVAudioFilter          = "{71F96462-78F3-11d0-A18C-00A0C9118956}"
CLSID_CrossbarFilter         = "{71F96460-78F3-11d0-A18C-00A0C9118956}"
CLSID_CTVTunerFilter         = "{266EEE40-6C63-11cf-8A03-00AA006ECB65}"


Proxy.CLSID                  = "{17CCA71B-ECD7-11D0-B908-00A0C9223196}"
MediaCategories              = "SYSTEM\CurrentControlSet\Control\MediaCategories"
MediaSets                    = "System\CurrentControlSet\Control\MediaSets"
MediaInterfaces              = "System\CurrentControlSet\Control\MediaInterfaces"


; Specify the GUID for the BDA Source Filters category in GraphEdit.
;
KSCATEGORY_BDATUNER="{71985F48-1CA1-11d3-9CC8-00C04F7971E0}"

; Specify the GUID for the digital tuner Filter.
;
; NOTE!  This must match the reference guid specified in the driver's filter
;        descriptor.
;
KSSTRING_BdaPolarisSWTunerFilter="{E01E1072-3DF3-4C23-B99F-6A27A7CC7CD2}"
;
; Specify the GUID for the tuner device's SW PnP ID
;
BdaSWTuner.DeviceId =   "{828B00F0-9A04-4692-8573-535B05DFF3F4}"

TSPinID             =   "{5237C937-0A21-4f7e-B338-DE0D0793D03F}"
TSPinName           =   "TS Out"

TSFriendlyName      = 	"Elgato AVStream TS Capture"
KsTSNameFilter      =   "{452660BD-3B39-4e34-9B97-3D3BC054AF5D}"

;---------------------------------------------------------------
; Localizable
;---------------------------------------------------------------


Provider                 = "Elgato Systems"
DiskName                 = "EyeTV Driver CD"



; Device Manager
EyeTV.DeviceDesc         = "Elgato Video Capture"
EyeTV_CIR.DeviceDesc     = "Elgato Helper Device"


; Friendly Names

PolarisVIDFriendlyName              = "Elgato Video Capture"
PolarisTVAudioFriendlyName          = "Elgato TvAudio"
PolarisAudioFriendlyName            = "Elgato Audio Capture"
PolarisXBARFriendlyName             = "Elgato Video Capture Crossbar"







