[Version]
Signature="$Windows NT$"
Class=MEDIA
Provider=%ProviderName%
ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318}
DriverVer = 02/11/2021,13.3.46.740
CatalogFile=oculusvad.cat

[SourceDisksNames]
222="OculusVad Driver Disk","",222

[SourceDisksFiles]
oculusvad.sys=222
oculusvadapo.dll=222

[SignatureAttributes]
oculusvad.sys=SignatureAttributes.DRM
oculusvadapo.dll=SignatureAttributes.PETrust

[SignatureAttributes.DRM]
DRMLevel=1300

[SignatureAttributes.PETrust]
PETrust=true

[Manufacturer]
%MfgName%=OCULUSVAD,NTamd64

[OCULUSVAD.NTamd64]
%OCULUSVAD_SA.DeviceDesc%=OCULUSVAD_SA, Root\oculusvad_OculusVad

[DestinationDirs]
OCULUSVAD_SA.CopyList=12 ; windows\system32\drivers
OCULUSVADAPO.CopyList=11 ; windows\system32

;======================================================
; OCULUSVAD_SA
;======================================================
[OCULUSVAD_SA.CopyList]
oculusvad.sys

[OCULUSVADAPO.CopyList]
oculusvadapo.dll

[OCULUSVAD_SA.AddReg]
HKR,,AssociatedFilters,,"wdmaud,redbook"
HKR,,Driver,,oculusvad.sys

HKR,PowerSettings,SingleComponentMultiFxStates,3,1,0,0,0  ; Turn on multi Fx support.
HKR,PowerSettings,ConservationIdleTime,3,3,0,0,0          ; 3 seconds for idle power management when on battery
HKR,PowerSettings,PerformanceIdleTime,3,3,0,0,0           ; 3 seconds for idle power management when on AC power
HKR,PowerSettings,IdlePowerState,3,3,0,0,0                ; go to D3 for idle power management

HKR,Drivers,SubClasses,,"wave,mixer"

HKR,Drivers\wave\wdmaud.drv,Driver,,wdmaud.drv
HKR,Drivers\mixer\wdmaud.drv,Driver,,wdmaud.drv

HKR,Drivers\wave\wdmaud.drv,Description,,%OCULUSVAD_SA.DeviceDesc%
HKR,Drivers\mixer\wdmaud.drv,Description,,%OCULUSVAD_SA.DeviceDesc%

HKR,%MEDIA_CATEGORIES%\%MicInCustomNameGUID%,Name,,%MicInCustomName%

[OCULUSVADAPO.AddReg]
; OculusVadApo Endpoint effect APO COM registration
HKCR,CLSID\%OCULUSVADAPO_FX_ENDPOINT_CLSID%,,,%EFX_FriendlyName%
HKCR,CLSID\%OCULUSVADAPO_FX_ENDPOINT_CLSID%\InProcServer32,,0x00020000,%%SystemRoot%%\System32\oculusvadapo.dll
HKCR,CLSID\%OCULUSVADAPO_FX_ENDPOINT_CLSID%\InProcServer32,ThreadingModel,,"Both"

; OculusVadApo Endpoint effect APO registration
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "FriendlyName", ,%EFX_FriendlyName%
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "Copyright", ,%FacebookCopyRight%
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "MajorVersion", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "MinorVersion", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "Flags", 0x00010001, %OCULUS_APO_FLAGS%
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "MinInputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "MaxInputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "MinOutputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "MaxOutputConnections", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "MaxInstances", 0x00010001, 0xffffffff
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "NumAPOInterfaces", 0x00010001, 1
HKCR,AudioEngine\AudioProcessingObjects\%OCULUSVADAPO_FX_ENDPOINT_CLSID%, "APOInterface0", ,"{FD7F2B29-24D0-4B5C-B177-592C39F9CA10}"

;======================================================
; render interfaces: speaker (external: headphone)
;======================================================
[OCULUSVAD.I.WaveSpeakerHeadphone]
AddReg=OCULUSVAD.I.WaveSpeakerHeadphone.AddReg

[OCULUSVAD.I.WaveSpeakerHeadphone.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%OCULUSVAD.WaveSpeakerHeadphone.szPname%

[OCULUSVAD.I.TopologySpeakerHeadphone]
AddReg=OCULUSVAD.I.TopologySpeakerHeadphone.AddReg,OCULUSVADAPO.I.Association0.AddReg

[OCULUSVAD.I.TopologySpeakerHeadphone.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%OCULUSVAD.TopologySpeakerHeadphone.szPname%
HKR,FX\0,%PKEY_FX_Association%,,%KSNODETYPE_ANY% 

; The following lines opt-in to pull mode.
HKR,EP\0,%PKEY_AudioEndpoint_Association%,,%KSNODETYPE_ANY%
HKR,EP\0,%PKEY_AudioEndpoint_Supports_EventDriven_Mode%,0x00010001,0x1

;======================================================
; capture interfaces: mic in (external: headphone)
;======================================================
[OCULUSVAD.I.WaveMicIn]
AddReg=OCULUSVAD.I.WaveMicIn.AddReg

[OCULUSVAD.I.WaveMicIn.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%OCULUSVAD.WaveMicIn.szPname%

[OCULUSVAD.I.TopologyMicIn]
AddReg=OCULUSVAD.I.TopologyMicIn.AddReg,OCULUSVADAPO.I.Association0.AddReg

[OCULUSVAD.I.TopologyMicIn.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%OCULUSVAD.TopologyMicIn.szPname%
HKR,FX\0,%PKEY_FX_Association%,,%KSNODETYPE_ANY%

; The following lines opt-in to pull mode.
HKR,EP\0,%PKEY_AudioEndpoint_Association%,,%KSNODETYPE_ANY%
HKR,EP\0,%PKEY_AudioEndpoint_Supports_EventDriven_Mode%,0x00010001,0x1

;======================================================
; APO per-interface registry
;======================================================
[OCULUSVADAPO.I.Association0.AddReg]
; Instruct audio endpoint builder to set the CLSIDs for stream, mode, and endpoint APOs
; into the effects property store
HKR,FX\0,%PKEY_CompositeFX_EndpointEffectClsid%,0x00010000,%OCULUSVADAPO_FX_ENDPOINT_CLSID%

; Driver developer would replace the list of supported processing modes here
; Concatenate GUIDs for DEFAULT, MEDIA, MOVIE stream effects
HKR,FX\0,%PKEY_EFX_ProcessingModes_Supported_For_Streaming%,0x00010000,%AUDIO_SIGNALPROCESSINGMODE_DEFAULT%

;======================================================
; OCULUSVAD_SA
;======================================================
[OCULUSVAD_SA.NT]
Include=ks.inf,wdmaudio.inf
Needs=KS.Registration, WDMAUDIO.Registration
CopyFiles=OCULUSVAD_SA.CopyList,OCULUSVADAPO.CopyList
AddReg=OCULUSVAD_SA.AddReg,OCULUSVADAPO.AddReg

[OCULUSVAD_SA.NT.Interfaces]
;
; Interfaces for speaker (external: headphone) render endpoint.
;
AddInterface=%KSCATEGORY_AUDIO%, %KSNAME_WaveSpeakerHeadphone%, OCULUSVAD.I.WaveSpeakerHeadphone
AddInterface=%KSCATEGORY_RENDER%, %KSNAME_WaveSpeakerHeadphone%, OCULUSVAD.I.WaveSpeakerHeadphone
AddInterface=%KSCATEGORY_REALTIME%, %KSNAME_WaveSpeakerHeadphone%, OCULUSVAD.I.WaveSpeakerHeadphone
AddInterface=%KSCATEGORY_AUDIO%, %KSNAME_TopologySpeakerHeadphone%, OCULUSVAD.I.TopologySpeakerHeadphone
AddInterface=%KSCATEGORY_TOPOLOGY%, %KSNAME_TopologySpeakerHeadphone%, OCULUSVAD.I.TopologySpeakerHeadphone

;
; Interfaces for microphone (external: headphone) capture endpoint 
;
AddInterface=%KSCATEGORY_AUDIO%,    %KSNAME_WaveMicIn%, OCULUSVAD.I.WaveMicIn
AddInterface=%KSCATEGORY_REALTIME%, %KSNAME_WaveMicIn%, OCULUSVAD.I.WaveMicIn
AddInterface=%KSCATEGORY_CAPTURE%,  %KSNAME_WaveMicIn%, OCULUSVAD.I.WaveMicIn
AddInterface=%KSCATEGORY_AUDIO%,    %KSNAME_TopologyMicIn%, OCULUSVAD.I.TopologyMicIn
AddInterface=%KSCATEGORY_TOPOLOGY%, %KSNAME_TopologyMicIn%, OCULUSVAD.I.TopologyMicIn

[OCULUSVAD_SA.NT.Services]
AddService=oculusvad_oculusvad,0x00000002,oculusvad_OculusVad_Service_Inst

[oculusvad_OculusVad_Service_Inst]
DisplayName=%OCULUSVAD_OculusVad.SvcDesc%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\oculusvad.sys

[OCULUSVAD_SA.NT.HW]
AddReg = AUDIOHW.AddReg

[AUDIOHW.AddReg]
; FILE_DEVICE_SOUND
HKR,,DeviceType,0x10001,0x0000001D
; SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RWX_RES_RWX
HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGWGX;;;WD)(A;;GRGWGX;;;RC)"


[oculusvad_OculusVad_RootDevice_Inst]
HardwareIds = ROOT\oculusvad_OculusVad

;======================================================
; WDF
;======================================================
[OCULUSVAD_SA.NT.Wdf]
KmdfService = oculusvad_oculusvad, OCULUSVAD_SA_WdfSect
[OCULUSVAD_SA_WdfSect]
KmdfLibraryVersion = 1.15

;======================================================
; COMMON
;======================================================
[Strings]

;Non-localizable

KSNAME_WaveSpeakerHeadphone="WaveSpeakerHeadphone"
KSNAME_TopologySpeakerHeadphone="TopologySpeakerHeadphone"

KSNAME_WaveMicIn="WaveMicIn"
KSNAME_TopologyMicIn="TopologyMicIn"

Proxy.CLSID="{17CCA71B-ECD7-11D0-B908-00A0C9223196}"
KSCATEGORY_AUDIO="{6994AD04-93EF-11D0-A3CC-00A0C9223196}"
KSCATEGORY_RENDER="{65E8773E-8F56-11D0-A3B9-00A0C9223196}"
KSCATEGORY_CAPTURE="{65E8773D-8F56-11D0-A3B9-00A0C9223196}"
KSCATEGORY_REALTIME ="{EB115FFC-10C8-4964-831D-6DCB02E6F23F}"
KSCATEGORY_TOPOLOGY = "{DDA54A40-1E4C-11D1-A050-405705C10000}"

KSNODETYPE_ANY   = "{00000000-0000-0000-0000-000000000000}"

PKEY_AudioEndpoint_Association               = "{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},2"
PKEY_AudioEndpoint_Supports_EventDriven_Mode = "{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},7"
;PKEY_AudioEndpoint_Default_VolumeInDb        = "{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},9"

PKEY_FX_Association                     = "{D04E05A6-594B-4FB6-A80D-01AF5EED7D1D},0"
PKEY_FX_EndpointEffectClsid             = "{D04E05A6-594B-4fb6-A80D-01AF5EED7D1D},7"
PKEY_CompositeFX_EndpointEffectClsid	= "{D04E05A6-594B-4fb6-A80D-01AF5EED7D1D},15"

PKEY_EFX_ProcessingModes_Supported_For_Streaming = "{D3993A3F-99C2-4402-B5EC-A92A0367664B},7"

REG_MULTI_SZ = 0x00010000           ; FLG_ADDREG_TYPE_MULTI_SZ
AUDIO_SIGNALPROCESSINGMODE_DEFAULT        = "{C18E2F7E-933D-4965-B7D1-1EEF228D2AF3}"
AUDIO_SIGNALPROCESSINGMODE_MEDIA          = "{4780004E-7133-41D8-8C74-660DADD2C0EE}"
AUDIO_SIGNALPROCESSINGMODE_MOVIE          = "{B26FEB0D-EC94-477C-9494-D1AB8E753F6E}"
AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS = "{98951333-B9CD-48B1-A0A3-FF40682D73F7}"
AUDIO_SIGNALPROCESSINGMODE_SPEECH         = "{FC1CFC9B-B9D6-4CFA-B5E0-4BB2166878B2}"
AUDIO_SIGNALPROCESSINGMODE_RAW            = "{9E90EA20-B493-4FD1-A1A8-7E1361A956CF}"

OCULUSVADAPO_FX_ENDPOINT_CLSID = "{C2263CCB-1459-4D54-B8E8-6A243704B8F6}"
FX_DISCOVER_EFFECTS_APO_CLSID  = "{889C03C8-ABAD-4004-BF0A-BC7BB825E166}"


MEDIA_CATEGORIES = "MediaCategories"
MicInCustomNameGUID = {B18B79F3-7C3D-41C3-B90C-682B13F51148}

; see audioenginebaseapo.idl for APO_FLAG enum values
; APO_FLAG_INPLACE	= 0x1,
; APO_FLAG_SAMPLESPERFRAME_MUST_MATCH	= 0x2,
; APO_FLAG_FRAMESPERSECOND_MUST_MATCH	= 0x4,
; APO_FLAG_BITSPERSAMPLE_MUST_MATCH	= 0x8,
; APO_FLAG_MIXER	= 0x10,
; OCULUS_APO_FLAGS =  APO_FLAG_SAMPLESPERFRAME_MUST_MATCH | APO_FLAG_FRAMESPERSECOND_MUST_MATCH | APO_FLAG_BITSPERSAMPLE_MUST_MATCH
OCULUS_APO_FLAGS = 0x0000000e 

;Localizable

ProviderName      = "Oculus"
MfgName           = "Oculus"
FacebookCopyRight = "Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved."

EFX_FriendlyName = "OculusVadApo"

OCULUSVAD_SA.DeviceDesc="Oculus Virtual Audio Device"
OCULUSVAD_OculusVad.SvcDesc="Oculus Virtual Audio Device"

;; friendly names
OCULUSVAD.WaveSpeakerHeadphone.szPname="OCULUSVAD Wave Speaker Headphone"
OCULUSVAD.TopologySpeakerHeadphone.szPname="OCULUSVAD Topology Speaker Headphone"

OCULUSVAD.WaveMicIn.szPname="OCULUSVAD Wave Microphone Headphone"
OCULUSVAD.TopologyMicIn.szPname="OCULUSVAD Topology Microphone Headphone"

MicInCustomName= "Headset Microphone"

