summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio/sysvad/Package/package.VcxProj3
-rw-r--r--audio/sysvad/PhoneAudioSample/CellularWave.cpp685
-rw-r--r--audio/sysvad/PhoneAudioSample/CellularWave.h126
-rw-r--r--audio/sysvad/PhoneAudioSample/Cellulartopo.cpp1117
-rw-r--r--audio/sysvad/PhoneAudioSample/Cellulartopo.h184
-rw-r--r--audio/sysvad/PhoneAudioSample/Cellulartoptable.h267
-rw-r--r--audio/sysvad/PhoneAudioSample/Cellularwavtable.h286
-rw-r--r--audio/sysvad/PhoneAudioSample/FMTopTable.h199
-rw-r--r--audio/sysvad/PhoneAudioSample/FMTopo.cpp985
-rw-r--r--audio/sysvad/PhoneAudioSample/FMTopo.h152
-rw-r--r--audio/sysvad/PhoneAudioSample/FMWavTable.h254
-rw-r--r--audio/sysvad/PhoneAudioSample/FMWave.cpp389
-rw-r--r--audio/sysvad/PhoneAudioSample/FMWave.h84
-rw-r--r--audio/sysvad/PhoneAudioSample/PhoneAudioSample.rc30
-rw-r--r--audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj419
-rw-r--r--audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj.Filters44
-rw-r--r--audio/sysvad/PhoneAudioSample/handsetmictopo.cpp274
-rw-r--r--audio/sysvad/PhoneAudioSample/handsetmictopo.h21
-rw-r--r--audio/sysvad/PhoneAudioSample/handsetmictoptable.h245
-rw-r--r--audio/sysvad/PhoneAudioSample/handsetmicwavtable.h447
-rw-r--r--audio/sysvad/PhoneAudioSample/handsetspeakertopo.cpp561
-rw-r--r--audio/sysvad/PhoneAudioSample/handsetspeakertopo.h86
-rw-r--r--audio/sysvad/PhoneAudioSample/handsetspeakertoptable.h156
-rw-r--r--audio/sysvad/PhoneAudioSample/handsetspeakerwavtable.h550
-rw-r--r--audio/sysvad/PhoneAudioSample/michstopo.cpp275
-rw-r--r--audio/sysvad/PhoneAudioSample/michstopo.h21
-rw-r--r--audio/sysvad/PhoneAudioSample/michstoptable.h257
-rw-r--r--audio/sysvad/PhoneAudioSample/michswavtable.h447
-rw-r--r--audio/sysvad/PhoneAudioSample/minipairs.h602
-rw-r--r--audio/sysvad/PhoneAudioSample/phoneaudiosample.inxbin45990 -> 0 bytes
-rw-r--r--audio/sysvad/PhoneAudioSample/speakerhstopo.cpp275
-rw-r--r--audio/sysvad/PhoneAudioSample/speakerhstopo.h21
-rw-r--r--audio/sysvad/PhoneAudioSample/speakerhstoptable.h168
-rw-r--r--audio/sysvad/PhoneAudioSample/speakerhswavtable.h755
-rw-r--r--audio/sysvad/README.md124
-rw-r--r--audio/sysvad/TabletAudioSample/ComponentizedApoSample.inxbin18736 -> 18736 bytes
-rw-r--r--audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inxbin11338 -> 11224 bytes
-rw-r--r--audio/sysvad/sysvad.sln20
38 files changed, 70 insertions, 10459 deletions
diff --git a/audio/sysvad/Package/package.VcxProj b/audio/sysvad/Package/package.VcxProj
index dba6d6b4..cef0bc33 100644
--- a/audio/sysvad/Package/package.VcxProj
+++ b/audio/sysvad/Package/package.VcxProj
@@ -30,9 +30,6 @@
<ProjectReference Include="..\KeywordDetectorAdapter\KeywordDetectorContosoAdapter.vcxproj">
<Project>{E0F02048-78A4-4FE8-B863-66E6CB6A2C37}</Project>
</ProjectReference>
- <ProjectReference Include="..\PhoneAudioSample\PhoneAudioSample.vcxproj">
- <Project>{FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}</Project>
- </ProjectReference>
<ProjectReference Include="..\APO\SwapAPO\SwapAPO.vcxproj">
<Project>{691F1D0F-CA50-46CD-8BBA-A59E9E8EB601}</Project>
</ProjectReference>
diff --git a/audio/sysvad/PhoneAudioSample/CellularWave.cpp b/audio/sysvad/PhoneAudioSample/CellularWave.cpp
deleted file mode 100644
index 1a999c1e..00000000
--- a/audio/sysvad/PhoneAudioSample/CellularWave.cpp
+++ /dev/null
@@ -1,685 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- cellularwave.cpp
-
-Abstract:
-
- Implementation of wavert miniport for cellular
-
---*/
-
-#pragma warning (disable : 4127)
-
-#include <sysvad.h>
-#include "simple.h"
-#include "CellularWave.h"
-#include "CellularTopo.h"
-#include "CellularToptable.h"
-
-//=============================================================================
-// CCellularMiniportWaveRT
-//=============================================================================
-
-//=============================================================================
-#pragma code_seg("PAGE")
-NTSTATUS
-CreateCellularMiniportWaveRT
-(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
-)
-/*++
-
-Routine Description:
-
- Create the wavert miniport.
-
-Arguments:
-
- Unknown -
-
- RefClsId -
-
- UnknownOuter -
-
- PoolType -
-
- UnkownAdapter -
-
- DeviceContext -
-
- MiniportPair -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- UNREFERENCED_PARAMETER(UnknownOuter);
-
- PAGED_CODE();
-
- ASSERT(Unknown);
- ASSERT(MiniportPair);
-
- CMiniportWaveRT *obj = new (PoolType, MINWAVERT_POOLTAG) CCellularMiniportWaveRT
- (
- UnknownAdapter,
- MiniportPair,
- DeviceContext
- );
- if (NULL == obj)
- {
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- obj->AddRef();
- *Unknown = reinterpret_cast<IUnknown*>(obj);
-
- return STATUS_SUCCESS;
-}
-
-//=============================================================================
-#pragma code_seg("PAGE")
-CCellularMiniportWaveRT::~CCellularMiniportWaveRT
-(
- void
-)
-/*++
-
-Routine Description:
-
- Destructor for wavert miniport
-
-Arguments:
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- DPF_ENTER(("[CCellularMiniportWaveRT::~CCellularMiniportWaveRT]"));
-
-} // ~CCellularMiniportWaveRT
-
-
-//=============================================================================
-#pragma code_seg("PAGE")
-STDMETHODIMP
-CCellularMiniportWaveRT::NonDelegatingQueryInterface
-(
- _In_ REFIID Interface,
- _COM_Outptr_ PVOID * Object
-)
-/*++
-
-Routine Description:
-
- QueryInterface for CCellularMiniportWaveRT
-
-Arguments:
-
- Interface - GUID of the interface
-
- Object - interface object to be returned.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(Object);
-
- if (IsEqualGUIDAligned(Interface, IID_IAdapterPowerManagement))
- {
- *Object = PVOID(PADAPTERPOWERMANAGEMENT(this));
- }
- else
- {
- *Object = NULL;
- }
-
- if (*Object)
- {
- // We reference the interface for the caller.
-
- PUNKNOWN(*Object)->AddRef();
- return STATUS_SUCCESS;
- }
-
- return CMiniportWaveRT::NonDelegatingQueryInterface(Interface, Object);
-}
-
-#pragma code_seg("PAGE")
-NTSTATUS
-PropertyHandler_CellularWaveFilter
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Redirects general property request to miniport object
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- CCellularMiniportWaveRT* pWaveHelper = reinterpret_cast<CCellularMiniportWaveRT*>(PropertyRequest->MajorTarget);
-
- if (pWaveHelper == NULL)
- {
- return STATUS_INVALID_PARAMETER;
- }
-
- pWaveHelper->AddRef();
-
- if (pWaveHelper->m_DeviceType == eCellularDevice &&
- IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_TelephonyControl))
- {
- switch (PropertyRequest->PropertyItem->Id)
- {
- case KSPROPERTY_TELEPHONY_PROVIDERID:
- ntStatus = pWaveHelper->PropertyHandler_TelephonyProviderId(PropertyRequest);
- break;
-
- case KSPROPERTY_TELEPHONY_CALLINFO:
- ntStatus = pWaveHelper->PropertyHandler_TelephonyCallInfo(PropertyRequest);
- break;
-
- case KSPROPERTY_TELEPHONY_CALLCONTROL:
- case KSPROPERTY_TELEPHONY_PROVIDERCHANGE:
- ntStatus = pWaveHelper->PropertyHandler_TelephonyCallState(PropertyRequest);
- break;
-
- case KSPROPERTY_TELEPHONY_CALLHOLD:
- ntStatus = pWaveHelper->PropertyHandler_TelephonyCallHold(PropertyRequest);
- break;
-
- case KSPROPERTY_TELEPHONY_MUTE_TX:
- ntStatus = pWaveHelper->PropertyHandler_TelephonyMuteTx(PropertyRequest);
- break;
-
- default:
- DPF(D_TERSE, ("[PropertyHandler_CellularWaveFilter: Invalid Device Request]"));
- }
- }
- else
- {
- ntStatus = PropertyHandler_WaveFilter(PropertyRequest);
- }
-
- pWaveHelper->Release();
-
- return ntStatus;
-} // PropertyHandler_CellularWaveFilter
-
-//=============================================================================
-#pragma code_seg("PAGE")
-NTSTATUS
-CCellularMiniportWaveRT::PropertyHandler_TelephonyProviderId
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-{
- NTSTATUS ntStatus = STATUS_INVALID_PARAMETER;
-
- PAGED_CODE();
-
- DPF_ENTER(("[CCellularMiniportWaveRT::PropertyHandler_TelephonyProviderId]"));
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ULONG flags = PropertyRequest->PropertyItem->Flags;
- ntStatus = PropertyHandler_BasicSupport(PropertyRequest, flags, VT_ILLEGAL);
- }
- else
- {
- ULONG cbMinSize = sizeof(ULONG);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbMinSize;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbMinSize)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- ULONG* providerId = (ULONG*)PropertyRequest->Value;
- // Return supported TelephonyProviderId (executor id).
- *providerId = m_TelephonyProviderId;
- ntStatus = STATUS_SUCCESS;
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-} // PropertyHandler_TelephonyProviderId
-
-//=============================================================================
-#pragma code_seg("PAGE")
-NTSTATUS
-CCellularMiniportWaveRT::PropertyHandler_TelephonyCallInfo
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-{
- NTSTATUS ntStatus = STATUS_INVALID_PARAMETER;
-
- PAGED_CODE();
-
- DPF_ENTER(("[CCellularMiniportWaveRT::PropertyHandler_TelephonyCallInfo]"));
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ULONG flags = PropertyRequest->PropertyItem->Flags;
- ntStatus = PropertyHandler_BasicSupport(PropertyRequest, flags, VT_ILLEGAL);
- }
- else
- {
- ULONG cbMinSize = sizeof(KSTELEPHONY_CALLINFO);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbMinSize;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbMinSize)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSTELEPHONY_CALLINFO TelephonyCallInfo = static_cast<PKSTELEPHONY_CALLINFO>(PropertyRequest->Value);
- // Return current CallType and CallState information. CallType information is not valid when the CallState is disabled.
- TelephonyCallInfo->CallType = m_TelephonyCallType;
- TelephonyCallInfo->CallState = m_TelephonyCallState;
- ntStatus = STATUS_SUCCESS;
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-} // PropertyHandler_TelephonyCallInfo
-
-#pragma code_seg("PAGE")
-NTSTATUS
-CCellularMiniportWaveRT::UpdateTopologyJackState
-(
- _In_ ULONG TelephonyId,
- _In_ BOOL NewState
-)
-{
- PAGED_CODE ();
- NTSTATUS ntStatus = STATUS_SUCCESS;
- IUnknown *pUnknown = NULL;
- ICellularTopology *pCellularTopology = NULL;
-
- // GetFilters returns the topology port, then topology miniport, then wave port, then wave miniport.
- // we only need the topology miniport.
- ntStatus = m_pAdapterCommon->GetFilters(m_pMiniportPair, NULL, &pUnknown, NULL, NULL);
- if (NT_SUCCESS(ntStatus))
- {
- ntStatus = pUnknown->QueryInterface(IID_ICellularTopology, (PVOID *)&pCellularTopology);
- if (NT_SUCCESS(ntStatus))
- {
- ntStatus = pCellularTopology->UpdateTopologyJackState(TelephonyId, NewState);
- }
- }
-
- SAFE_RELEASE(pCellularTopology);
- SAFE_RELEASE(pUnknown);
-
- return STATUS_SUCCESS;
-}
-#pragma code_seg()
-
-//=============================================================================
-#pragma code_seg("PAGE")
-NTSTATUS
-CCellularMiniportWaveRT::PropertyHandler_TelephonyCallState
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-{
- NTSTATUS ntStatus = STATUS_INVALID_PARAMETER;
-
- PAGED_CODE();
-
- DPF_ENTER(("[CCellularMiniportWaveRT::PropertyHandler_TelephonyCallState]"));
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ULONG flags = PropertyRequest->PropertyItem->Flags;
- ntStatus = PropertyHandler_BasicSupport(PropertyRequest, flags, VT_ILLEGAL);
- }
- else
- {
- ULONG cbMinSize = 0;
-
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_TELEPHONY_CALLCONTROL)
- {
- cbMinSize = sizeof(KSTELEPHONY_CALLCONTROL);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_TELEPHONY_PROVIDERCHANGE)
- {
- cbMinSize = sizeof(KSTELEPHONY_PROVIDERCHANGE);
- }
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbMinSize;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbMinSize)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)
- {
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_TELEPHONY_CALLCONTROL)
- {
- PKSTELEPHONY_CALLCONTROL TelephonyCallControl = static_cast<PKSTELEPHONY_CALLCONTROL>(PropertyRequest->Value);
-
- // KSPROPERTY_TELEPHONY_CALLCONTROL has info about CallType and CallControlOp. TELEPHONY_CALLCONTROLOP_ENABLE will start
- // cellular call from audio driver perspective, update jack state for associated cellular bidi endpoint to active,
- // save call type and update the call state to Enabled. TELEPHONY_CALLCONTROLOP_DISABLE will terminate cellular call
- // from audio driver perspective, update jack state for associated cellular bidi endpoint to unplugged and update
- // call state to Disabled. Call type is ignored in this case.
- switch (TelephonyCallControl->CallControlOp)
- {
- case TELEPHONY_CALLCONTROLOP_DISABLE:
- ASSERT(m_TelephonyCallState != TELEPHONY_CALLSTATE_DISABLED);
- m_TelephonyCallState = TELEPHONY_CALLSTATE_DISABLED;
- UpdateTopologyJackState(m_TelephonyProviderId, FALSE);
- // Release our idle power management requirement
- m_pAdapterCommon->SetIdlePowerManagement(m_pMiniportPair, TRUE);
- ntStatus = STATUS_SUCCESS;
- break;
-
- case TELEPHONY_CALLCONTROLOP_ENABLE:
- ASSERT(m_TelephonyCallState != TELEPHONY_CALLSTATE_ENABLED);
- m_TelephonyCallType = TelephonyCallControl->CallType;
- m_TelephonyCallState = TELEPHONY_CALLSTATE_ENABLED;
- UpdateTopologyJackState(m_TelephonyProviderId, TRUE);
- // When we're in a call, we need idle power management disabled.
- m_pAdapterCommon->SetIdlePowerManagement(m_pMiniportPair, FALSE);
- ntStatus = STATUS_SUCCESS;
- break;
-
- default:
- ntStatus = STATUS_INVALID_PARAMETER;
- break;
- }
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_TELEPHONY_PROVIDERCHANGE)
- {
- PKSTELEPHONY_PROVIDERCHANGE TelephonyProviderChange = static_cast<PKSTELEPHONY_PROVIDERCHANGE>(PropertyRequest->Value);
-
- // KSPROPERTY_TELEPHONY_PROVIDERCHANGE has info about CallType and ProviderChangeOp. TELEPHONY_PROVIDERCHANGEOP_BEGIN will indicate
- // start of SRVCC to audio driver. Audio driver will then start the SRVCC and update the call state to ProviderTransition.
- // TELEPHONY_PROVIDERCHANGEOP_END will indicate end of SRVCC to audio driver and driver will end SRVCC process and update
- // call state to Enabled. TELEPHONY_PROVIDERCHANGEOP_CANCEL will indicate SRVCC was aborted and audio driver will revert back to
- // pre SRVCC call.
- switch (TelephonyProviderChange->ProviderChangeOp)
- {
- case TELEPHONY_PROVIDERCHANGEOP_END:
- m_TelephonyCallState = TELEPHONY_CALLSTATE_ENABLED;
- ntStatus = STATUS_SUCCESS;
- break;
-
- case TELEPHONY_PROVIDERCHANGEOP_BEGIN:
- m_PreviousTelephonyCallType = m_TelephonyCallType;
- m_TelephonyCallType = TelephonyProviderChange->CallType;
- m_TelephonyCallState = TELEPHONY_CALLSTATE_PROVIDERTRANSITION;
- ntStatus = STATUS_SUCCESS;
- break;
-
- case TELEPHONY_PROVIDERCHANGEOP_CANCEL:
- m_TelephonyCallType = m_PreviousTelephonyCallType;
- m_TelephonyCallState = TELEPHONY_CALLSTATE_ENABLED;
- ntStatus = STATUS_SUCCESS;
- break;
-
- default:
- ntStatus = STATUS_INVALID_PARAMETER;
- break;
- }
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-} // PropertyHandler_TelephonyCallState
-
-//=============================================================================
-#pragma code_seg("PAGE")
-NTSTATUS
-CCellularMiniportWaveRT::PropertyHandler_TelephonyCallHold
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-{
- NTSTATUS ntStatus = STATUS_INVALID_PARAMETER;
-
- PAGED_CODE();
-
- DPF_ENTER(("[CCellularMiniportWaveRT::PropertyHandler_TelephonyCallHold]"));
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ULONG flags = PropertyRequest->PropertyItem->Flags;
- ntStatus = PropertyHandler_BasicSupport(PropertyRequest, flags, VT_ILLEGAL);
- }
- else
- {
- ULONG cbMinSize = sizeof(BOOL);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbMinSize;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbMinSize)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- BOOL* bTelephonyHold = (BOOL*) PropertyRequest->Value;
- // Return if the call is on hold or not
- *bTelephonyHold = m_bTelephonyHold;
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)
- {
- BOOL* bTelephonyHold = (BOOL*) PropertyRequest->Value;
- m_bTelephonyHold = *bTelephonyHold;
-
- // If this property is TRUE, put the call on hold and update the call state to hold.
- // If this property is FALSE, take the call out of hold and update the call state to enabled.
- m_TelephonyCallState = (*bTelephonyHold) ? TELEPHONY_CALLSTATE_HOLD : TELEPHONY_CALLSTATE_ENABLED;
- ntStatus = STATUS_SUCCESS;
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-} // PropertyHandler_TelephonyCallHold
-
-//=============================================================================
-#pragma code_seg("PAGE")
-NTSTATUS
-CCellularMiniportWaveRT::PropertyHandler_TelephonyMuteTx
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-{
- NTSTATUS ntStatus = STATUS_INVALID_PARAMETER;
-
- PAGED_CODE();
-
- DPF_ENTER(("[CCellularMiniportWaveRT::PropertyHandler_TelephonyMuteTx]"));
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ULONG flags = PropertyRequest->PropertyItem->Flags;
- ntStatus = PropertyHandler_BasicSupport(PropertyRequest, flags, VT_ILLEGAL);
- }
- else
- {
- ULONG cbMinSize = sizeof(BOOL);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbMinSize;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbMinSize)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- BOOL* bTxMute = (BOOL*) PropertyRequest->Value;
- // Return if the cellular Tx is on muted or not
- *bTxMute = m_bTelephonyMuteTx;
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)
- {
- BOOL* bTxMute = (BOOL*) PropertyRequest->Value;
- // If this property is TRUE, mute cellular Tx data. However, it should not mute the data that was injected to KSNODETYPE_TELEPHONY_TX.
- // If this property is FALSE, unmute cellular Tx data.
- m_bTelephonyMuteTx = *bTxMute;
- ntStatus = STATUS_SUCCESS;
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-} // PropertyHandler_TelephonyMuteTx
-
-//=============================================================================
-#pragma code_seg()
-STDMETHODIMP_(void)
-CCellularMiniportWaveRT::PowerChangeState
-(
- _In_ POWER_STATE NewState
-)
-{
- DPF_ENTER(("[CCellularMiniportWaveRT::PowerChangeState]"));
- UNREFERENCED_PARAMETER(NewState);
-
- /*
- Turn on and off cellular specific hardware here, if applicable.
- */
-
-} // PowerStateChange
-
-//=============================================================================
-#pragma code_seg()
-STDMETHODIMP_(NTSTATUS)
-CCellularMiniportWaveRT::QueryDeviceCapabilities
-(
- _Inout_updates_bytes_(sizeof(DEVICE_CAPABILITIES)) PDEVICE_CAPABILITIES PowerDeviceCaps
-)
-{
- UNREFERENCED_PARAMETER(PowerDeviceCaps);
-
- /*
- Unused at the miniport layer. Any device capabilities should be reported in CAdapterCommon
- */
-
- return (STATUS_SUCCESS);
-} // QueryDeviceCapabilities
-
-//=============================================================================
-#pragma code_seg()
-STDMETHODIMP_(NTSTATUS)
-CCellularMiniportWaveRT::QueryPowerChangeState
-(
- _In_ POWER_STATE NewStateQuery
-)
-{
- UNREFERENCED_PARAMETER(NewStateQuery);
-
- DPF_ENTER(("[CCellularMiniportWaveRT::QueryPowerChangeState]"));
-
- // if we're in a call state other than disabled, then we need the hardware turned on.
- if (TELEPHONY_CALLSTATE_DISABLED != m_TelephonyCallState)
- {
- return STATUS_RESOURCE_IN_USE;
- }
-
- return STATUS_SUCCESS;
-} // QueryPowerChangeState
-
-
diff --git a/audio/sysvad/PhoneAudioSample/CellularWave.h b/audio/sysvad/PhoneAudioSample/CellularWave.h
deleted file mode 100644
index 1704ff0c..00000000
--- a/audio/sysvad/PhoneAudioSample/CellularWave.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- cellularwave.h
-
-Abstract:
-
- Definition of wavert miniport class for cellular
-
---*/
-
-#include "MinWaveRT.h"
-
-#ifndef _SYSVAD_CELLULARMINWAVERT_H_
-#define _SYSVAD_CELLULARMINWAVERT_H_
-
-NTSTATUS
-CreateCellularMiniportWaveRT
-(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
-);
-
-//=============================================================================
-// Classes
-//=============================================================================
-///////////////////////////////////////////////////////////////////////////////
-// CCellularMiniportWaveRT
-//
-class CCellularMiniportWaveRT :
- public CMiniportWaveRT,
- public IAdapterPowerManagement
-{
-private:
- ULONG m_TelephonyProviderId;
- TELEPHONY_CALLTYPE m_TelephonyCallType;
- TELEPHONY_CALLTYPE m_PreviousTelephonyCallType;
- TELEPHONY_CALLSTATE m_TelephonyCallState;
- BOOL m_bTelephonyHold;
- BOOL m_bTelephonyMuteTx;
-
-public:
- DECLARE_STD_UNKNOWN();
- IMP_IAdapterPowerManagement;
-
- CCellularMiniportWaveRT(
- _In_ PUNKNOWN UnknownAdapter,
- _In_ PENDPOINT_MINIPAIR MiniportPair,
- _In_opt_ PVOID DeviceContext
- )
- :CMiniportWaveRT(UnknownAdapter, MiniportPair, DeviceContext),
- m_TelephonyProviderId(0),
- m_TelephonyCallType(TELEPHONY_CALLTYPE_CIRCUITSWITCHED),
- m_PreviousTelephonyCallType(TELEPHONY_CALLTYPE_CIRCUITSWITCHED),
- m_TelephonyCallState(TELEPHONY_CALLSTATE_DISABLED),
- m_bTelephonyHold(FALSE),
- m_bTelephonyMuteTx(FALSE)
- {
- if (IsCellularDevice())
- {
- if (m_DeviceFlags & ENDPOINT_CELLULAR_PROVIDER1)
- {
- m_TelephonyProviderId = 0;
- }
- else if (m_DeviceFlags & ENDPOINT_CELLULAR_PROVIDER2)
- {
- m_TelephonyProviderId = 1;
- }
- }
- }
-
- ~CCellularMiniportWaveRT();
-
- friend NTSTATUS PropertyHandler_CellularWaveFilter
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
-public:
- NTSTATUS PropertyHandler_TelephonyProviderId
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandler_TelephonyCallInfo
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandler_TelephonyCallState
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandler_TelephonyCallHold
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandler_TelephonyMuteTx
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
-private:
- NTSTATUS UpdateTopologyJackState
- (
- _In_ ULONG TelephonyId,
- _In_ BOOL NewState
- );
-};
-typedef CCellularMiniportWaveRT *PCCellularMiniportWaveRT;
-
-#endif // _SYSVAD_CELLULARMINWAVERT_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/Cellulartopo.cpp b/audio/sysvad/PhoneAudioSample/Cellulartopo.cpp
deleted file mode 100644
index 7329a9f9..00000000
--- a/audio/sysvad/PhoneAudioSample/Cellulartopo.cpp
+++ /dev/null
@@ -1,1117 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- cellulartopo.cpp
-
-Abstract:
-
- Implementation of topology miniport for the cellular endpoint.
-
---*/
-
-#pragma warning (disable : 4127)
-
-#include <sysvad.h>
-#include "simple.h"
-#include "mintopo.h"
-#include "cellulartopo.h"
-#include "cellulartoptable.h"
-#include <ntstrsafe.h>
-
-
-#pragma code_seg("PAGE")
-
-
-// table of valid render/capture combinations for cellular routing.
-// speaker and mic (speakerphone)
-// headset speaker and headset mic (wired headset)
-// headset speaker and mic (wired headset without microphone)
-// handset speaker and handset mic (handset)
-// HFP speaker and HFP mic (bluetooth hands free)
-// special host routing pair
-KSTOPOLOGY_ENDPOINTIDPAIR g_EndpointList[] =
-{
- { HANDSET_SPEAKER_TOPONAME, KSPIN_TOPO_LINEOUT_DEST, HANDSET_MIC_TOPONAME, KSPIN_TOPO_MIC_ELEMENTS },
- { SPEAKER_TOPONAME, KSPIN_TOPO_LINEOUT_DEST, MIC_ARRAY1_TOPONAME, KSPIN_TOPO_MIC_ELEMENTS },
- { SPEAKER_HEADSET_TOPONAME, KSPIN_TOPO_LINEOUT_DEST, MIC_HEADSET_TOPONAME, KSPIN_TOPO_MIC_ELEMENTS },
- { SPEAKER_HEADSET_TOPONAME, KSPIN_TOPO_LINEOUT_DEST, MIC_ARRAY1_TOPONAME, KSPIN_TOPO_MIC_ELEMENTS },
- { HFP_SPEAKER_TOPONAME, KSPIN_TOPO_LINEOUT_DEST, HFP_MIC_TOPONAME, KSPIN_TOPO_MIC_ELEMENTS },
- { HOSTRENDER_TOPONAME, HOSTRENDER_PIN, HOSTCAPTURE_TOPONAME, HOSTCAPTURE_PIN }
-};
-
-//=============================================================================
-NTSTATUS
-CreateCellularMiniportTopology
-(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
-)
-/*++
-
-Routine Description:
-
- Creates a new topology miniport.
-
-Arguments:
-
- Unknown -
-
- RefclsId -
-
- UnknownOuter -
-
- PoolType -
-
- UnknownAdapter -
-
- DeviceContext -
-
- MiniportPair -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(Unknown);
- ASSERT(MiniportPair);
-
- UNREFERENCED_PARAMETER(UnknownAdapter);
- UNREFERENCED_PARAMETER(DeviceContext);
-
- CCellularMiniportTopology *obj =
- new (PoolType, MINWAVERT_POOLTAG)
- CCellularMiniportTopology( UnknownOuter,
- MiniportPair->TopoDescriptor,
- MiniportPair->DeviceMaxChannels);
- if (NULL == obj)
- {
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- obj->AddRef();
- *Unknown = reinterpret_cast<IUnknown*>(obj);
-
- return STATUS_SUCCESS;
-} // CreateCellularMiniportTopology
-
-CCellularMiniportTopology::CCellularMiniportTopology
-(
- _In_opt_ PUNKNOWN UnknownOuter,
- _In_ PCFILTER_DESCRIPTOR *FilterDesc,
- _In_ USHORT DeviceMaxChannels
-)
-: CUnknown(UnknownOuter),
- CMiniportTopologySYSVAD(FilterDesc, DeviceMaxChannels),
- m_CellularVolume(0)
-{
- PAGED_CODE();
-
- InitializeListHead(&m_EndpointPairs);
-
- // populate the initial state
- memcpy(&m_CellularRenderEndpoint, &(g_EndpointList[0].RenderEndpoint), sizeof(m_CellularRenderEndpoint));
- memcpy(&m_CellularCaptureEndpoint, &(g_EndpointList[0].CaptureEndpoint), sizeof(m_CellularCaptureEndpoint));
-}
-
-
-//=============================================================================
-CCellularMiniportTopology::~CCellularMiniportTopology
-(
- void
-)
-/*++
-
-Routine Description:
-
- Topology miniport destructor
-
-Arguments:
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- while (!IsListEmpty(&m_EndpointPairs))
- {
- PLIST_ENTRY le = RemoveHeadList(&m_EndpointPairs);
- ENDPOINT_PAIR_ENTRY *pRecord = CONTAINING_RECORD(le, ENDPOINT_PAIR_ENTRY, ListEntry);
- delete pRecord;
- }
-
- DPF_ENTER(("[CCellularMiniportTopology::~CCellularMiniportTopology]"));
-} // ~CCellularMiniportTopology
-
-//=============================================================================
-NTSTATUS
-CCellularMiniportTopology::DataRangeIntersection
-(
- _In_ ULONG PinId,
- _In_ PKSDATARANGE ClientDataRange,
- _In_ PKSDATARANGE MyDataRange,
- _In_ ULONG OutputBufferLength,
- _Out_writes_bytes_to_opt_(OutputBufferLength, *ResultantFormatLength)
- PVOID ResultantFormat OPTIONAL,
- _Out_ PULONG ResultantFormatLength
-)
-/*++
-
-Routine Description:
-
- The DataRangeIntersection function determines the highest quality
- intersection of two data ranges.
-
-Arguments:
-
- PinId - Pin for which data intersection is being determined.
-
- ClientDataRange - Pointer to KSDATARANGE structure which contains the data range
- submitted by client in the data range intersection property
- request.
-
- MyDataRange - Pin's data range to be compared with client's data range.
-
- OutputBufferLength - Size of the buffer pointed to by the resultant format
- parameter.
-
- ResultantFormat - Pointer to value where the resultant format should be
- returned.
-
- ResultantFormatLength - Actual length of the resultant format that is placed
- at ResultantFormat. This should be less than or equal
- to OutputBufferLength.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- return
- CMiniportTopologySYSVAD::DataRangeIntersection
- (
- PinId,
- ClientDataRange,
- MyDataRange,
- OutputBufferLength,
- ResultantFormat,
- ResultantFormatLength
- );
-} // DataRangeIntersection
-
-//=============================================================================
-STDMETHODIMP
-CCellularMiniportTopology::GetDescription
-(
- _Out_ PPCFILTER_DESCRIPTOR * OutFilterDescriptor
-)
-/*++
-
-Routine Description:
-
- The GetDescription function gets a pointer to a filter description.
- It provides a location to deposit a pointer in miniport's description
- structure. This is the placeholder for the FromNode or ToNode fields in
- connections which describe connections to the filter's pins.
-
-Arguments:
-
- OutFilterDescriptor - Pointer to the filter description.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(OutFilterDescriptor);
-
- return CMiniportTopologySYSVAD::GetDescription(OutFilterDescriptor);
-} // GetDescription
-
-//=============================================================================
-STDMETHODIMP
-CCellularMiniportTopology::Init
-(
- _In_ PUNKNOWN UnknownAdapter,
- _In_ PRESOURCELIST ResourceList,
- _In_ PPORTTOPOLOGY Port_
-)
-/*++
-
-Routine Description:
-
- The Init function initializes the miniport. Callers of this function
- should run at IRQL PASSIVE_LEVEL
-
-Arguments:
-
- UnknownAdapter - A pointer to the Iuknown interface of the adapter object.
-
- ResourceList - Pointer to the resource list to be supplied to the miniport
- during initialization. The port driver is free to examine the
- contents of the ResourceList. The port driver will not be
- modify the ResourceList contents.
-
- Port - Pointer to the topology port object that is linked with this miniport.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- UNREFERENCED_PARAMETER(ResourceList);
-
- PAGED_CODE();
-
- ASSERT(UnknownAdapter);
- ASSERT(Port_);
-
- DPF_ENTER(("[CCellularMiniportTopology::Init]"));
-
- NTSTATUS ntStatus = STATUS_SUCCESS;
-
- ExInitializeFastMutex(&m_EndpointFastMutex);
-
- // copy the full static list over to the dynamic list.
- for (int i = 0; i < SIZEOF_ARRAY(g_EndpointList) && NT_SUCCESS(ntStatus); i++)
- {
- ENDPOINT_PAIR_ENTRY *newEntry = new(NonPagedPoolNx, MINADAPTER_POOLTAG) ENDPOINT_PAIR_ENTRY;
-
- if (!newEntry)
- {
- DPF(D_TERSE, ("Insufficient memory to create endpoint pair"));
- ntStatus = STATUS_INSUFFICIENT_RESOURCES;
- }
- else
- {
- memcpy(&(newEntry->data), &(g_EndpointList[i]), sizeof(KSTOPOLOGY_ENDPOINTIDPAIR));
- InsertTailList(&m_EndpointPairs, &newEntry->ListEntry);
- }
- }
-
- if (NT_SUCCESS(ntStatus))
- {
- ntStatus =
- CMiniportTopologySYSVAD::Init
- (
- UnknownAdapter,
- Port_
- );
- }
-
- return ntStatus;
-} // Init
-
-//=============================================================================
-STDMETHODIMP
-CCellularMiniportTopology::NonDelegatingQueryInterface
-(
- _In_ REFIID Interface,
- _COM_Outptr_ PVOID * Object
-)
-/*++
-
-Routine Description:
-
- QueryInterface for MiniportTopology
-
-Arguments:
-
- Interface - GUID of the interface
-
- Object - interface object to be returned.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(Object);
-
- if (IsEqualGUIDAligned(Interface, IID_IUnknown))
- {
- *Object = PVOID(PUNKNOWN(static_cast<IMiniportTopology*>( this )));
- }
- else if (IsEqualGUIDAligned(Interface, IID_IMiniport))
- {
- *Object = PVOID(PMINIPORT(this));
- }
- else if (IsEqualGUIDAligned(Interface, IID_IMiniportTopology))
- {
- *Object = PVOID(PMINIPORTTOPOLOGY(this));
- }
- else if (IsEqualGUIDAligned(Interface, IID_ICellularTopology))
- {
- *Object = PVOID(PCELLULARTOPOLOGY(this));
- }
- else if (IsEqualGUIDAligned(Interface, IID_IMiniportChange))
- {
- *Object = PVOID(static_cast<PMINIPORTCHANGE>( this ));
- }
- else
- {
- *Object = NULL;
- }
-
- if (*Object)
- {
- // We reference the interface for the caller.
- PUNKNOWN(*Object)->AddRef();
- return(STATUS_SUCCESS);
- }
-
- return(STATUS_INVALID_PARAMETER);
-} // NonDelegatingQueryInterface
-
-//=============================================================================
-NTSTATUS
-CCellularMiniportTopology::PropertyHandlerJackDescription
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION )
-
-Arguments:
-
- PropertyRequest
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerJackDescription]"));
-
- ULONG cJackDescriptions = ARRAYSIZE(CellularJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = CellularJackDescriptions;
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION pDesc = (PKSJACK_DESCRIPTION)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlCopyMemory(pDesc, JackDescriptions[nPinId], sizeof(KSJACK_DESCRIPTION));
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-CCellularMiniportTopology::PropertyHandlerJackDescription2
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION2 )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerJackDescription2]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- ULONG cJackDescriptions = ARRAYSIZE(CellularJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = CellularJackDescriptions;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION2);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION2 pDesc = (PKSJACK_DESCRIPTION2)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlZeroMemory(pDesc, sizeof(KSJACK_DESCRIPTION2));
-
- //
- // Specifies the lower 16 bits of the DWORD parameter. This parameter indicates whether
- // the jack is currently active, streaming, idle, or hardware not ready.
- //
- pDesc->DeviceStateInfo = 0;
-
- //
- // From MSDN:
- // "If an audio device lacks jack presence detection, the IsConnected member of
- // the KSJACK_DESCRIPTION structure must always be set to TRUE. To remove the
- // ambiguity that results from this dual meaning of the TRUE value for IsConnected,
- // a client application can call IKsJackDescription2::GetJackDescription2 to read
- // the JackCapabilities flag of the KSJACK_DESCRIPTION2 structure. If this flag has
- // the JACKDESC2_PRESENCE_DETECT_CAPABILITY bit set, it indicates that the endpoint
- // does in fact support jack presence detection. In that case, the return value of
- // the IsConnected member can be interpreted to accurately reflect the insertion status
- // of the jack."
- //
- // Bit definitions:
- // 0x00000001 - JACKDESC2_PRESENCE_DETECT_CAPABILITY
- // 0x00000002 - JACKDESC2_DYNAMIC_FORMAT_CHANGE_CAPABILITY
- //
- pDesc->JackCapabilities = JACKDESC2_PRESENCE_DETECT_CAPABILITY;
-
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-CCellularMiniportTopology::PropertyHandlerTelephonyEndpointIdPair
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_TelephonyTopology, KSPROPERTY_TELEPHONY_ENDPOINTIDPAIR )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerTelephonyEndpointIdPair]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- ULONG ulExpectedSize = (sizeof(KSPROPERTY_DESCRIPTION) + sizeof(KSPROPERTY_MEMBERSHEADER));
-
- PLIST_ENTRY le = NULL;
- int countOfValidEndpointPairs = 0;
-
- ExAcquireFastMutex(&m_EndpointFastMutex);
-
- for (le = m_EndpointPairs.Flink; le != &m_EndpointPairs; le = le->Flink)
- {
- countOfValidEndpointPairs++;
- }
- ulExpectedSize += (countOfValidEndpointPairs * sizeof(KSTOPOLOGY_ENDPOINTIDPAIR));
-
- if (PropertyRequest->ValueSize >= sizeof(KSPROPERTY_DESCRIPTION))
- {
- // if return buffer can hold a KSPROPERTY_DESCRIPTION, return it
- //
- PKSPROPERTY_DESCRIPTION PropDesc =
- PKSPROPERTY_DESCRIPTION(PropertyRequest->Value);
-
- PropDesc->AccessFlags = KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_SET |KSPROPERTY_TYPE_GET;
- PropDesc->DescriptionSize = ulExpectedSize;
- PropDesc->PropTypeSet.Set = KSPROPSETID_TelephonyTopology;
- PropDesc->PropTypeSet.Id = KSPROPERTY_TELEPHONY_ENDPOINTIDPAIR;
- PropDesc->MembersListCount = 0;
- PropDesc->PropTypeSet.Flags = 0;
- PropDesc->Reserved = 0;
-
- // buffer is big enough to hold the full data, add that
- if (PropertyRequest->ValueSize >= ulExpectedSize)
- {
- PKSPROPERTY_MEMBERSHEADER MembersHeader =
- PKSPROPERTY_MEMBERSHEADER(PropDesc + 1);
-
- // we're now adding the members header.
- PropDesc->MembersListCount = 1;
-
- MembersHeader->MembersFlags = KSPROPERTY_MEMBER_VALUES;
- MembersHeader->MembersSize = sizeof(KSTOPOLOGY_ENDPOINTIDPAIR);
- MembersHeader->MembersCount = countOfValidEndpointPairs;
- MembersHeader->Flags = 0;
-
- le = NULL;
- PKSTOPOLOGY_ENDPOINTIDPAIR returnData = (PKSTOPOLOGY_ENDPOINTIDPAIR) (MembersHeader + 1);
-
- for (le = m_EndpointPairs.Flink; le != &m_EndpointPairs; le = le->Flink)
- {
- ENDPOINT_PAIR_ENTRY *pRecord = CONTAINING_RECORD(le, ENDPOINT_PAIR_ENTRY, ListEntry);
- memcpy(returnData, &(pRecord->data), sizeof(pRecord->data));
- returnData++;
- }
-
- // tell them how much space we really used, which controls how much data is copied into the user buffer.
- PropertyRequest->ValueSize = ulExpectedSize;
- }
- else
- {
- // tell them how much space we really used, which controls how much data is copied into the user buffer.
- PropertyRequest->ValueSize = sizeof(KSPROPERTY_DESCRIPTION);
- }
-
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->ValueSize >= sizeof(ULONG))
- {
- // if return buffer can hold a ULONG, return the access flags.
- *(PULONG(PropertyRequest->Value)) = KSPROPERTY_TYPE_SET |KSPROPERTY_TYPE_GET;
- PropertyRequest->ValueSize = sizeof(ULONG);
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = ulExpectedSize;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
-
- ExReleaseFastMutex(&m_EndpointFastMutex);
- }
- else
- {
- ULONG cbNeeded = sizeof(KSTOPOLOGY_ENDPOINTIDPAIR);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSTOPOLOGY_ENDPOINTIDPAIR EndpointIdPair = static_cast<PKSTOPOLOGY_ENDPOINTIDPAIR>(PropertyRequest->Value);
-
- // Return endpoints (render and capture) info where cellular audio is being routed to.
- memcpy(&(EndpointIdPair->RenderEndpoint), &m_CellularRenderEndpoint, sizeof(m_CellularRenderEndpoint));
- memcpy(&(EndpointIdPair->CaptureEndpoint), &m_CellularCaptureEndpoint, sizeof(m_CellularCaptureEndpoint));
-
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)
- {
- PKSTOPOLOGY_ENDPOINTIDPAIR EndpointIdPair = static_cast<PKSTOPOLOGY_ENDPOINTIDPAIR>(PropertyRequest->Value);
- PLIST_ENTRY le = NULL;
-
- // verify the requested combination is in the list of valid endpoint combinations, fail with
- // invalid parameter if not found.
- ntStatus = STATUS_INVALID_PARAMETER;
-
- ExAcquireFastMutex(&m_EndpointFastMutex);
-
- for (le = m_EndpointPairs.Flink; le != &m_EndpointPairs; le = le->Flink)
- {
- ENDPOINT_PAIR_ENTRY *pRecord = CONTAINING_RECORD(le, ENDPOINT_PAIR_ENTRY, ListEntry);
-
- if (pRecord->data.RenderEndpoint.PinId == EndpointIdPair->RenderEndpoint.PinId &&
- 0 == _wcsnicmp(pRecord->data.RenderEndpoint.TopologyName, EndpointIdPair->RenderEndpoint.TopologyName, MAX_PATH) &&
- pRecord->data.CaptureEndpoint.PinId == EndpointIdPair->CaptureEndpoint.PinId &&
- 0 == _wcsnicmp(pRecord->data.CaptureEndpoint.TopologyName, EndpointIdPair->CaptureEndpoint.TopologyName, MAX_PATH))
- {
- if (HOSTRENDER_PIN == EndpointIdPair->RenderEndpoint.PinId &&
- 0 == _wcsnicmp(HOSTRENDER_TOPONAME, EndpointIdPair->RenderEndpoint.TopologyName, MAX_PATH) &&
- HOSTCAPTURE_PIN == EndpointIdPair->CaptureEndpoint.PinId &&
- 0 == _wcsnicmp(HOSTCAPTURE_TOPONAME, EndpointIdPair->CaptureEndpoint.TopologyName, MAX_PATH))
- {
- // This is an indication that cellular audio is being routed through OS (For example, user plugs in USB headset
- // for cellular audio) and driver must stop rendering cellular audio to any physical audio endpoint. Driver must
- // also stop capturing data from any physical audio endpoint for cellular. This will update audio routing for
- // all the active cellular calls.
- }
- else
- {
- // Route cellular audio to these new endpoints (render and capture). This will update audio routing for
- // all the active cellular calls.
- }
-
- memcpy(&m_CellularRenderEndpoint, &(EndpointIdPair->RenderEndpoint), sizeof(m_CellularRenderEndpoint));
- memcpy(&m_CellularCaptureEndpoint, &(EndpointIdPair->CaptureEndpoint), sizeof(m_CellularCaptureEndpoint));
-
- // we found the entry, so return success
- ntStatus = STATUS_SUCCESS;
- break;
- }
- }
-
- ExReleaseFastMutex(&m_EndpointFastMutex);
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-CCellularMiniportTopology::PropertyHandlerTelephonyVolume
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_TelephonyTopology, KSPROPERTY_TELEPHONY_VOLUME )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
-
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerTelephonyVolume]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupportVolume
- (
- PropertyRequest,
- 1 // Telephony audio is only ever 1 channel
- );
-
- ULONG cbFullProperty =
- sizeof(KSPROPERTY_DESCRIPTION) +
- sizeof(KSPROPERTY_MEMBERSHEADER) +
- sizeof(KSPROPERTY_STEPPING_LONG);
-
- if (NT_SUCCESS(ntStatus) && PropertyRequest->ValueSize >= cbFullProperty)
- {
- // Access proper values
- PKSPROPERTY_DESCRIPTION PropDesc =
- PKSPROPERTY_DESCRIPTION(PropertyRequest->Value);
- PKSPROPERTY_MEMBERSHEADER Members =
- PKSPROPERTY_MEMBERSHEADER(PropDesc + 1);
- PKSPROPERTY_STEPPING_LONG Range =
- PKSPROPERTY_STEPPING_LONG(Members + 1);
-
- // Telephony volume is only ever single channel, so the
- // MULTICHANNEL and UNIFORM flags are meaningless
- Members->Flags = 0;
-
- // Telephony Values that may be different from standard volume values
- Range->Bounds.SignedMaximum = TELEPHONY_VOLUME_MAXIMUM;
- Range->Bounds.SignedMinimum = TELEPHONY_VOLUME_MINIMUM;
- Range->SteppingDelta = TELEPHONY_VOLUME_STEPPING;
- }
- }
- else
- {
- ntStatus =
- ValidatePropertyParams
- (
- PropertyRequest,
- sizeof(LONG), // volume value is a LONG
- 0 // there is no channel associated with telephony volume
- );
-
-
- if (NT_SUCCESS(ntStatus))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- LONG* volume = (LONG*)PropertyRequest->Value;
- // Return current cellular volume (Incall volume).
- *volume = m_CellularVolume;
- PropertyRequest->ValueSize = sizeof(LONG);
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)
- {
- LONG* volume = (LONG*)PropertyRequest->Value;
-
- LONG normalizedVolume =
- VALUE_NORMALIZE_IN_RANGE_EX
- (
- *volume,
- TELEPHONY_VOLUME_MINIMUM,
- TELEPHONY_VOLUME_MAXIMUM,
- TELEPHONY_VOLUME_STEPPING
- );
- if (normalizedVolume == *volume)
- {
- // Update the cellular volume (Incall volume). This will update cellular volume for all the active cellular calls.
- m_CellularVolume = *volume;
- ntStatus = STATUS_SUCCESS;
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_CellularTopoFilter
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Redirects property request to miniport object
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_CellularTopoFilter]"));
-
- // PropertryRequest structure is filled by portcls.
- // MajorTarget is a pointer to miniport object for miniports.
- //
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- PCCellularMiniportTopology pMiniport = reinterpret_cast<PCCellularMiniportTopology>(PropertyRequest->MajorTarget);
-
- if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_Jack))
- {
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION)
- {
- ntStatus = pMiniport->PropertyHandlerJackDescription(PropertyRequest);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION2)
- {
- ntStatus = pMiniport->PropertyHandlerJackDescription2(PropertyRequest);
- }
- }
- else if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_TelephonyTopology))
- {
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_TELEPHONY_ENDPOINTIDPAIR)
- {
- ntStatus = pMiniport->PropertyHandlerTelephonyEndpointIdPair(PropertyRequest);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_TELEPHONY_VOLUME)
- {
- ntStatus = pMiniport->PropertyHandlerTelephonyVolume(PropertyRequest);
- }
- }
-
- return ntStatus;
-} // PropertyHandler_CellularTopoFilter
-
-#pragma code_seg("PAGE")
-STDMETHODIMP_(NTSTATUS)
-CCellularMiniportTopology::UpdateTopologyJackState
-(
- _In_ ULONG TelephonyId,
- _In_ BOOL NewState
-)
-{
- PAGED_CODE ();
-
- struct JackState
- {
- ULONG TelephonyId;
- ULONG PinId;
- PKSJACK_DESCRIPTION JackControl;
- };
-
- JackState Jacks[] =
- {
- {
- 0,
- KSPIN_TOPO_BIDI1,
- &CellularJackDesc
- },
- {
- 1,
- KSPIN_TOPO_BIDI2,
- &CellularJackDesc2
- }
- };
-
- // Query the registry and update the jack state for all of the pins.
- for (int i = 0; i < SIZEOF_ARRAY(Jacks); i++)
- {
- if (Jacks[i].TelephonyId == TelephonyId)
- {
- Jacks[i].JackControl->IsConnected = NewState;
-
- // we have multiple pins which share the same jack state,
- // notify for every pin using that jack state
- GenerateEventList(
- (GUID*)&KSEVENTSETID_PinCapsChange, // event set. NULL is a wild card for all events.
- KSEVENT_PINCAPS_JACKINFOCHANGE, // event ID.
- TRUE, // use pid ID.
- Jacks[i].PinId, // pin ID.
- FALSE, // do not use node ID.
- ULONG(-1)); // node ID, not used.
- }
- }
-
- return STATUS_SUCCESS;
-}
-
-#pragma code_seg()
-NTSTATUS CCellularMiniportWaveRT_EventHandler_JackState
-(
- _In_ PPCEVENT_REQUEST EventRequest
-)
-{
- CCellularMiniportTopology* miniport = reinterpret_cast<CCellularMiniportTopology*>(EventRequest->MajorTarget);
- return miniport->EventHandler_JackState(EventRequest);
-}
-
-NTSTATUS CCellularMiniportTopology::EventHandler_JackState
-(
- _In_ PPCEVENT_REQUEST EventRequest
-)
-{
- if (EventRequest->Verb == PCEVENT_VERB_ADD)
- {
- m_PortEvents->AddEventToEventList(EventRequest->EventEntry);
- }
-
- return STATUS_SUCCESS;
-}
-
-#pragma code_seg("PAGE")
-STDMETHODIMP_(NTSTATUS)
-CCellularMiniportTopology::NotifyEndpointPair
-(
- _In_ WCHAR *RenderEndpointTopoName,
- _In_ ULONG RenderEndpointNameLen,
- _In_ ULONG RenderPinId,
- _In_ WCHAR *CaptureEndpointTopoName,
- _In_ ULONG CaptureEndpointNameLen,
- _In_ ULONG CapturePinId
-)
-{
- PAGED_CODE ();
-
- NTSTATUS ntStatus = STATUS_SUCCESS;
-
- ENDPOINT_PAIR_ENTRY *newEntry = new(NonPagedPoolNx, MINADAPTER_POOLTAG) ENDPOINT_PAIR_ENTRY;
-
- if (!newEntry)
- {
- DPF(D_TERSE, ("Insufficient memory to create endpoint pair"));
- ntStatus = STATUS_INSUFFICIENT_RESOURCES;
- }
-
- if (NT_SUCCESS(ntStatus))
- {
- KSTOPOLOGY_ENDPOINTIDPAIR *endpointPair = &newEntry->data;
-
- RtlStringCchCopyNW(endpointPair->RenderEndpoint.TopologyName,
- SIZEOF_ARRAY(endpointPair->RenderEndpoint.TopologyName),
- RenderEndpointTopoName,
- RenderEndpointNameLen);
- endpointPair->RenderEndpoint.PinId = RenderPinId;
-
- RtlStringCchCopyNW(endpointPair->CaptureEndpoint.TopologyName,
- SIZEOF_ARRAY(endpointPair->CaptureEndpoint.TopologyName),
- CaptureEndpointTopoName,
- CaptureEndpointNameLen);
- endpointPair->CaptureEndpoint.PinId = CapturePinId;
-
- ExAcquireFastMutex(&m_EndpointFastMutex);
- InsertTailList(&m_EndpointPairs, &newEntry->ListEntry);
- ExReleaseFastMutex(&m_EndpointFastMutex);
-
- GenerateEventList(
- (GUID*)&KSEVENTSETID_Telephony,
- KSEVENT_TELEPHONY_ENDPOINTPAIRS_CHANGED,
- FALSE,
- NULL,
- FALSE,
- ULONG(-1));
- }
-
- return ntStatus;
-}
-
-#pragma code_seg()
-NTSTATUS CCellularMiniportWaveRT_EventHandler_Telephony
-(
- _In_ PPCEVENT_REQUEST EventRequest
-)
-{
- CCellularMiniportTopology* miniport = reinterpret_cast<CCellularMiniportTopology*>(EventRequest->MajorTarget);
- return miniport->EventHandler_Telephony(EventRequest);
-}
-
-NTSTATUS CCellularMiniportTopology::EventHandler_Telephony
-(
- _In_ PPCEVENT_REQUEST EventRequest
-)
-{
- if (EventRequest->Verb == PCEVENT_VERB_ADD)
- {
- m_PortEvents->AddEventToEventList(EventRequest->EventEntry);
- }
-
- return STATUS_SUCCESS;
-}
-
-
diff --git a/audio/sysvad/PhoneAudioSample/Cellulartopo.h b/audio/sysvad/PhoneAudioSample/Cellulartopo.h
deleted file mode 100644
index b898741c..00000000
--- a/audio/sysvad/PhoneAudioSample/Cellulartopo.h
+++ /dev/null
@@ -1,184 +0,0 @@
-
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- cellulartopo.h
-
-Abstract:
-
- Declaration of topology miniport for the cellular endpoint.
-
---*/
-
-#ifndef _SYSVAD_CELLULARTOPO_H_
-#define _SYSVAD_CELLULARTOPO_H_
-
-#include "basetopo.h"
-
-// make sure all of these names matches with KSNAME_* in the inf's [Strings] section
-#define SPEAKER_TOPONAME L"TopologySpeaker"
-#define SPEAKER_HEADSET_TOPONAME L"TopologySpeakerHeadset"
-#define MIC_HEADSET_TOPONAME L"TopologyMicHeadset"
-#define MIC_ARRAY1_TOPONAME L"TopologyMicArray1"
-#define HANDSET_SPEAKER_TOPONAME L"TopologyHandsetSpeaker"
-#define HANDSET_MIC_TOPONAME L"TopologyHandsetMic"
-
-// from bthhfpminipairs.h, static name of bluetooth speaker and mic topologies
-#define HFP_SPEAKER_TOPONAME L"TopologyBthHfpSpeaker"
-#define HFP_MIC_TOPONAME L"TopologyBthHfpMic"
-
-// Special routing endpoints
-#define HOSTRENDER_TOPONAME L"HostRender"
-#define HOSTRENDER_PIN 0
-#define HOSTCAPTURE_TOPONAME L"HostCapture"
-#define HOSTCAPTURE_PIN 0
-
-// Telephony Volume Stepping information
-#define TELEPHONY_VOLUME_MAXIMUM 0 // 0 dB
-#define TELEPHONY_VOLUME_MINIMUM (-30 * 0x10000) // -30 dB
-#define TELEPHONY_VOLUME_STEPPING (3 * 0x10000) // 10 steps
-
-
-typedef struct _ENDPOINT_PAIR_ENTRY
-{
- LIST_ENTRY ListEntry;
- KSTOPOLOGY_ENDPOINTIDPAIR data;
-} ENDPOINT_PAIR_ENTRY;
-
-//=============================================================================
-// Defines
-//=============================================================================
-// {3829F9C3-F341-4B82-976F-A635EB3CEA0D}
-DEFINE_GUID(IID_ICellularTopology,
-0x3829f9c3, 0xf341, 0x4b82, 0x97, 0x6f, 0xa6, 0x35, 0xeb, 0x3c, 0xea, 0xd);
-
-
-//=============================================================================
-// Interfaces
-//=============================================================================
-
-///////////////////////////////////////////////////////////////////////////////
-// ICellularTopology
-//
-DECLARE_INTERFACE_(ICellularTopology, IMiniportTopology)
-{
- STDMETHOD_(NTSTATUS, UpdateTopologyJackState)
- (
- THIS_
- _In_ ULONG TelephonyId,
- _In_ BOOL NewState
- ) PURE;
-};
-
-typedef ICellularTopology *PCELLULARTOPOLOGY;
-
-//=============================================================================
-// Classes
-//=============================================================================
-
-///////////////////////////////////////////////////////////////////////////////
-// CCellularMiniportTopology
-//
-
-class CCellularMiniportTopology :
- public CMiniportTopologySYSVAD,
- public ICellularTopology,
- public IMiniportChange,
- public CUnknown
-{
- private:
- KSTOPOLOGY_ENDPOINTID m_CellularRenderEndpoint;
- KSTOPOLOGY_ENDPOINTID m_CellularCaptureEndpoint;
- ULONG m_CellularVolume;
-
- FAST_MUTEX m_EndpointFastMutex;
- LIST_ENTRY m_EndpointPairs;
-
- public:
- DECLARE_STD_UNKNOWN();
- CCellularMiniportTopology
- (
- _In_opt_ PUNKNOWN UnknownOuter,
- _In_ PCFILTER_DESCRIPTOR *FilterDesc,
- _In_ USHORT DeviceMaxChannels
- );
-
- ~CCellularMiniportTopology();
-
- IMP_IMiniportTopology;
-
- NTSTATUS PropertyHandlerJackSinkInfo
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerJackDescription
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerJackDescription2
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerTelephonyEndpointIdPair
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerTelephonyVolume
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS EventHandler_JackState
- (
- _In_ PPCEVENT_REQUEST _pEventRequest
- );
-
- STDMETHODIMP_(NTSTATUS) UpdateTopologyJackState
- (
- _In_ ULONG TelephonyId,
- _In_ BOOL NewState
- );
-
- NTSTATUS EventHandler_Telephony
- (
- _In_ PPCEVENT_REQUEST _pEventRequest
- );
-
- STDMETHODIMP_(NTSTATUS) NotifyEndpointPair
- (
- _In_ WCHAR *RenderEndpointTopoName,
- _In_ ULONG RenderEndpointNameLen,
- _In_ ULONG RenderPinId,
- _In_ WCHAR *CaptureEndpointTopoName,
- _In_ ULONG CaptureEndpointNameLen,
- _In_ ULONG CapturePinId
- );
-};
-
-typedef CCellularMiniportTopology *PCCellularMiniportTopology;
-
-NTSTATUS
-CreateCellularMiniportTopology(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
- );
-
-NTSTATUS PropertyHandler_CellularTopoFilter(_In_ PPCPROPERTY_REQUEST PropertyRequest);
-
-#endif // _SYSVAD_CELLULARTOPO_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/Cellulartoptable.h b/audio/sysvad/PhoneAudioSample/Cellulartoptable.h
deleted file mode 100644
index 53eef9ae..00000000
--- a/audio/sysvad/PhoneAudioSample/Cellulartoptable.h
+++ /dev/null
@@ -1,267 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- cellulartoptable.h
-
-Abstract:
-
- Declaration of topology tables for the cellular endpoint.
-
---*/
-
-#ifndef _SYSVAD_CELLULARTOPTABLE_H_
-#define _SYSVAD_CELLULARTOPTABLE_H_
-
-// {896BC350-BF57-4039-A6B6-64DCEC3AEEB8}
-DEFINE_GUID(CELLULARBIDI1_CUSTOM_NAME,
-0x896bc350, 0xbf57, 0x4039, 0xa6, 0xb6, 0x64, 0xdc, 0xec, 0x3a, 0xee, 0xb8);
-
-// {80CC64DA-166A-4A2C-ADF7-1464C49D3B0E}
-DEFINE_GUID(CELLULARBIDI2_CUSTOM_NAME,
-0x80cc64da, 0x166a, 0x4a2c, 0xad, 0xf7, 0x14, 0x64, 0xc4, 0x9d, 0x3b, 0xe);
-
-//=============================================================================
-static
-KSDATARANGE CellularTopoPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-//=============================================================================
-static
-PKSDATARANGE CellularTopoPinDataRangePointersBridge[] =
-{
- &CellularTopoPinDataRangesBridge[0]
-};
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR CellularTopoMiniportPins[] =
-{
- // KSPIN_TOPO_BIDI1
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(CellularTopoPinDataRangePointersBridge), // DataRangesCount
- CellularTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_IN, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSNODETYPE_TELEPHONY_BIDI, // Category
- &CELLULARBIDI1_CUSTOM_NAME, // Name
- 0 // Reserved
- }
- },
- // KSPIN_TOPO_BIDI1_BRIDGE
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(CellularTopoPinDataRangePointersBridge), // DataRangesCount
- CellularTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_OUT, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSCATEGORY_AUDIO, // Category
- NULL, // Name
- 0 // Reserved
- }
- },
- // KSPIN_TOPO_BIDI2
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(CellularTopoPinDataRangePointersBridge), // DataRangesCount
- CellularTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_IN, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSNODETYPE_TELEPHONY_BIDI, // Category
- &CELLULARBIDI2_CUSTOM_NAME, // Name
- 0 // Reserved
- }
- },
- // KSPIN_TOPO_BIDI2_BRIDGE
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(CellularTopoPinDataRangePointersBridge), // DataRangesCount
- CellularTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_OUT, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSCATEGORY_AUDIO, // Category
- NULL, // Name
- 0 // Reserved
- }
- }
-};
-
-//=============================================================================
-static
-KSJACK_DESCRIPTION CellularJackDesc =
-{
- KSAUDIO_SPEAKER_MONO,
- 0x0000, // no color
- eConnTypeUnknown,
- eGeoLocNotApplicable,
- eGenLocInternal,
- ePortConnUnknown,
- TRUE // NOTE: cellular jacks should be "unplugged" at boot, and only changed to active during a call.
- // However, for convienience during development, the jack state is set to active at boot for this milestone.
-};
-
-static
-KSJACK_DESCRIPTION CellularJackDesc2 =
-{
- KSAUDIO_SPEAKER_MONO,
- 0x0000, // no color
- eConnTypeUnknown,
- eGeoLocNotApplicable,
- eGenLocInternal,
- ePortConnUnknown,
- TRUE // NOTE: cellular jacks should be "unplugged" at boot, and only changed to active during a call.
- // However, for convienience during development, the jack state is set to active at boot for this milestone.
-};
-
-
-// Only return a KSJACK_DESCRIPTION for the physical bridge pin.
-static
-PKSJACK_DESCRIPTION CellularJackDescriptions[] =
-{
- &CellularJackDesc,
- NULL,
- &CellularJackDesc2,
- NULL
-};
-
-//=============================================================================
-static
-PCCONNECTION_DESCRIPTOR CellularTopoMiniportConnections[] =
-{
- // FromNode, FromPin, ToNode, ToPin
- { PCFILTER_NODE, KSPIN_TOPO_BIDI1, PCFILTER_NODE, KSPIN_TOPO_BIDI1_BRIDGE},
- { PCFILTER_NODE, KSPIN_TOPO_BIDI2, PCFILTER_NODE, KSPIN_TOPO_BIDI2_BRIDGE}
-};
-
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesCellularTopoFilter[] =
-{
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularTopoFilter
- },
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularTopoFilter
- },
- {
- &KSPROPSETID_TelephonyTopology,
- KSPROPERTY_TELEPHONY_ENDPOINTIDPAIR,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularTopoFilter
- },
- {
- &KSPROPSETID_TelephonyTopology,
- KSPROPERTY_TELEPHONY_VOLUME,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularTopoFilter
- }
-};
-
-NTSTATUS CCellularMiniportWaveRT_EventHandler_JackState
-(
- _In_ PPCEVENT_REQUEST EventRequest
-);
-
-NTSTATUS CCellularMiniportWaveRT_EventHandler_Telephony
-(
- _In_ PPCEVENT_REQUEST EventRequest
-);
-
-
-static PCEVENT_ITEM TelephonyEvents[] =
-{
- {
- &KSEVENTSETID_PinCapsChange, // Something changed
- KSEVENT_PINCAPS_JACKINFOCHANGE, // Jack Info Changes
- KSEVENT_TYPE_ENABLE | KSEVENT_TYPE_BASICSUPPORT,
- CCellularMiniportWaveRT_EventHandler_JackState
- },
- {
- &KSEVENTSETID_Telephony,
- KSEVENT_TELEPHONY_ENDPOINTPAIRS_CHANGED,
- KSEVENT_TYPE_ENABLE | KSEVENT_TYPE_BASICSUPPORT,
- CCellularMiniportWaveRT_EventHandler_Telephony
- }
-};
-
-/*****************************************************************************
- * PropertiesTopologyFilter
- *****************************************************************************
- * Automation table for jack descripton/detection.
- */
-DEFINE_PCAUTOMATION_TABLE_PROP_EVENT(AutomationCellularTopoFilter, PropertiesCellularTopoFilter, TelephonyEvents);
-
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR CellularTopoMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationCellularTopoFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(CellularTopoMiniportPins), // PinCount
- CellularTopoMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- 0, // NodeCount
- NULL, // Nodes
- SIZEOF_ARRAY(CellularTopoMiniportConnections), // ConnectionCount
- CellularTopoMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories
-};
-
-#endif // _SYSVAD_CELLULARTOPTABLE_H_
-
-
diff --git a/audio/sysvad/PhoneAudioSample/Cellularwavtable.h b/audio/sysvad/PhoneAudioSample/Cellularwavtable.h
deleted file mode 100644
index 806cb05d..00000000
--- a/audio/sysvad/PhoneAudioSample/Cellularwavtable.h
+++ /dev/null
@@ -1,286 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- cellularwavtable.h
-
-Abstract:
-
- Declaration of wave miniport tables for the cellular endpoint.
-
---*/
-
-#ifndef _SYSVAD_CELLULARWAVTABLE_H_
-#define _SYSVAD_CELLULARWAVTABLE_H_
-
-
-#define CELLULAR_DEVICE_MAX_CHANNELS 1 // Max Channels.
-
-#define CELLULAR_CAPTURE_MAX_CHANNELS 1 // Max Channels.
-#define CELLULAR_CAPTURE_MIN_BITS_PER_SAMPLE 16 // Min Bits Per Sample
-#define CELLULAR_CAPTURE_MAX_BITS_PER_SAMPLE 16 // Max Bits Per Sample
-#define CELLULAR_CAPTURE_MIN_SAMPLE_RATE 16000 // Min Sample Rate
-#define CELLULAR_CAPTURE_MAX_SAMPLE_RATE 16000 // Max Sample Rate
-
-//
-// Max # of pin instances.
-//
-#define CELLULAR_MAX_INPUT_SYSTEM_STREAMS 1
-
-
-//=============================================================================
-static
-KSDATAFORMAT_WAVEFORMATEXTENSIBLE CellularCapturePinSupportedDeviceFormats[] =
-{
- { // 0
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 16000,
- 32000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
-};
-
-//
-// Supported modes (only on streaming pins).
-//
-static
-MODE_AND_DEFAULT_FORMAT CellularCapturePinSupportedDeviceModes[] =
-{
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_RAW,
- &CellularCapturePinSupportedDeviceFormats[SIZEOF_ARRAY(CellularCapturePinSupportedDeviceFormats) - 1].DataFormat
- }
-};
-
-//=============================================================================
-// The entries here must follow the same order as the filter's pin
-// descriptor array.
-//
-static
-PIN_DEVICE_FORMATS_AND_MODES CellularPinDeviceFormatsAndModes[] =
-{
- { // BIDI
- TelephonyBidiPin,
- CellularCapturePinSupportedDeviceFormats,
- SIZEOF_ARRAY(CellularCapturePinSupportedDeviceFormats),
- CellularCapturePinSupportedDeviceModes,
- SIZEOF_ARRAY(CellularCapturePinSupportedDeviceModes)
- },
- {
- BridgePin,
- NULL,
- 0,
- NULL,
- 0,
- }
-};
-
-//=============================================================================
-static
-KSDATARANGE_AUDIO CellularPinDataRangesStream[] =
-{
- { // 0
- {
- sizeof(KSDATARANGE_AUDIO),
- KSDATARANGE_ATTRIBUTES, // An attributes list follows this data range
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- CELLULAR_CAPTURE_MAX_CHANNELS,
- CELLULAR_CAPTURE_MIN_BITS_PER_SAMPLE,
- CELLULAR_CAPTURE_MAX_BITS_PER_SAMPLE,
- CELLULAR_CAPTURE_MIN_SAMPLE_RATE,
- CELLULAR_CAPTURE_MAX_SAMPLE_RATE
- }
-};
-
-static
-PKSDATARANGE CellularPinDataRangePointersBiDiStream[] =
-{
- PKSDATARANGE(&CellularPinDataRangesStream[0]),
- PKSDATARANGE(&PinDataRangeAttributeList)
-};
-
-//=============================================================================
-static
-KSDATARANGE CellularPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-static
-PKSDATARANGE CellularPinDataRangePointersBridge[] =
-{
- &CellularPinDataRangesBridge[0]
-};
-
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR CellularWaveMiniportPins[] =
-{
- // Wave Out Streaming Pin (Renderer) KSPIN_WAVE_BIDI
- {
- CELLULAR_MAX_INPUT_SYSTEM_STREAMS,
- CELLULAR_MAX_INPUT_SYSTEM_STREAMS,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(CellularPinDataRangePointersBiDiStream),
- CellularPinDataRangePointersBiDiStream,
- KSPIN_DATAFLOW_OUT,
- KSPIN_COMMUNICATION_SINK,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
- // Wave Out Bridge Pin (Renderer) KSPIN_WAVE_BIDI_BRIDGE
- {
- 0,
- 0,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(CellularPinDataRangePointersBridge),
- CellularPinDataRangePointersBridge,
- KSPIN_DATAFLOW_IN,
- KSPIN_COMMUNICATION_NONE,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- }
-};
-
-//=============================================================================
-//
-// Note:
-//
-// -----
-// | |
-// BiDi pin 1 <--| |<-- 0 BiDi bridge pin
-// -----
-
-static
-PCCONNECTION_DESCRIPTOR CellularWaveMiniportConnections[] =
-{
- { PCFILTER_NODE, KSPIN_WAVE_BIDI_BRIDGE, PCFILTER_NODE, KSPIN_WAVE_BIDI }
-};
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesCellularWaveFilter[] =
-{
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_TelephonyControl,
- KSPROPERTY_TELEPHONY_PROVIDERID,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularWaveFilter
- },
- {
- &KSPROPSETID_TelephonyControl,
- KSPROPERTY_TELEPHONY_CALLINFO,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularWaveFilter
- },
- {
- &KSPROPSETID_TelephonyControl,
- KSPROPERTY_TELEPHONY_CALLCONTROL,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularWaveFilter
- },
- {
- &KSPROPSETID_TelephonyControl,
- KSPROPERTY_TELEPHONY_PROVIDERCHANGE,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularWaveFilter
- },
- {
- &KSPROPSETID_TelephonyControl,
- KSPROPERTY_TELEPHONY_CALLHOLD,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularWaveFilter
- },
- {
- &KSPROPSETID_TelephonyControl,
- KSPROPERTY_TELEPHONY_MUTE_TX,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_CellularWaveFilter
- },
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationCellularWaveFilter, PropertiesCellularWaveFilter);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR CellularWaveMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationCellularWaveFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(CellularWaveMiniportPins), // PinCount
- CellularWaveMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- 0, // NodeCount
- NULL, // Nodes
- SIZEOF_ARRAY(CellularWaveMiniportConnections), // ConnectionCount
- CellularWaveMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories - use defaults (audio, render, capture)
-};
-
-#endif // _SYSVAD_CELLULARWAVTABLE_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/FMTopTable.h b/audio/sysvad/PhoneAudioSample/FMTopTable.h
deleted file mode 100644
index ae8ddf9e..00000000
--- a/audio/sysvad/PhoneAudioSample/FMTopTable.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- fmtoptable.h
-
-Abstract:
-
- Declaration of topology tables for the fm endpoint.
-
---*/
-
-#ifndef _SYSVAD_FMTOPTABLE_H_
-#define _SYSVAD_FMTOPTABLE_H_
-
-// {344EC7D7-F209-4FC4-B6C1-B324E8309E8D}
-DEFINE_GUID(FMRX_CUSTOM_NAME,
- 0x344ec7d7, 0xf209, 0x4fc4, 0xb6, 0xc1, 0xb3, 0x24, 0xe8, 0x30, 0x9e, 0x8d);
-
-//=============================================================================
-static
-KSDATARANGE FmTopoPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-//=============================================================================
-static
-PKSDATARANGE FmTopoPinDataRangePointersBridge[] =
-{
- &FmTopoPinDataRangesBridge[0]
-};
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR FmTopoMiniportPins[] =
-{
- // KSPIN_TOPO_FMRX
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(FmTopoPinDataRangePointersBridge), // DataRangesCount
- FmTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_IN, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSNODETYPE_FM_RX, // Category
- &FMRX_CUSTOM_NAME, // Name
- 0 // Reserved
- }
- },
- // KSPIN_TOPO_FMRX_BRIDGE
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(FmTopoPinDataRangePointersBridge), // DataRangesCount
- FmTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_OUT, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSCATEGORY_AUDIO, // Category
- NULL, // Name
- 0 // Reserved
- }
- },
-};
-
-//=============================================================================
-static
-KSJACK_DESCRIPTION FmRxJackDesc =
-{
- KSAUDIO_SPEAKER_STEREO,
- 0x0000, // no color
- eConnTypeOtherAnalog,
- eGeoLocNotApplicable,
- eGenLocInternal,
- ePortConnUnknown,
- FALSE
-};
-
-// Only return a KSJACK_DESCRIPTION for the physical bridge pin.
-static
-PKSJACK_DESCRIPTION FmJackDescriptions[] =
-{
- &FmRxJackDesc,
- NULL,
-};
-
-//=============================================================================
-static
-PCCONNECTION_DESCRIPTOR FmTopoMiniportConnections[] =
-{
- // FromNode, FromPin, ToNode, ToPin
- { PCFILTER_NODE, KSPIN_TOPO_FMRX, PCFILTER_NODE, KSPIN_TOPO_FMRX_BRIDGE},
-};
-
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesFmTopoFilter[] =
-{
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_FmRxTopoFilter
- },
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_FmRxTopoFilter
- },
- {
- &KSPROPSETID_FMRXTopology,
- KSPROPERTY_FMRX_ENDPOINTID,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_FmRxTopoFilter
- },
- {
- &KSPROPSETID_FMRXTopology,
- KSPROPERTY_FMRX_VOLUME,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_FmRxTopoFilter
- },
- {
- &KSPROPSETID_FMRXTopology,
- KSPROPERTY_FMRX_ANTENNAENDPOINTID,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_FmRxTopoFilter
- },
-};
-
-NTSTATUS CFmMiniportWaveRT_EventHandler_JackState
-(
- _In_ PPCEVENT_REQUEST EventRequest
-);
-
-static PCEVENT_ITEM FmRxJackInfoChangeEvent[] =
-{
- {
- &KSEVENTSETID_PinCapsChange, // Something changed
- KSEVENT_PINCAPS_JACKINFOCHANGE, // Jack Info Changes
- KSEVENT_TYPE_ENABLE | KSEVENT_TYPE_BASICSUPPORT,
- CFmMiniportWaveRT_EventHandler_JackState
- }
-};
-
-/*****************************************************************************
- * PropertiesTopologyFilter
- *****************************************************************************
- * Automation table for jack descripton/detection.
- */
-DEFINE_PCAUTOMATION_TABLE_PROP_EVENT(AutomationFmTopoFilter, PropertiesFmTopoFilter, FmRxJackInfoChangeEvent);
-
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR FmTopoMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationFmTopoFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(FmTopoMiniportPins), // PinCount
- FmTopoMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- 0, // NodeCount
- NULL, // Nodes
- SIZEOF_ARRAY(FmTopoMiniportConnections), // ConnectionCount
- FmTopoMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories
-};
-
-#endif // _SYSVAD_FMTOPTABLE_H_
-
-
diff --git a/audio/sysvad/PhoneAudioSample/FMTopo.cpp b/audio/sysvad/PhoneAudioSample/FMTopo.cpp
deleted file mode 100644
index 9c43168f..00000000
--- a/audio/sysvad/PhoneAudioSample/FMTopo.cpp
+++ /dev/null
@@ -1,985 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- fmtopo.cpp
-
-Abstract:
-
- Implementation of topology miniport for the fm endpoint.
-
---*/
-
-#pragma warning (disable : 4127)
-
-#include <sysvad.h>
-#include "simple.h"
-#include "mintopo.h"
-#include "fmtopo.h"
-#include "fmtoptable.h"
-#include <ntstrsafe.h>
-
-
-#pragma code_seg("PAGE")
-
-// Table of valid render endpoints for FM
-KSTOPOLOGY_ENDPOINTID g_EndpointList[] =
-{
- { SPEAKER_TOPONAME, KSPIN_TOPO_LINEOUT_DEST },
- { SPEAKER_HEADSET_TOPONAME, KSPIN_TOPO_LINEOUT_DEST },
- { HOSTRENDER_TOPONAME, HOSTRENDER_PIN }
-};
-
-KSTOPOLOGY_ENDPOINTID g_AntennaEndpoint =
-{
- SPEAKER_HEADSET_TOPONAME, KSPIN_TOPO_LINEOUT_DEST
-};
-
-//=============================================================================
-NTSTATUS
-CreateFmMiniportTopology
-(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
-)
-/*++
-
-Routine Description:
-
- Creates a new topology miniport.
-
-Arguments:
-
- Unknown -
-
- RefclsId -
-
- UnknownOuter -
-
- PoolType -
-
- UnknownAdapter -
-
- DeviceContext -
-
- MiniportPair -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(Unknown);
- ASSERT(MiniportPair);
-
- UNREFERENCED_PARAMETER(UnknownAdapter);
- UNREFERENCED_PARAMETER(DeviceContext);
-
- CFmMiniportTopology *obj =
- new (PoolType, MINWAVERT_POOLTAG)
- CFmMiniportTopology( UnknownOuter,
- MiniportPair->TopoDescriptor,
- MiniportPair->DeviceMaxChannels);
- if (NULL == obj)
- {
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- obj->AddRef();
- *Unknown = reinterpret_cast<IUnknown*>(obj);
-
- return STATUS_SUCCESS;
-} // CreateFmMiniportTopology
-
-CFmMiniportTopology::CFmMiniportTopology
-(
- _In_opt_ PUNKNOWN UnknownOuter,
- _In_ PCFILTER_DESCRIPTOR *FilterDesc,
- _In_ USHORT DeviceMaxChannels
-)
-: CUnknown(UnknownOuter),
- CMiniportTopologySYSVAD(FilterDesc, DeviceMaxChannels),
- m_FmRxVolume(FMRX_VOLUME_MAXIMUM)
-{
- PAGED_CODE();
-
- memcpy(&m_FmRxTargetEndpoint, &g_EndpointList[0], sizeof(m_FmRxTargetEndpoint));
-}
-
-
-//=============================================================================
-CFmMiniportTopology::~CFmMiniportTopology
-(
- void
-)
-/*++
-
-Routine Description:
-
- Topology miniport destructor
-
-Arguments:
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- DPF_ENTER(("[CFmMiniportTopology::~CFmMiniportTopology]"));
-} // ~CFmMiniportTopology
-
-//=============================================================================
-NTSTATUS
-CFmMiniportTopology::DataRangeIntersection
-(
- _In_ ULONG PinId,
- _In_ PKSDATARANGE ClientDataRange,
- _In_ PKSDATARANGE MyDataRange,
- _In_ ULONG OutputBufferLength,
- _Out_writes_bytes_to_opt_(OutputBufferLength, *ResultantFormatLength)
- PVOID ResultantFormat OPTIONAL,
- _Out_ PULONG ResultantFormatLength
-)
-/*++
-
-Routine Description:
-
- The DataRangeIntersection function determines the highest quality
- intersection of two data ranges.
-
-Arguments:
-
- PinId - Pin for which data intersection is being determined.
-
- ClientDataRange - Pointer to KSDATARANGE structure which contains the data range
- submitted by client in the data range intersection property
- request.
-
- MyDataRange - Pin's data range to be compared with client's data range.
-
- OutputBufferLength - Size of the buffer pointed to by the resultant format
- parameter.
-
- ResultantFormat - Pointer to value where the resultant format should be
- returned.
-
- ResultantFormatLength - Actual length of the resultant format that is placed
- at ResultantFormat. This should be less than or equal
- to OutputBufferLength.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- return
- CMiniportTopologySYSVAD::DataRangeIntersection
- (
- PinId,
- ClientDataRange,
- MyDataRange,
- OutputBufferLength,
- ResultantFormat,
- ResultantFormatLength
- );
-} // DataRangeIntersection
-
-//=============================================================================
-STDMETHODIMP
-CFmMiniportTopology::GetDescription
-(
- _Out_ PPCFILTER_DESCRIPTOR * OutFilterDescriptor
-)
-/*++
-
-Routine Description:
-
- The GetDescription function gets a pointer to a filter description.
- It provides a location to deposit a pointer in miniport's description
- structure. This is the placeholder for the FromNode or ToNode fields in
- connections which describe connections to the filter's pins.
-
-Arguments:
-
- OutFilterDescriptor - Pointer to the filter description.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(OutFilterDescriptor);
-
- return CMiniportTopologySYSVAD::GetDescription(OutFilterDescriptor);
-} // GetDescription
-
-//=============================================================================
-STDMETHODIMP
-CFmMiniportTopology::Init
-(
- _In_ PUNKNOWN UnknownAdapter,
- _In_ PRESOURCELIST ResourceList,
- _In_ PPORTTOPOLOGY Port_
-)
-/*++
-
-Routine Description:
-
- The Init function initializes the miniport. Callers of this function
- should run at IRQL PASSIVE_LEVEL
-
-Arguments:
-
- UnknownAdapter - A pointer to the Iuknown interface of the adapter object.
-
- ResourceList - Pointer to the resource list to be supplied to the miniport
- during initialization. The port driver is free to examine the
- contents of the ResourceList. The port driver will not be
- modify the ResourceList contents.
-
- Port - Pointer to the topology port object that is linked with this miniport.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- UNREFERENCED_PARAMETER(ResourceList);
-
- PAGED_CODE();
-
- ASSERT(UnknownAdapter);
- ASSERT(Port_);
-
- DPF_ENTER(("[CFmMiniportTopology::Init]"));
-
- NTSTATUS ntStatus;
-
- ntStatus =
- CMiniportTopologySYSVAD::Init
- (
- UnknownAdapter,
- Port_
- );
-
- return ntStatus;
-} // Init
-
-//=============================================================================
-STDMETHODIMP
-CFmMiniportTopology::NonDelegatingQueryInterface
-(
- _In_ REFIID Interface,
- _COM_Outptr_ PVOID * Object
-)
-/*++
-
-Routine Description:
-
- QueryInterface for MiniportTopology
-
-Arguments:
-
- Interface - GUID of the interface
-
- Object - interface object to be returned.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(Object);
-
- if (IsEqualGUIDAligned(Interface, IID_IUnknown))
- {
- *Object = PVOID(PUNKNOWN(this));
- }
- else if (IsEqualGUIDAligned(Interface, IID_IMiniport))
- {
- *Object = PVOID(PMINIPORT(this));
- }
- else if (IsEqualGUIDAligned(Interface, IID_IMiniportTopology))
- {
- *Object = PVOID(PMINIPORTTOPOLOGY(this));
- }
- else if (IsEqualGUIDAligned(Interface, IID_IFmTopology))
- {
- *Object = PVOID(PFMTOPOLOGY(this));
- }
- else
- {
- *Object = NULL;
- }
-
- if (*Object)
- {
- // We reference the interface for the caller.
- PUNKNOWN(*Object)->AddRef();
- return(STATUS_SUCCESS);
- }
-
- return(STATUS_INVALID_PARAMETER);
-} // NonDelegatingQueryInterface
-
-//=============================================================================
-NTSTATUS
-CFmMiniportTopology::PropertyHandlerJackDescription
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION )
-
-Arguments:
-
- PropertyRequest
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerJackDescription]"));
-
- ULONG cJackDescriptions = ARRAYSIZE(FmJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = FmJackDescriptions;
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION pDesc = (PKSJACK_DESCRIPTION)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlCopyMemory(pDesc, JackDescriptions[nPinId], sizeof(KSJACK_DESCRIPTION));
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-CFmMiniportTopology::PropertyHandlerJackDescription2
-(
-_In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
-Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION2 )
-
-Arguments:
-
-PropertyRequest -
-
-Return Value:
-
-NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerJackDescription2]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- ULONG cJackDescriptions = ARRAYSIZE(FmJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = FmJackDescriptions;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM)+sizeof(KSJACK_DESCRIPTION2);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION2 pDesc = (PKSJACK_DESCRIPTION2)(pMI + 1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlZeroMemory(pDesc, sizeof(KSJACK_DESCRIPTION2));
-
- //
- // Specifies the lower 16 bits of the DWORD parameter. This parameter indicates whether
- // the jack is currently active, streaming, idle, or hardware not ready.
- //
- pDesc->DeviceStateInfo = 0;
-
- //
- // From MSDN:
- // "If an audio device lacks jack presence detection, the IsConnected member of
- // the KSJACK_DESCRIPTION structure must always be set to TRUE. To remove the
- // ambiguity that results from this dual meaning of the TRUE value for IsConnected,
- // a client application can call IKsJackDescription2::GetJackDescription2 to read
- // the JackCapabilities flag of the KSJACK_DESCRIPTION2 structure. If this flag has
- // the JACKDESC2_PRESENCE_DETECT_CAPABILITY bit set, it indicates that the endpoint
- // does in fact support jack presence detection. In that case, the return value of
- // the IsConnected member can be interpreted to accurately reflect the insertion status
- // of the jack."
- //
- // Bit definitions:
- // 0x00000001 - JACKDESC2_PRESENCE_DETECT_CAPABILITY
- // 0x00000002 - JACKDESC2_DYNAMIC_FORMAT_CHANGE_CAPABILITY
- //
- pDesc->JackCapabilities = JACKDESC2_PRESENCE_DETECT_CAPABILITY;
-
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-CFmMiniportTopology::PropertyHandlerFmRxEndpointId
-(
-_In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
-Handles ( KSPROPSETID_FMRXTopology, KSPROPERTY_FMRX_ENDPOINTID )
-
-Arguments:
-
-PropertyRequest
-
-Return Value:
-
-NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerFmRxEndpointId]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- ULONG ulExpectedSize = (sizeof(KSPROPERTY_DESCRIPTION)+sizeof(KSPROPERTY_MEMBERSHEADER)+sizeof(g_EndpointList));
-
- if (PropertyRequest->ValueSize >= sizeof(KSPROPERTY_DESCRIPTION))
- {
- // if return buffer can hold a KSPROPERTY_DESCRIPTION, return it
- //
- PKSPROPERTY_DESCRIPTION PropDesc =
- PKSPROPERTY_DESCRIPTION(PropertyRequest->Value);
-
- PropDesc->AccessFlags = KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_GET;
- PropDesc->DescriptionSize = ulExpectedSize;
- PropDesc->PropTypeSet.Set = KSPROPSETID_FMRXTopology;
- PropDesc->PropTypeSet.Id = KSPROPERTY_FMRX_ENDPOINTID;
- PropDesc->PropTypeSet.Flags = 0;
- PropDesc->MembersListCount = 1;
- PropDesc->Reserved = 0;
-
- // buffer is big enough to hold the full data, add that
- if (PropertyRequest->ValueSize >= ulExpectedSize)
- {
- PKSPROPERTY_MEMBERSHEADER MembersHeader =
- PKSPROPERTY_MEMBERSHEADER(PropDesc + 1);
-
- MembersHeader->MembersFlags = KSPROPERTY_MEMBER_VALUES;
- MembersHeader->MembersSize = sizeof(KSTOPOLOGY_ENDPOINTID);
- MembersHeader->MembersCount = SIZEOF_ARRAY(g_EndpointList);
- MembersHeader->Flags = 0;
-
- memcpy(MembersHeader + 1, g_EndpointList, sizeof(g_EndpointList));
-
- // tell them how much space we really used, which controls how much data is copied into the user buffer.
- PropertyRequest->ValueSize = ulExpectedSize;
- }
- else
- {
- // tell them how much space we really used, which controls how much data is copied into the user buffer.
- PropertyRequest->ValueSize = sizeof(KSPROPERTY_DESCRIPTION);
- }
-
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->ValueSize >= sizeof(ULONG))
- {
- // if return buffer can hold a ULONG, return the access flags.
- *(PULONG(PropertyRequest->Value)) = KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_GET;
- PropertyRequest->ValueSize = sizeof(ULONG);
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = ulExpectedSize;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- }
- else
- {
- ntStatus =
- ValidatePropertyParams
- (
- PropertyRequest,
- sizeof(KSTOPOLOGY_ENDPOINTID),
- 0
- );
-
- if (NT_SUCCESS(ntStatus))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSTOPOLOGY_ENDPOINTID EndpointId = static_cast<PKSTOPOLOGY_ENDPOINTID>(PropertyRequest->Value);
-
- memcpy(EndpointId, &m_FmRxTargetEndpoint, sizeof(m_FmRxTargetEndpoint));
-
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)
- {
- PKSTOPOLOGY_ENDPOINTID EndpointId = static_cast<PKSTOPOLOGY_ENDPOINTID>(PropertyRequest->Value);
-
- ntStatus = STATUS_INVALID_PARAMETER;
- for (int i = 0; i < SIZEOF_ARRAY(g_EndpointList); i++)
- {
- if (g_EndpointList[i].PinId == EndpointId->PinId &&
- 0 == _wcsnicmp(g_EndpointList[i].TopologyName, EndpointId->TopologyName, MAX_PATH))
- {
- memcpy(&m_FmRxTargetEndpoint, EndpointId, sizeof(m_FmRxTargetEndpoint));
-
- if (HOSTRENDER_PIN == EndpointId->PinId &&
- 0 == _wcsnicmp(HOSTRENDER_TOPONAME, EndpointId->TopologyName, MAX_PATH))
- {
- // This is an indication that FM audio is being routed through OS (For example, user plugs in
- // USB headset for FM audio) and driver must stop rendering FM audio to any physical audio endpoint.
- }
- else
- {
- // Route FM audio to this new endpoint.
- }
- ntStatus = STATUS_SUCCESS;
- break;
- }
- }
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-CFmMiniportTopology::PropertyHandlerFmRxVolume
-(
-_In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
-Handles ( KSPROPSETID_FMRXTopology, KSPROPERTY_FMRX_VOLUME )
-
-Arguments:
-
-PropertyRequest
-
-Return Value:
-
-NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerFmRxVolume]"));
-
- UNREFERENCED_PARAMETER(PropertyRequest);
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupportVolume
- (
- PropertyRequest,
- 1 // FM audio technically supports Stereo, but we only support a single volume
- );
-
- ULONG cbFullProperty =
- sizeof(KSPROPERTY_DESCRIPTION)+
- sizeof(KSPROPERTY_MEMBERSHEADER)+
- sizeof(KSPROPERTY_STEPPING_LONG);
-
- if (NT_SUCCESS(ntStatus) && PropertyRequest->ValueSize >= cbFullProperty)
- {
- // Access proper values
- PKSPROPERTY_DESCRIPTION PropDesc =
- PKSPROPERTY_DESCRIPTION(PropertyRequest->Value);
- PKSPROPERTY_MEMBERSHEADER Members =
- PKSPROPERTY_MEMBERSHEADER(PropDesc + 1);
- PKSPROPERTY_STEPPING_LONG Range =
- PKSPROPERTY_STEPPING_LONG(Members + 1);
-
- Members->Flags = 0;
-
- Range->Bounds.SignedMaximum = FMRX_VOLUME_MAXIMUM;
- Range->Bounds.SignedMinimum = FMRX_VOLUME_MINIMUM;
- Range->SteppingDelta = FMRX_VOLUME_STEPPING;
- }
- }
- else
- {
- ntStatus =
- ValidatePropertyParams
- (
- PropertyRequest,
- sizeof(LONG), // volume value is a LONG
- 0 // No support for channel since this is a property
- // on the topo filter, not a volume node.
- );
-
-
- if (NT_SUCCESS(ntStatus))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- LONG* volume = (LONG*)PropertyRequest->Value;
- // Return current FM volume
- *volume = m_FmRxVolume;
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)
- {
- LONG* volume = (LONG*)PropertyRequest->Value;
-
- LONG normalizedVolume =
- VALUE_NORMALIZE_IN_RANGE_EX
- (
- *volume,
- FMRX_VOLUME_MINIMUM,
- FMRX_VOLUME_MAXIMUM,
- FMRX_VOLUME_STEPPING
- );
- if (normalizedVolume == *volume)
- {
- m_FmRxVolume = *volume;
- ntStatus = STATUS_SUCCESS;
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-CFmMiniportTopology::PropertyHandlerFmRxAntennaEndpointId
-(
-_In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
-Handles ( KSPROPSETID_FMRXTopology, KSPROPERTY_FMRX_ANTENNAENDPOINTID )
-
-Arguments:
-
-PropertyRequest
-
-Return Value:
-
-NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerFmRxAntennaEndpoint]"));
-
- UNREFERENCED_PARAMETER(PropertyRequest);
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ULONG flags = PropertyRequest->PropertyItem->Flags;
- ntStatus = PropertyHandler_BasicSupport(PropertyRequest, flags, VT_ILLEGAL);
- }
- else
- {
- ntStatus =
- ValidatePropertyParams
- (
- PropertyRequest,
- sizeof(KSTOPOLOGY_ENDPOINTID),
- 0
- );
-
-
- if (NT_SUCCESS(ntStatus))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSTOPOLOGY_ENDPOINTID pEndpointId = (PKSTOPOLOGY_ENDPOINTID)PropertyRequest->Value;
- memcpy(pEndpointId, &g_AntennaEndpoint, sizeof(*pEndpointId));
- ntStatus = STATUS_SUCCESS;
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_FmRxTopoFilter
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Redirects property request to miniport object
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_FmRxTopoFilter]"));
-
- // PropertryRequest structure is filled by portcls.
- // MajorTarget is a pointer to miniport object for miniports.
- //
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- PCFmMiniportTopology pMiniport = (PCFmMiniportTopology)PropertyRequest->MajorTarget;
-
- if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_Jack))
- {
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION)
- {
- ntStatus = pMiniport->PropertyHandlerJackDescription(PropertyRequest);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION2)
- {
- ntStatus = pMiniport->PropertyHandlerJackDescription2(PropertyRequest);
- }
- }
- else if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_FMRXTopology))
- {
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_FMRX_ENDPOINTID)
- {
- ntStatus = pMiniport->PropertyHandlerFmRxEndpointId(PropertyRequest);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_FMRX_VOLUME)
- {
- ntStatus = pMiniport->PropertyHandlerFmRxVolume(PropertyRequest);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_FMRX_ANTENNAENDPOINTID)
- {
- ntStatus = pMiniport->PropertyHandlerFmRxAntennaEndpointId(PropertyRequest);
- }
- }
-
- return ntStatus;
-} // PropertyHandler_FmRxTopoFilter
-
-#pragma code_seg("PAGE")
-STDMETHODIMP_(NTSTATUS)
-CFmMiniportTopology::UpdateTopologyJackState
-(
- _In_ BOOL NewState
-)
-{
- PAGED_CODE ();
-
- FmRxJackDesc.IsConnected = NewState;
-
- // we have multiple pins which share the same jack state,
- // notify for every pin using that jack state
- GenerateEventList(
- (GUID*)&KSEVENTSETID_PinCapsChange, // event set. NULL is a wild card for all events.
- KSEVENT_PINCAPS_JACKINFOCHANGE, // event ID.
- TRUE, // use pid ID.
- KSPIN_TOPO_FMRX, // pin ID.
- FALSE, // do not use node ID.
- ULONG(-1)); // node ID, not used.
-
- return STATUS_SUCCESS;
-}
-
-#pragma code_seg()
-NTSTATUS CFmMiniportWaveRT_EventHandler_JackState
-(
- _In_ PPCEVENT_REQUEST EventRequest
-)
-{
- CFmMiniportTopology* miniport = reinterpret_cast<CFmMiniportTopology*>(EventRequest->MajorTarget);
- return miniport->EventHandler_JackState(EventRequest);
-}
-
-NTSTATUS CFmMiniportTopology::EventHandler_JackState
-(
- _In_ PPCEVENT_REQUEST EventRequest
-)
-{
- if (EventRequest->Verb == PCEVENT_VERB_ADD)
- {
- m_PortEvents->AddEventToEventList(EventRequest->EventEntry);
- }
-
- return STATUS_SUCCESS;
-}
-
-
diff --git a/audio/sysvad/PhoneAudioSample/FMTopo.h b/audio/sysvad/PhoneAudioSample/FMTopo.h
deleted file mode 100644
index ae279bf1..00000000
--- a/audio/sysvad/PhoneAudioSample/FMTopo.h
+++ /dev/null
@@ -1,152 +0,0 @@
-
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- FMtopo.h
-
-Abstract:
-
- Declaration of topology miniport for the fm endpoint.
-
---*/
-
-#ifndef _SYSVAD_FMTOPO_H_
-#define _SYSVAD_FMTOPO_H_
-
-#include "basetopo.h"
-
-// make sure all of these names matches with KSNAME_* in the inf's [Strings] section
-#define SPEAKER_TOPONAME L"TopologySpeaker"
-#define SPEAKER_HEADSET_TOPONAME L"TopologySpeakerHeadset"
-
-// Special routing endpoint
-#define HOSTRENDER_TOPONAME L"HostRender"
-#define HOSTRENDER_PIN 0
-
-// FM Volume Stepping information
-#define FMRX_VOLUME_MAXIMUM 0 // 0 dB
-#define FMRX_VOLUME_MINIMUM (-96 * 0x10000) // -96 dB
-#define FMRX_VOLUME_STEPPING (0x8000) // 0.5 dB steps
-
-
-//=============================================================================
-// Defines
-//=============================================================================
-// {949F42F1-A5F5-4FBD-B4BB-C543ACC24AE0}
-DEFINE_GUID(IID_IFmTopology,
- 0x949f42f1, 0xa5f5, 0x4fbd, 0xb4, 0xbb, 0xc5, 0x43, 0xac, 0xc2, 0x4a, 0xe0);
-
-
-//=============================================================================
-// Interfaces
-//=============================================================================
-
-///////////////////////////////////////////////////////////////////////////////
-// IFmTopology
-//
-DECLARE_INTERFACE_(IFmTopology, IMiniportTopology)
-{
- STDMETHOD_(NTSTATUS, UpdateTopologyJackState)
- (
- THIS_
- _In_ BOOL NewState
- ) PURE;
-};
-
-typedef IFmTopology *PFMTOPOLOGY;
-
-//=============================================================================
-// Classes
-//=============================================================================
-
-///////////////////////////////////////////////////////////////////////////////
-// CFmMiniportTopology
-//
-
-class CFmMiniportTopology :
- public CMiniportTopologySYSVAD,
- public IFmTopology,
- public CUnknown
-{
- private:
- KSTOPOLOGY_ENDPOINTID m_FmRxTargetEndpoint;
- KSTOPOLOGY_ENDPOINTID m_FmRxAntennaEndpoint;
- ULONG m_FmRxVolume;
-
- public:
- DECLARE_STD_UNKNOWN();
- CFmMiniportTopology
- (
- _In_opt_ PUNKNOWN UnknownOuter,
- _In_ PCFILTER_DESCRIPTOR *FilterDesc,
- _In_ USHORT DeviceMaxChannels
- );
-
- ~CFmMiniportTopology();
-
- IMP_IMiniportTopology;
-
- NTSTATUS PropertyHandlerJackSinkInfo
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerJackDescription
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerJackDescription2
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerFmRxEndpointId
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerFmRxVolume
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerFmRxAntennaEndpointId
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS EventHandler_JackState
- (
- _In_ PPCEVENT_REQUEST _pEventRequest
- );
-
- STDMETHODIMP_(NTSTATUS) UpdateTopologyJackState
- (
- _In_ BOOL NewState
- );
-};
-
-typedef CFmMiniportTopology *PCFmMiniportTopology;
-
-NTSTATUS
-CreateFmMiniportTopology(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
- );
-
-NTSTATUS PropertyHandler_FmRxTopoFilter(_In_ PPCPROPERTY_REQUEST PropertyRequest);
-
-#endif // _SYSVAD_FMTOPO_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/FMWavTable.h b/audio/sysvad/PhoneAudioSample/FMWavTable.h
deleted file mode 100644
index 6ef9fb46..00000000
--- a/audio/sysvad/PhoneAudioSample/FMWavTable.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- fmwavtable.h
-
-Abstract:
-
- Declaration of wave miniport tables for the fm endpoint.
-
- Note: the FM in this sample shows how to do h/w loopback
- for non-offloaded devices.
-
---*/
-
-#ifndef _SYSVAD_FMWAVTABLE_H_
-#define _SYSVAD_FMWAVTABLE_H_
-
-
-#define FMRX_DEVICE_MAX_CHANNELS 2 // Max Channels.
-
-#define FMRX_MAX_CHANNELS 2 // Max Channels.
-#define FMRX_MIN_BITS_PER_SAMPLE 16 // Min Bits Per Sample
-#define FMRX_MAX_BITS_PER_SAMPLE 16 // Max Bits Per Sample
-#define FMRX_MIN_SAMPLE_RATE 48000 // Min Sample Rate
-#define FMRX_MAX_SAMPLE_RATE 48000 // Max Sample Rate
-#define FMRX_MAX_INPUT_SYSTEM_STREAMS 1
-
-
-//=============================================================================
-static
-KSDATAFORMAT_WAVEFORMATEXTENSIBLE FmRxPinSupportedDeviceFormats[] =
-{
- { // 0
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 48000,
- 192000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- }
-};
-
-//
-// Supported modes (only on streaming pins).
-//
-static
-MODE_AND_DEFAULT_FORMAT FmRxPinSupportedDeviceModes[] =
-{
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_RAW,
- &FmRxPinSupportedDeviceFormats[SIZEOF_ARRAY(FmRxPinSupportedDeviceFormats) - 1].DataFormat
- }
-};
-
-//=============================================================================
-// The entries here must follow the same order as the filter's pin
-// descriptor array.
-//
-static
-PIN_DEVICE_FORMATS_AND_MODES FmRxPinDeviceFormatsAndModes[] =
-{
- { // RX
- SystemCapturePin,
- FmRxPinSupportedDeviceFormats,
- SIZEOF_ARRAY(FmRxPinSupportedDeviceFormats),
- FmRxPinSupportedDeviceModes,
- SIZEOF_ARRAY(FmRxPinSupportedDeviceModes)
- },
- {
- BridgePin,
- NULL,
- 0,
- NULL,
- 0,
- },
-};
-
-//=============================================================================
-static
-KSDATARANGE_AUDIO FmPinDataRangesStream[] =
-{
- { // 0
- {
- sizeof(KSDATARANGE_AUDIO),
- KSDATARANGE_ATTRIBUTES, // An attributes list follows this data range
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- FMRX_MAX_CHANNELS,
- FMRX_MIN_BITS_PER_SAMPLE,
- FMRX_MAX_BITS_PER_SAMPLE,
- FMRX_MIN_SAMPLE_RATE,
- FMRX_MAX_SAMPLE_RATE
- },
-};
-
-static
-PKSDATARANGE FmPinDataRangePointersStream[] =
-{
- PKSDATARANGE(&FmPinDataRangesStream[0]),
- PKSDATARANGE(&PinDataRangeAttributeList)
-};
-
-//=============================================================================
-static
-KSDATARANGE FmPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-static
-PKSDATARANGE FmPinDataRangePointersBridge[] =
-{
- &FmPinDataRangesBridge[0]
-};
-
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR FmWaveMiniportPins[] =
-{
- // Wave In Streaming Pin KSPIN_WAVE_FMRX
- {
- FMRX_MAX_INPUT_SYSTEM_STREAMS,
- FMRX_MAX_INPUT_SYSTEM_STREAMS,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(FmPinDataRangePointersStream),
- FmPinDataRangePointersStream,
- KSPIN_DATAFLOW_OUT,
- KSPIN_COMMUNICATION_SINK,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
- // Wave In Bridge Pin KSPIN_WAVE_FMRX_BRIDGE
- {
- 0,
- 0,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(FmPinDataRangePointersBridge),
- FmPinDataRangePointersBridge,
- KSPIN_DATAFLOW_IN,
- KSPIN_COMMUNICATION_NONE,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
-};
-
-//=============================================================================
-//
-// -----
-// | |
-// FM RX bridge pin 1 -->| |--> 0 FM RX pin
-// | |
-// -----
-
-static
-PCCONNECTION_DESCRIPTOR FmWaveMiniportConnections[] =
-{
- { PCFILTER_NODE, KSPIN_WAVE_FMRX_BRIDGE, PCFILTER_NODE, KSPIN_WAVE_FMRX },
-};
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesFmWaveFilter[] =
-{
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_FMRXControl,
- KSPROPERTY_FMRX_STATE,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_FmRxWaveFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationFmWaveFilter, PropertiesFmWaveFilter);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR FmWaveMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationFmWaveFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(FmWaveMiniportPins), // PinCount
- FmWaveMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- 0, // NodeCount
- NULL, // Nodes
- SIZEOF_ARRAY(FmWaveMiniportConnections), // ConnectionCount
- FmWaveMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories - use defaults (audio, render, capture)
-};
-
-#endif // _SYSVAD_FMWAVTABLE_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/FMWave.cpp b/audio/sysvad/PhoneAudioSample/FMWave.cpp
deleted file mode 100644
index 4d571f57..00000000
--- a/audio/sysvad/PhoneAudioSample/FMWave.cpp
+++ /dev/null
@@ -1,389 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- fmwave.cpp
-
-Abstract:
-
- Implementation of wavert miniport for fm
-
---*/
-
-#pragma warning (disable : 4127)
-
-#include <sysvad.h>
-#include "simple.h"
-#include "FmWave.h"
-#include "FmTopo.h"
-#include "FmToptable.h"
-
-//=============================================================================
-// CFmMiniportWaveRT
-//=============================================================================
-
-//=============================================================================
-#pragma code_seg("PAGE")
-NTSTATUS
-CreateFmMiniportWaveRT
-(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
-)
-/*++
-
-Routine Description:
-
- Create the wavert miniport.
-
-Arguments:
-
- Unknown -
-
- RefClsId -
-
- UnknownOuter -
-
- PoolType -
-
- UnkownAdapter -
-
- DeviceContext -
-
- MiniportPair -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- UNREFERENCED_PARAMETER(UnknownOuter);
-
- PAGED_CODE();
-
- ASSERT(Unknown);
- ASSERT(MiniportPair);
-
- CMiniportWaveRT *obj = new (PoolType, MINWAVERT_POOLTAG) CFmMiniportWaveRT
- (
- UnknownAdapter,
- MiniportPair,
- DeviceContext
- );
- if (NULL == obj)
- {
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- obj->AddRef();
- *Unknown = reinterpret_cast<IUnknown*>(obj);
-
- return STATUS_SUCCESS;
-}
-
-//=============================================================================
-#pragma code_seg("PAGE")
-CFmMiniportWaveRT::~CFmMiniportWaveRT
-(
- void
-)
-/*++
-
-Routine Description:
-
- Destructor for wavert miniport
-
-Arguments:
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- DPF_ENTER(("[CFmMiniportWaveRT::~CFmMiniportWaveRT]"));
-
-} // ~CFmMiniportWaveRT
-
-
-//=============================================================================
-#pragma code_seg("PAGE")
-STDMETHODIMP
-CFmMiniportWaveRT::NonDelegatingQueryInterface
-(
- _In_ REFIID Interface,
- _COM_Outptr_ PVOID * Object
-)
-/*++
-
-Routine Description:
-
- QueryInterface for CFmMiniportWaveRT
-
-Arguments:
-
- Interface - GUID of the interface
-
- Object - interface object to be returned.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(Object);
-
- if (IsEqualGUIDAligned(Interface, IID_IAdapterPowerManagement))
- {
- *Object = PVOID(PADAPTERPOWERMANAGEMENT(this));
- }
- else
- {
- *Object = NULL;
- }
-
- if (*Object)
- {
- // We reference the interface for the caller.
-
- PUNKNOWN(*Object)->AddRef();
- return STATUS_SUCCESS;
- }
-
- return CMiniportWaveRT::NonDelegatingQueryInterface(Interface, Object);
-}
-
-#pragma code_seg("PAGE")
-NTSTATUS
-PropertyHandler_FmRxWaveFilter
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Redirects general property request to miniport object
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- CFmMiniportWaveRT* pWaveHelper = reinterpret_cast<CFmMiniportWaveRT*>(PropertyRequest->MajorTarget);
-
- if (pWaveHelper == NULL)
- {
- return STATUS_INVALID_PARAMETER;
- }
-
- pWaveHelper->AddRef();
-
- if (pWaveHelper->m_DeviceType == eFmRxDevice &&
- IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_FMRXControl))
- {
- switch (PropertyRequest->PropertyItem->Id)
- {
- case KSPROPERTY_FMRX_STATE:
- ntStatus = pWaveHelper->PropertyHandler_FmRxState(PropertyRequest);
- break;
-
- default:
- DPF(D_TERSE, ("[PropertyHandler_FmRxWaveFilter: Invalid Device Request"));
- }
- }
- else
- {
- ntStatus = PropertyHandler_WaveFilter(PropertyRequest);
- }
-
- pWaveHelper->Release();
-
- return ntStatus;
-} // PropertyHandler_FmRxWaveFilter
-
-//=============================================================================
-#pragma code_seg("PAGE")
-NTSTATUS
-CFmMiniportWaveRT::PropertyHandler_FmRxState
-(
-_In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-{
- NTSTATUS ntStatus = STATUS_INVALID_PARAMETER;
-
- PAGED_CODE();
-
- DPF_ENTER(("[CFmMiniportWaveRT::PropertyHandler_FmRxState]"));
-
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ULONG flags = PropertyRequest->PropertyItem->Flags;
- ntStatus = PropertyHandler_BasicSupport(PropertyRequest, flags, VT_ILLEGAL);
- }
- else
- {
- ntStatus =
- ValidatePropertyParams
- (
- PropertyRequest,
- sizeof(BOOL),
- 0
- );
-
- if (NT_SUCCESS(ntStatus))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- BOOL* fmrxState = (BOOL*)PropertyRequest->Value;
- *fmrxState = m_bFmRxState;
- ntStatus = STATUS_SUCCESS;
- }
- else if (PropertyRequest->Verb & KSPROPERTY_TYPE_SET)
- {
- BOOL fmrxNewState = *(BOOL*)PropertyRequest->Value;
- if (fmrxNewState == m_bFmRxState)
- {
- ntStatus = STATUS_SUCCESS;
- }
- else
- {
- // Turn on FM hardware
- m_bFmRxState = fmrxNewState;
-
- // NOTE: Set the Jack state to Active ONLY if the driver supports
- // recording FM data. If the driver doesn't support recording FM
- // data, the jack state should never be changed to Active
- ntStatus = UpdateTopologyJackState(m_bFmRxState);
-
- // When we're using FM, we need idle power management disabled.
- // passing true here enables power management, false disables.
- // when FM is enabled (true), we want to pass false do disable idle
- // power management
- m_pAdapterCommon->SetIdlePowerManagement(m_pMiniportPair, m_bFmRxState?FALSE:TRUE);
- }
- }
- else
- {
- ntStatus = STATUS_INVALID_PARAMETER;
- }
- }
- }
-
- return ntStatus;
-} // PropertyHandler_FmRxState
-
-
-
-#pragma code_seg("PAGE")
-NTSTATUS
-CFmMiniportWaveRT::UpdateTopologyJackState
-(
- _In_ BOOL NewState
-)
-{
- PAGED_CODE ();
- NTSTATUS ntStatus = STATUS_SUCCESS;
- IUnknown *pUnknown = NULL;
- IFmTopology *pFmTopology = NULL;
-
- // GetFilters returns the topology port, then topology miniport, then wave port, then wave miniport.
- // we only need the topology miniport.
- ntStatus = m_pAdapterCommon->GetFilters(m_pMiniportPair, NULL, &pUnknown, NULL, NULL);
- if (NT_SUCCESS(ntStatus))
- {
- ntStatus = pUnknown->QueryInterface(IID_IFmTopology, (PVOID *)&pFmTopology);
- if (NT_SUCCESS(ntStatus))
- {
- ntStatus = pFmTopology->UpdateTopologyJackState(NewState);
- }
- }
-
- SAFE_RELEASE(pFmTopology);
- SAFE_RELEASE(pUnknown);
-
- return STATUS_SUCCESS;
-}
-#pragma code_seg()
-
-
-//=============================================================================
-#pragma code_seg()
-STDMETHODIMP_(void)
-CFmMiniportWaveRT::PowerChangeState
-(
- _In_ POWER_STATE NewState
-)
-{
- DPF_ENTER(("[CFmMiniportWaveRT::PowerChangeState]"));
- UNREFERENCED_PARAMETER(NewState);
-
- /*
- Turn on and off fm specific hardware here, if applicable.
- */
-
-} // PowerStateChange
-
-//=============================================================================
-#pragma code_seg()
-STDMETHODIMP_(NTSTATUS)
-CFmMiniportWaveRT::QueryDeviceCapabilities
-(
- _Inout_updates_bytes_(sizeof(DEVICE_CAPABILITIES)) PDEVICE_CAPABILITIES PowerDeviceCaps
-)
-{
- UNREFERENCED_PARAMETER(PowerDeviceCaps);
-
- /*
- Unused at the miniport layer. Any device capabilities should be reported in CAdapterCommon
- */
-
- return (STATUS_SUCCESS);
-} // QueryDeviceCapabilities
-
-//=============================================================================
-#pragma code_seg()
-STDMETHODIMP_(NTSTATUS)
-CFmMiniportWaveRT::QueryPowerChangeState
-(
- _In_ POWER_STATE NewStateQuery
-)
-{
- UNREFERENCED_PARAMETER(NewStateQuery);
-
- DPF_ENTER(("[CFmMiniportWaveRT::QueryPowerChangeState]"));
-
- // if we're in a call state other than disabled, then we need the hardware turned on
- if (m_bFmRxState)
- {
- return STATUS_RESOURCE_IN_USE;
- }
-
- return STATUS_SUCCESS;
-} // QueryPowerChangeState
-
-
diff --git a/audio/sysvad/PhoneAudioSample/FMWave.h b/audio/sysvad/PhoneAudioSample/FMWave.h
deleted file mode 100644
index 1134b680..00000000
--- a/audio/sysvad/PhoneAudioSample/FMWave.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- fmwave.h
-
-Abstract:
-
- Definition of wavert miniport class for fm
-
---*/
-
-#include "MinWaveRT.h"
-
-#ifndef _SYSVAD_FMMINWAVERT_H_
-#define _SYSVAD_FMMINWAVERT_H_
-
-NTSTATUS
-CreateFmMiniportWaveRT
-(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
-);
-
-//=============================================================================
-// Classes
-//=============================================================================
-///////////////////////////////////////////////////////////////////////////////
-// CFmMiniportWaveRT
-//
-class CFmMiniportWaveRT :
- public CMiniportWaveRT,
- public IAdapterPowerManagement
-{
-private:
- BOOL m_bFmRxState;
-
-public:
- DECLARE_STD_UNKNOWN();
- IMP_IAdapterPowerManagement;
-
- CFmMiniportWaveRT(
- _In_ PUNKNOWN UnknownAdapter,
- _In_ PENDPOINT_MINIPAIR MiniportPair,
- _In_opt_ PVOID DeviceContext
- )
- :CMiniportWaveRT(UnknownAdapter, MiniportPair, DeviceContext),
- m_bFmRxState(FALSE)
- {
- }
-
- ~CFmMiniportWaveRT();
-
- friend NTSTATUS PropertyHandler_FmRxWaveFilter
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
-public:
- NTSTATUS PropertyHandler_FmRxState
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
-private:
- NTSTATUS UpdateTopologyJackState
- (
- _In_ BOOL NewState
- );
-};
-typedef CFmMiniportWaveRT *PCFmMiniportWaveRT;
-
-#endif // _SYSVAD_FMMINWAVERT_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.rc b/audio/sysvad/PhoneAudioSample/PhoneAudioSample.rc
deleted file mode 100644
index b81a3c58..00000000
--- a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.rc
+++ /dev/null
@@ -1,30 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- PhoneAudioSample.rc
-
-Abstract:
-
-
---*/
-
-#include <windows.h>
-
-#include <ntverp.h>
-
-#define VER_FILETYPE VFT_DRV
-#define VER_FILESUBTYPE VFT2_DRV_SOUND
-#define VER_FILEDESCRIPTION_STR "Microsoft Virtual Audio Phone Sample Driver"
-#define VER_INTERNALNAME_STR "PhoneAudioSample.sys"
-#define VER_ORIGINALFILENAME_STR "PhoneAudioSample.sys"
-
-#define VER_LEGALCOPYRIGHT_YEARS "2013"
-#define VER_LEGALCOPYRIGHT_STR "Copyright (C) Microsoft Corp." VER_LEGALCOPYRIGHT_YEARS
-
-#include "common.ver"
-
-
-
diff --git a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj b/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj
deleted file mode 100644
index 49ccee70..00000000
--- a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj
+++ /dev/null
@@ -1,419 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|ARM64">
- <Configuration>Debug</Configuration>
- <Platform>ARM64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|ARM64">
- <Configuration>Release</Configuration>
- <Platform>ARM64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}</ProjectGuid>
- <RootNamespace>$(MSBuildProjectName)</RootNamespace>
- <KMDF_VERSION_MAJOR>1</KMDF_VERSION_MAJOR>
- <SupportsPackaging>false</SupportsPackaging>
- <RequiresPackageProject>true</RequiresPackageProject>
- <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
- <Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{791E3C3E-132D-46C6-9624-C868C54139F0}</SampleGuid>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <TargetVersion>Windows10</TargetVersion>
- <UseDebugLibraries>False</UseDebugLibraries>
- <DriverTargetPlatform>Universal</DriverTargetPlatform>
- <DriverType>KMDF</DriverType>
- <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
- <ConfigurationType>Driver</ConfigurationType>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
- <TargetVersion>Windows10</TargetVersion>
- <UseDebugLibraries>False</UseDebugLibraries>
- <DriverTargetPlatform>Universal</DriverTargetPlatform>
- <DriverType>KMDF</DriverType>
- <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
- <ConfigurationType>Driver</ConfigurationType>
- </PropertyGroup>
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <TargetVersion>Windows10</TargetVersion>
- <UseDebugLibraries>True</UseDebugLibraries>
- <DriverTargetPlatform>Universal</DriverTargetPlatform>
- <DriverType>KMDF</DriverType>
- <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
- <ConfigurationType>Driver</ConfigurationType>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
- <TargetVersion>Windows10</TargetVersion>
- <UseDebugLibraries>True</UseDebugLibraries>
- <DriverTargetPlatform>Universal</DriverTargetPlatform>
- <DriverType>KMDF</DriverType>
- <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
- <ConfigurationType>Driver</ConfigurationType>
- </PropertyGroup>
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <TargetVersion>Windows10</TargetVersion>
- <UseDebugLibraries>False</UseDebugLibraries>
- <DriverTargetPlatform>Universal</DriverTargetPlatform>
- <DriverType>KMDF</DriverType>
- <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
- <ConfigurationType>Driver</ConfigurationType>
- </PropertyGroup>
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <TargetVersion>Windows10</TargetVersion>
- <UseDebugLibraries>True</UseDebugLibraries>
- <DriverTargetPlatform>Universal</DriverTargetPlatform>
- <DriverType>KMDF</DriverType>
- <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
- <ConfigurationType>Driver</ConfigurationType>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <PropertyGroup>
- <OutDir>$(IntDir)</OutDir>
- </PropertyGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
- </ImportGroup>
- <ItemGroup Label="WrappedTaskItems" />
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib</AdditionalDependencies>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ResourceCompile>
- <ClCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <TreatWarningAsError>true</TreatWarningAsError>
- <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ClCompile>
- <Midl>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </Midl>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib</AdditionalDependencies>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ResourceCompile>
- <ClCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <TreatWarningAsError>true</TreatWarningAsError>
- <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ClCompile>
- <Midl>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </Midl>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib</AdditionalDependencies>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ResourceCompile>
- <ClCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <TreatWarningAsError>true</TreatWarningAsError>
- <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ClCompile>
- <Midl>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </Midl>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib</AdditionalDependencies>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ResourceCompile>
- <ClCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <TreatWarningAsError>true</TreatWarningAsError>
- <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ClCompile>
- <Midl>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </Midl>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib</AdditionalDependencies>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ResourceCompile>
- <ClCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <TreatWarningAsError>true</TreatWarningAsError>
- <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ClCompile>
- <Midl>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </Midl>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\portcls.lib;$(DDK_LIB_PATH)\stdunk.lib;$(DDK_LIB_PATH)\libcntpr.lib</AdditionalDependencies>
- </Link>
- <ResourceCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ResourceCompile>
- <ClCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <TreatWarningAsError>true</TreatWarningAsError>
- <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </ClCompile>
- <Midl>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);..</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_WIN32;UNICODE;_UNICODE;PC_IMPLEMENTATION</PreprocessorDefinitions>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);DEBUG_LEVEL=DEBUGLVL_TERSE</PreprocessorDefinitions>
- </Midl>
- </ItemDefinitionGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <TargetName>PhoneAudioSample</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
- <TargetName>PhoneAudioSample</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <TargetName>PhoneAudioSample</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
- <TargetName>PhoneAudioSample</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <TargetName>PhoneAudioSample</TargetName>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <TargetName>PhoneAudioSample</TargetName>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);.\..\EndpointsCommon\$(IntDir)\EndpointsCommon.lib</AdditionalDependencies>
- </Link>
- <ClCompile>
- <!--
- Use one of the following pre-processor defines to select the right power management:
- - _USE_IPortClsRuntimePower
- - _USE_SingleComponentMultiFxStates
- Note that the single-component/multi-state feature requires also a registry
- value set via the INF. The name of the registry value is SingleComponentMultiFxStates.
- see INF file for more info.
- -->
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon;.</AdditionalIncludeDirectories>
- <ExceptionHandling>
- </ExceptionHandling>
- </ClCompile>
- <Midl>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </Midl>
- <ResourceCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);.\..\EndpointsCommon\$(IntDir)\EndpointsCommon.lib</AdditionalDependencies>
- </Link>
- <ClCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon;.</AdditionalIncludeDirectories>
- <ExceptionHandling>
- </ExceptionHandling>
- <DisableSpecificWarnings>4595;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- </ClCompile>
- <Midl>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </Midl>
- <ResourceCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);.\..\EndpointsCommon\$(IntDir)\EndpointsCommon.lib</AdditionalDependencies>
- </Link>
- <ClCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon;.</AdditionalIncludeDirectories>
- <ExceptionHandling>
- </ExceptionHandling>
- </ClCompile>
- <Midl>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </Midl>
- <ResourceCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);.\..\EndpointsCommon\$(IntDir)\EndpointsCommon.lib</AdditionalDependencies>
- </Link>
- <ClCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon;.</AdditionalIncludeDirectories>
- <ExceptionHandling>
- </ExceptionHandling>
- <DisableSpecificWarnings>4595;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- </ClCompile>
- <Midl>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </Midl>
- <ResourceCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);.\..\EndpointsCommon\$(IntDir)\EndpointsCommon.lib</AdditionalDependencies>
- </Link>
- <ClCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon;.</AdditionalIncludeDirectories>
- <ExceptionHandling>
- </ExceptionHandling>
- </ClCompile>
- <Midl>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </Midl>
- <ResourceCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);.\..\EndpointsCommon\$(IntDir)\EndpointsCommon.lib</AdditionalDependencies>
- </Link>
- <ClCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower;_NEW_DELETE_OPERATORS_</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon;.</AdditionalIncludeDirectories>
- <ExceptionHandling>
- </ExceptionHandling>
- <DisableSpecificWarnings>4595;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- </ClCompile>
- <Midl>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </Midl>
- <ResourceCompile>
- <PreprocessorDefinitions>%(PreprocessorDefinitions);_USE_WAVERT_;SYSVAD_BTH_BYPASS;SYSVAD_USB_SIDEBAND;_USE_IPortClsRuntimePower</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);..\EndpointsCommon</AdditionalIncludeDirectories>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="..\adapter.cpp" />
- <ClCompile Include="..\basetopo.cpp" />
- <ClCompile Include="..\BthhfpDevice.cpp" />
- <ClCompile Include="..\usbhsdevice.cpp" />
- <ClCompile Include="..\common.cpp" />
- <ClCompile Include="..\hw.cpp" />
- <ClCompile Include="..\kshelper.cpp" />
- <ClCompile Include="..\savedata.cpp" />
- <ClCompile Include="..\tonegenerator.cpp" />
- <ClCompile Include="cellulartopo.cpp" />
- <ClCompile Include="cellularwave.cpp" />
- <ClCompile Include="fmtopo.cpp" />
- <ClCompile Include="fmwave.cpp" />
- <ClCompile Include="handsetmictopo.cpp" />
- <ClCompile Include="handsetspeakertopo.cpp" />
- <ClCompile Include="michstopo.cpp" />
- <ClCompile Include="speakerhstopo.cpp" />
- <ResourceCompile Include="PhoneAudioSample.rc" />
- </ItemGroup>
- <ItemGroup>
- <Inf Exclude="@(Inx)" Include="*.inx" />
- <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" />
- </ItemGroup>
- <ItemGroup>
- <None Exclude="@(None)" Include="*.txt;*.htm;*.html" />
- <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" />
- <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
diff --git a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj.Filters b/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj.Filters
deleted file mode 100644
index c57611a0..00000000
--- a/audio/sysvad/PhoneAudioSample/PhoneAudioSample.vcxproj.Filters
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{6BC89CB0-7C76-439F-8D55-E3125E355A42}</UniqueIdentifier>
- </Filter>
- <Filter Include="Header Files">
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{02E55FC1-89F6-4E2D-A10B-A6476FF89B86}</UniqueIdentifier>
- </Filter>
- <Filter Include="Resource Files">
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions>
- <UniqueIdentifier>{B836489B-8D2E-41DD-A232-0D6C40243B08}</UniqueIdentifier>
- </Filter>
- <Filter Include="Driver Files">
- <Extensions>inf;inv;inx;mof;mc;</Extensions>
- <UniqueIdentifier>{850E3B99-7C84-454B-9E04-6A7CF9852E6C}</UniqueIdentifier>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\*.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="*.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="PhoneAudioSample.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <Inf Include="*.inx">
- <Filter>Driver Files</Filter>
- </Inf>
- </ItemGroup>
-</Project>
diff --git a/audio/sysvad/PhoneAudioSample/handsetmictopo.cpp b/audio/sysvad/PhoneAudioSample/handsetmictopo.cpp
deleted file mode 100644
index 4e181c62..00000000
--- a/audio/sysvad/PhoneAudioSample/handsetmictopo.cpp
+++ /dev/null
@@ -1,274 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- handsetmictopo.cpp
-
-Abstract:
-
- Implementation of topology miniport for the handset mic (internal).
-
---*/
-
-#pragma warning (disable : 4127)
-
-#include <sysvad.h>
-#include "simple.h"
-#include "mintopo.h"
-#include "handsetmictopo.h"
-#include "handsetmictoptable.h"
-
-
-#pragma code_seg("PAGE")
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_HandsetMicJackDescription
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_HandsetMicJackDescription]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- ULONG cJackDescriptions = ARRAYSIZE(HandsetMicJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = HandsetMicJackDescriptions;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION pDesc = (PKSJACK_DESCRIPTION)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlCopyMemory(pDesc, JackDescriptions[nPinId], sizeof(KSJACK_DESCRIPTION));
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_HandsetMicJackDescription2
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION2 )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_HandsetMicJackDescription2]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- ULONG cJackDescriptions = ARRAYSIZE(HandsetMicJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = HandsetMicJackDescriptions;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION2);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION2 pDesc = (PKSJACK_DESCRIPTION2)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlZeroMemory(pDesc, sizeof(KSJACK_DESCRIPTION2));
-
- //
- // Specifies the lower 16 bits of the DWORD parameter. This parameter indicates whether
- // the jack is currently active, streaming, idle, or hardware not ready.
- //
- pDesc->DeviceStateInfo = 0;
-
- //
- // From MSDN:
- // "If an audio device lacks jack presence detection, the IsConnected member of
- // the KSJACK_DESCRIPTION structure must always be set to TRUE. To remove the
- // ambiguity that results from this dual meaning of the TRUE value for IsConnected,
- // a client application can call IKsJackDescription2::GetJackDescription2 to read
- // the JackCapabilities flag of the KSJACK_DESCRIPTION2 structure. If this flag has
- // the JACKDESC2_PRESENCE_DETECT_CAPABILITY bit set, it indicates that the endpoint
- // does in fact support jack presence detection. In that case, the return value of
- // the IsConnected member can be interpreted to accurately reflect the insertion status
- // of the jack."
- //
- // Bit definitions:
- // 0x00000001 - JACKDESC2_PRESENCE_DETECT_CAPABILITY
- // 0x00000002 - JACKDESC2_DYNAMIC_FORMAT_CHANGE_CAPABILITY
- //
- pDesc->JackCapabilities = 0;
-
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_HandsetMicTopoFilter
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Redirects property request to miniport object
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_HandsetMicTopoFilter]"));
-
- // PropertryRequest structure is filled by portcls.
- // MajorTarget is a pointer to miniport object for miniports.
- //
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
-
- //
- // This line shows how to get a pointer to the miniport topology object.
- //
- PCMiniportTopology pMiniport = (PCMiniportTopology)PropertyRequest->MajorTarget;
- UNREFERENCED_VAR(pMiniport);
-
- if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_Jack))
- {
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION)
- {
- ntStatus = PropertyHandler_HandsetMicJackDescription(PropertyRequest);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION2)
- {
- ntStatus = PropertyHandler_HandsetMicJackDescription2(PropertyRequest);
- }
- }
-
- return ntStatus;
-} // PropertyHandler_HandsetMicTopoFilter
-
-#pragma code_seg()
-
diff --git a/audio/sysvad/PhoneAudioSample/handsetmictopo.h b/audio/sysvad/PhoneAudioSample/handsetmictopo.h
deleted file mode 100644
index 07c8ba27..00000000
--- a/audio/sysvad/PhoneAudioSample/handsetmictopo.h
+++ /dev/null
@@ -1,21 +0,0 @@
-
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- handsetmictopo.h
-
-Abstract:
-
- Declaration of topology miniport for the handset mic (internal).
-
---*/
-
-#ifndef _SYSVAD_HANDSETMICTOPO_H_
-#define _SYSVAD_HANDSETMICTOPO_H_
-
-NTSTATUS PropertyHandler_HandsetMicTopoFilter(_In_ PPCPROPERTY_REQUEST PropertyRequest);
-
-#endif // _SYSVAD_HANDSETMICTOPO_H_
diff --git a/audio/sysvad/PhoneAudioSample/handsetmictoptable.h b/audio/sysvad/PhoneAudioSample/handsetmictoptable.h
deleted file mode 100644
index 5fd70010..00000000
--- a/audio/sysvad/PhoneAudioSample/handsetmictoptable.h
+++ /dev/null
@@ -1,245 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- handsetmictopotable.h
-
-Abstract:
-
- Declaration of topology table for the handset mic (internal)
-
---*/
-
-#ifndef _SYSVAD_HANDSETMICTOPTABLE_H_
-#define _SYSVAD_HANDSETMICTOPTABLE_H_
-
-// Function declarations.
-NTSTATUS
-PropertyHandler_HandsetMicTopoFilter(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
-//=============================================================================
-static
-KSDATARANGE HandsetMicTopoPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-//=============================================================================
-static
-PKSDATARANGE HandsetMicTopoPinDataRangePointersBridge[] =
-{
- &HandsetMicTopoPinDataRangesBridge[0]
-};
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR HandsetMicTopoMiniportPins[] =
-{
- // KSPIN - topology filter in-pin
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(HandsetMicTopoPinDataRangePointersBridge),// DataRangesCount
- HandsetMicTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_IN, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSNODETYPE_HANDSET, // Category
- NULL, // Name
- 0 // Reserved
- }
- },
-
- // KSPIN - topology filter out-in
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(HandsetMicTopoPinDataRangePointersBridge),// DataRangesCount
- HandsetMicTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_OUT, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSCATEGORY_AUDIO, // Category
- NULL, // Name
- 0 // Reserved
- }
- }
-};
-
-//=============================================================================
-static
-KSJACK_DESCRIPTION HandsetMicJackDesc =
-{
- KSAUDIO_SPEAKER_MONO,
- 0x0000, // no color
- eConnTypeUnknown,
- eGeoLocTop,
- eGenLocInternal,
- ePortConnIntegratedDevice,
- TRUE
-};
-
-//=============================================================================
-// Only return a KSJACK_DESCRIPTION for the physical bridge pin.
-static
-PKSJACK_DESCRIPTION HandsetMicJackDescriptions[] =
-{
- &HandsetMicJackDesc,
- NULL
-};
-
-//=============================================================================
-static
-PCPROPERTY_ITEM HandsetMicPropertiesVolume[] =
-{
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_VOLUMELEVEL,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_Topology
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetMicVolume, HandsetMicPropertiesVolume);
-
-//=============================================================================
-static
-PCPROPERTY_ITEM HandsetMicPropertiesMute[] =
-{
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_MUTE,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_Topology
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetMicMute, HandsetMicPropertiesMute);
-
-//=============================================================================
-static
-PCPROPERTY_ITEM HandsetMicPropertiesPeakMeter[] =
-{
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_PEAKMETER2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_Topology
- },
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_CPU_RESOURCES,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_Topology
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetMicPeakMeter, HandsetMicPropertiesPeakMeter);
-
-//=============================================================================
-static
-PCNODE_DESCRIPTOR HandsetMicTopologyNodes[] =
-{
- // KSNODE_TOPO_VOLUME
- {
- 0, // Flags
- &AutomationHandsetMicVolume, // AutomationTable
- &KSNODETYPE_VOLUME, // Type
- &KSAUDFNAME_MIC_VOLUME // Name
- },
- // KSNODE_TOPO_MUTE
- {
- 0, // Flags
- &AutomationHandsetMicMute, // AutomationTable
- &KSNODETYPE_MUTE, // Type
- &KSAUDFNAME_MIC_MUTE // Name
- },
- // KSNODE_TOPO_PEAKMETER
- {
- 0, // Flags
- &AutomationHandsetMicPeakMeter, // AutomationTable
- &KSNODETYPE_PEAKMETER, // Type
- &KSAUDFNAME_PEAKMETER // Name
- }
-};
-
-C_ASSERT( KSNODE_TOPO_VOLUME == 0 );
-C_ASSERT( KSNODE_TOPO_MUTE == 1 );
-C_ASSERT( KSNODE_TOPO_PEAKMETER == 2 );
-
-//=============================================================================
-static
-PCCONNECTION_DESCRIPTOR HandsetMicMiniportConnections[] =
-{
- // FromNode, FromPin, ToNode, ToPin
- { PCFILTER_NODE, KSPIN_TOPO_MIC_ELEMENTS, KSNODE_TOPO_VOLUME, 1 },
- { KSNODE_TOPO_VOLUME, 0, KSNODE_TOPO_MUTE, 1 },
- { KSNODE_TOPO_MUTE, 0, KSNODE_TOPO_PEAKMETER, 1 },
- { KSNODE_TOPO_PEAKMETER, 0, PCFILTER_NODE, KSPIN_TOPO_BRIDGE }
-};
-
-
-//=============================================================================
-static
-PCPROPERTY_ITEM HandsetMicPropertiesTopoFilter[] =
-{
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_HandsetMicTopoFilter
- },
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_HandsetMicTopoFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetMicTopoFilter, HandsetMicPropertiesTopoFilter);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR HandsetMicTopoMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationHandsetMicTopoFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(HandsetMicTopoMiniportPins), // PinCount
- HandsetMicTopoMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- SIZEOF_ARRAY(HandsetMicTopologyNodes), // NodeCount
- HandsetMicTopologyNodes, // Nodes
- SIZEOF_ARRAY(HandsetMicMiniportConnections), // ConnectionCount
- HandsetMicMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories
-};
-
-#endif // _SYSVAD_HANDSETMICTOPTABLE_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/handsetmicwavtable.h b/audio/sysvad/PhoneAudioSample/handsetmicwavtable.h
deleted file mode 100644
index 5470e521..00000000
--- a/audio/sysvad/PhoneAudioSample/handsetmicwavtable.h
+++ /dev/null
@@ -1,447 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- handsetmicwavtable.h
-
-Abstract:
-
- Declaration of wave miniport tables for the handset microphone.
-
---*/
-
-#ifndef _SYSVAD_HANDSETMICWAVTABLE_H_
-#define _SYSVAD_HANDSETMICWAVTABLE_H_
-
-//
-// Handset microphone (internal) range.
-//
-#define HANDSETMIC_DEVICE_MAX_CHANNELS 1 // Max Channels.
-#define HANDSETMIC_MIN_BITS_PER_SAMPLE_PCM 16 // Min Bits Per Sample
-#define HANDSETMIC_MAX_BITS_PER_SAMPLE_PCM 16 // Max Bits Per Sample
-#define HANDSETMIC_MIN_SAMPLE_RATE 8000 // Min Sample Rate
-#define HANDSETMIC_MAX_SAMPLE_RATE 48000 // Max Sample Rate
-
-//
-// Max # of pin instances.
-//
-#define HANDSETMIC_MAX_INPUT_STREAMS 4
-
-//=============================================================================
-static
-KSDATAFORMAT_WAVEFORMATEXTENSIBLE HandsetMicPinSupportedDeviceFormats[] =
-{
- { // 0
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 8000,
- 16000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 1
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 11025,
- 22050,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 2
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 16000,
- 32000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 3
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 22050,
- 44100,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 4
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 24000,
- 48000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 5
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 32000,
- 64000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 6
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 44100,
- 88200,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 7
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 48000,
- 96000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- }
-};
-
-//
-// Supported modes (only on streaming pins).
-//
-static
-MODE_AND_DEFAULT_FORMAT HandsetMicPinSupportedDeviceModes[] =
-{
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_RAW,
- &HandsetMicPinSupportedDeviceFormats[SIZEOF_ARRAY(HandsetMicPinSupportedDeviceFormats) - 1].DataFormat, // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_DEFAULT,
- &HandsetMicPinSupportedDeviceFormats[SIZEOF_ARRAY(HandsetMicPinSupportedDeviceFormats) - 1].DataFormat, // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_SPEECH,
- &HandsetMicPinSupportedDeviceFormats[2].DataFormat, // 16KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS,
- &HandsetMicPinSupportedDeviceFormats[4].DataFormat, // 24KHz
- }
-};
-
-//
-// The entries here must follow the same order as the filter's pin
-// descriptor array.
-//
-static
-PIN_DEVICE_FORMATS_AND_MODES HandsetMicPinDeviceFormatsAndModes[] =
-{
- {
- BridgePin,
- NULL,
- 0,
- NULL,
- 0
- },
- {
- SystemCapturePin,
- HandsetMicPinSupportedDeviceFormats,
- SIZEOF_ARRAY(HandsetMicPinSupportedDeviceFormats),
- HandsetMicPinSupportedDeviceModes,
- SIZEOF_ARRAY(HandsetMicPinSupportedDeviceModes)
- }
-};
-
-//=============================================================================
-static
-KSDATARANGE_AUDIO HandsetMicPinDataRangesStream[] =
-{
- {
- {
- sizeof(KSDATARANGE_AUDIO),
- KSDATARANGE_ATTRIBUTES, // An attributes list follows this data range
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- HANDSETMIC_DEVICE_MAX_CHANNELS,
- HANDSETMIC_MIN_BITS_PER_SAMPLE_PCM,
- HANDSETMIC_MAX_BITS_PER_SAMPLE_PCM,
- HANDSETMIC_MIN_SAMPLE_RATE,
- HANDSETMIC_MAX_SAMPLE_RATE
- },
-};
-
-static
-PKSDATARANGE HandsetMicPinDataRangePointersStream[] =
-{
- PKSDATARANGE(&HandsetMicPinDataRangesStream[0]),
- PKSDATARANGE(&PinDataRangeAttributeList),
-};
-
-//=============================================================================
-static
-KSDATARANGE HandsetMicPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-static
-PKSDATARANGE HandsetMicPinDataRangePointersBridge[] =
-{
- &HandsetMicPinDataRangesBridge[0]
-};
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR HandsetMicWaveMiniportPins[] =
-{
- // Wave In Bridge Pin (Capture - From Topology) KSPIN_WAVE_BRIDGE
- {
- 0,
- 0,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(HandsetMicPinDataRangePointersBridge),
- HandsetMicPinDataRangePointersBridge,
- KSPIN_DATAFLOW_IN,
- KSPIN_COMMUNICATION_NONE,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
-
- // Wave In Streaming Pin (Capture) KSPIN_WAVEIN_HOST
- {
- HANDSETMIC_MAX_INPUT_STREAMS,
- HANDSETMIC_MAX_INPUT_STREAMS,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(HandsetMicPinDataRangePointersStream),
- HandsetMicPinDataRangePointersStream,
- KSPIN_DATAFLOW_OUT,
- KSPIN_COMMUNICATION_SINK,
- &KSCATEGORY_AUDIO,
- &KSAUDFNAME_RECORDING_CONTROL,
- 0
- }
- }
-};
-
-//=============================================================================
-static
-PCNODE_DESCRIPTOR HandsetMicWaveMiniportNodes[] =
-{
- // KSNODE_WAVE_ADC
- {
- 0, // Flags
- NULL, // AutomationTable
- &KSNODETYPE_ADC, // Type
- NULL // Name
- }
-};
-
-//=============================================================================
-static
-PCCONNECTION_DESCRIPTOR HandsetMicWaveMiniportConnections[] =
-{
- { PCFILTER_NODE, KSPIN_WAVE_BRIDGE, KSNODE_WAVE_ADC, 1 },
- { KSNODE_WAVE_ADC, 0, PCFILTER_NODE, KSPIN_WAVEIN_HOST }
-};
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesHandsetMicWaveFilter[] =
-{
- {
- &KSPROPSETID_General,
- KSPROPERTY_GENERAL_COMPONENTID,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetMicWaveFilter, PropertiesHandsetMicWaveFilter);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR HandsetMicWaveMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationHandsetMicWaveFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(HandsetMicWaveMiniportPins), // PinCount
- HandsetMicWaveMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- SIZEOF_ARRAY(HandsetMicWaveMiniportNodes), // NodeCount
- HandsetMicWaveMiniportNodes, // Nodes
- SIZEOF_ARRAY(HandsetMicWaveMiniportConnections), // ConnectionCount
- HandsetMicWaveMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories - use defaults (audio, render, capture)
-};
-
-#endif // _SYSVAD_HANDSETMICWAVTABLE_H_
diff --git a/audio/sysvad/PhoneAudioSample/handsetspeakertopo.cpp b/audio/sysvad/PhoneAudioSample/handsetspeakertopo.cpp
deleted file mode 100644
index 161e5bf0..00000000
--- a/audio/sysvad/PhoneAudioSample/handsetspeakertopo.cpp
+++ /dev/null
@@ -1,561 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- handsetspeakertopo.cpp
-
-Abstract:
-
- Implementation of topology miniport for the handsetspeaker endpoint.
-
---*/
-
-#pragma warning (disable : 4127)
-
-#include <sysvad.h>
-#include "simple.h"
-#include "mintopo.h"
-#include "handsetspeakertopo.h"
-#include "handsetspeakertoptable.h"
-#include <ntstrsafe.h>
-
-
-#pragma code_seg("PAGE")
-
-//=============================================================================
-NTSTATUS
-CreateHandsetSpeakerMiniportTopology
-(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
-)
-/*++
-
-Routine Description:
-
- Creates a new topology miniport.
-
-Arguments:
-
- Unknown -
-
- RefclsId -
-
- UnknownOuter -
-
- PoolType -
-
- UnknownAdapter -
-
- DeviceContext -
-
- MiniportPair -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(Unknown);
- ASSERT(MiniportPair);
-
- UNREFERENCED_PARAMETER(UnknownAdapter);
- UNREFERENCED_PARAMETER(DeviceContext);
-
- CHandsetSpeakerMiniportTopology *obj =
- new (PoolType, MINWAVERT_POOLTAG)
- CHandsetSpeakerMiniportTopology( UnknownOuter,
- MiniportPair->TopoDescriptor,
- MiniportPair->DeviceMaxChannels);
- if (NULL == obj)
- {
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- obj->AddRef();
- *Unknown = reinterpret_cast<IUnknown*>(obj);
-
- return STATUS_SUCCESS;
-} // CreateHandsetSpeakerMiniportTopology
-
-//=============================================================================
-CHandsetSpeakerMiniportTopology::~CHandsetSpeakerMiniportTopology
-(
- void
-)
-/*++
-
-Routine Description:
-
- Topology miniport destructor
-
-Arguments:
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- DPF_ENTER(("[CHandsetSpeakerMiniportTopology::~CHandsetSpeakerMiniportTopology]"));
-} // ~CHandsetSpeakerMiniportTopology
-
-//=============================================================================
-NTSTATUS
-CHandsetSpeakerMiniportTopology::DataRangeIntersection
-(
- _In_ ULONG PinId,
- _In_ PKSDATARANGE ClientDataRange,
- _In_ PKSDATARANGE MyDataRange,
- _In_ ULONG OutputBufferLength,
- _Out_writes_bytes_to_opt_(OutputBufferLength, *ResultantFormatLength)
- PVOID ResultantFormat OPTIONAL,
- _Out_ PULONG ResultantFormatLength
-)
-/*++
-
-Routine Description:
-
- The DataRangeIntersection function determines the highest quality
- intersection of two data ranges.
-
-Arguments:
-
- PinId - Pin for which data intersection is being determined.
-
- ClientDataRange - Pointer to KSDATARANGE structure which contains the data range
- submitted by client in the data range intersection property
- request.
-
- MyDataRange - Pin's data range to be compared with client's data range.
-
- OutputBufferLength - Size of the buffer pointed to by the resultant format
- parameter.
-
- ResultantFormat - Pointer to value where the resultant format should be
- returned.
-
- ResultantFormatLength - Actual length of the resultant format that is placed
- at ResultantFormat. This should be less than or equal
- to OutputBufferLength.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- return
- CMiniportTopologySYSVAD::DataRangeIntersection
- (
- PinId,
- ClientDataRange,
- MyDataRange,
- OutputBufferLength,
- ResultantFormat,
- ResultantFormatLength
- );
-} // DataRangeIntersection
-
-//=============================================================================
-STDMETHODIMP
-CHandsetSpeakerMiniportTopology::GetDescription
-(
- _Out_ PPCFILTER_DESCRIPTOR * OutFilterDescriptor
-)
-/*++
-
-Routine Description:
-
- The GetDescription function gets a pointer to a filter description.
- It provides a location to deposit a pointer in miniport's description
- structure. This is the placeholder for the FromNode or ToNode fields in
- connections which describe connections to the filter's pins.
-
-Arguments:
-
- OutFilterDescriptor - Pointer to the filter description.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(OutFilterDescriptor);
-
- return CMiniportTopologySYSVAD::GetDescription(OutFilterDescriptor);
-} // GetDescription
-
-//=============================================================================
-STDMETHODIMP
-CHandsetSpeakerMiniportTopology::Init
-(
- _In_ PUNKNOWN UnknownAdapter,
- _In_ PRESOURCELIST ResourceList,
- _In_ PPORTTOPOLOGY Port_
-)
-/*++
-
-Routine Description:
-
- The Init function initializes the miniport. Callers of this function
- should run at IRQL PASSIVE_LEVEL
-
-Arguments:
-
- UnknownAdapter - A pointer to the Iuknown interface of the adapter object.
-
- ResourceList - Pointer to the resource list to be supplied to the miniport
- during initialization. The port driver is free to examine the
- contents of the ResourceList. The port driver will not be
- modify the ResourceList contents.
-
- Port - Pointer to the topology port object that is linked with this miniport.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- UNREFERENCED_PARAMETER(ResourceList);
-
- PAGED_CODE();
-
- ASSERT(UnknownAdapter);
- ASSERT(Port_);
-
- DPF_ENTER(("[CHandsetSpeakerMiniportTopology::Init]"));
-
- NTSTATUS ntStatus;
-
- ntStatus =
- CMiniportTopologySYSVAD::Init
- (
- UnknownAdapter,
- Port_
- );
-
- return ntStatus;
-} // Init
-
-//=============================================================================
-STDMETHODIMP
-CHandsetSpeakerMiniportTopology::NonDelegatingQueryInterface
-(
- _In_ REFIID Interface,
- _COM_Outptr_ PVOID * Object
-)
-/*++
-
-Routine Description:
-
- QueryInterface for MiniportTopology
-
-Arguments:
-
- Interface - GUID of the interface
-
- Object - interface object to be returned.
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(Object);
-
- if (IsEqualGUIDAligned(Interface, IID_IUnknown))
- {
- *Object = PVOID(PUNKNOWN(this));
- }
- else if (IsEqualGUIDAligned(Interface, IID_IMiniport))
- {
- *Object = PVOID(PMINIPORT(this));
- }
- else if (IsEqualGUIDAligned(Interface, IID_IMiniportTopology))
- {
- *Object = PVOID(PMINIPORTTOPOLOGY(this));
- }
- else
- {
- *Object = NULL;
- }
-
- if (*Object)
- {
- // We reference the interface for the caller.
- PUNKNOWN(*Object)->AddRef();
- return(STATUS_SUCCESS);
- }
-
- return(STATUS_INVALID_PARAMETER);
-} // NonDelegatingQueryInterface
-
-//=============================================================================
-NTSTATUS
-CHandsetSpeakerMiniportTopology::PropertyHandlerJackDescription
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION )
-
-Arguments:
-
- PropertyRequest
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerJackDescription]"));
-
- ULONG cJackDescriptions = ARRAYSIZE(HandsetSpeakerJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = HandsetSpeakerJackDescriptions;
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION pDesc = (PKSJACK_DESCRIPTION)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlCopyMemory(pDesc, JackDescriptions[nPinId], sizeof(KSJACK_DESCRIPTION));
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-CHandsetSpeakerMiniportTopology::PropertyHandlerJackDescription2
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION2 )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandlerJackDescription2]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- ULONG cJackDescriptions = ARRAYSIZE(HandsetSpeakerJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = HandsetSpeakerJackDescriptions;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION2);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION2 pDesc = (PKSJACK_DESCRIPTION2)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlZeroMemory(pDesc, sizeof(KSJACK_DESCRIPTION2));
-
- //
- // Specifies the lower 16 bits of the DWORD parameter. This parameter indicates whether
- // the jack is currently active, streaming, idle, or hardware not ready.
- //
- pDesc->DeviceStateInfo = 0;
-
- //
- // From MSDN:
- // "If an audio device lacks jack presence detection, the IsConnected member of
- // the KSJACK_DESCRIPTION structure must always be set to TRUE. To remove the
- // ambiguity that results from this dual meaning of the TRUE value for IsConnected,
- // a client application can call IKsJackDescription2::GetJackDescription2 to read
- // the JackCapabilities flag of the KSJACK_DESCRIPTION2 structure. If this flag has
- // the JACKDESC2_PRESENCE_DETECT_CAPABILITY bit set, it indicates that the endpoint
- // does in fact support jack presence detection. In that case, the return value of
- // the IsConnected member can be interpreted to accurately reflect the insertion status
- // of the jack."
- //
- // Bit definitions:
- // 0x00000001 - JACKDESC2_PRESENCE_DETECT_CAPABILITY
- // 0x00000002 - JACKDESC2_DYNAMIC_FORMAT_CHANGE_CAPABILITY
- //
- pDesc->JackCapabilities = 0;
-
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_HandsetSpeakerTopoFilter
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Redirects property request to miniport object
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_HandsetSpeakerTopoFilter]"));
-
- // PropertryRequest structure is filled by portcls.
- // MajorTarget is a pointer to miniport object for miniports.
- //
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- PCHandsetSpeakerMiniportTopology pMiniport = (PCHandsetSpeakerMiniportTopology)PropertyRequest->MajorTarget;
-
- if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_Jack))
- {
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION)
- {
- ntStatus = pMiniport->PropertyHandlerJackDescription(PropertyRequest);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION2)
- {
- ntStatus = pMiniport->PropertyHandlerJackDescription2(PropertyRequest);
- }
- }
-
- return ntStatus;
-} // PropertyHandler_HandsetSpeakerTopoFilter
-
-#pragma code_seg()
-
diff --git a/audio/sysvad/PhoneAudioSample/handsetspeakertopo.h b/audio/sysvad/PhoneAudioSample/handsetspeakertopo.h
deleted file mode 100644
index 7b220f70..00000000
--- a/audio/sysvad/PhoneAudioSample/handsetspeakertopo.h
+++ /dev/null
@@ -1,86 +0,0 @@
-
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- handsetspeakertopo.h
-
-Abstract:
-
- Declaration of topology miniport for the handsetspeaker endpoint.
-
---*/
-
-#ifndef _SYSVAD_HANDSETSPEAKERTOPO_H_
-#define _SYSVAD_HANDSETSPEAKERTOPO_H_
-
-#include "basetopo.h"
-
-//=============================================================================
-// Classes
-//=============================================================================
-
-///////////////////////////////////////////////////////////////////////////////
-// CHandsetSpeakerMiniportTopology
-//
-
-class CHandsetSpeakerMiniportTopology :
- public CMiniportTopologySYSVAD,
- public IMiniportTopology,
- public CUnknown
-{
- public:
- DECLARE_STD_UNKNOWN();
- CHandsetSpeakerMiniportTopology
- (
- _In_opt_ PUNKNOWN UnknownOuter,
- _In_ PCFILTER_DESCRIPTOR *FilterDesc,
- _In_ USHORT DeviceMaxChannels
- )
- : CUnknown(UnknownOuter),
- CMiniportTopologySYSVAD(FilterDesc, DeviceMaxChannels)
- {}
-
- ~CHandsetSpeakerMiniportTopology();
-
- IMP_IMiniportTopology;
-
- NTSTATUS PropertyHandlerJackSinkInfo
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerJackDescription
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
- NTSTATUS PropertyHandlerJackDescription2
- (
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-};
-
-typedef CHandsetSpeakerMiniportTopology *PCHandsetSpeakerMiniportTopology;
-
-
-NTSTATUS
-CreateHandsetSpeakerMiniportTopology(
- _Out_ PUNKNOWN * Unknown,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN UnknownOuter,
- _When_((PoolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
- _In_ POOL_TYPE PoolType,
- _In_ PUNKNOWN UnknownAdapter,
- _In_opt_ PVOID DeviceContext,
- _In_ PENDPOINT_MINIPAIR MiniportPair
- );
-
-NTSTATUS PropertyHandler_HandsetSpeakerTopoFilter(_In_ PPCPROPERTY_REQUEST PropertyRequest);
-
-#endif // _SYSVAD_HANDSETSPEAKERTOPO_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/handsetspeakertoptable.h b/audio/sysvad/PhoneAudioSample/handsetspeakertoptable.h
deleted file mode 100644
index 68873e61..00000000
--- a/audio/sysvad/PhoneAudioSample/handsetspeakertoptable.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- handsetspeakertoptable.h
-
-Abstract:
-
- Declaration of topology tables for the handsetspeaker endpoint.
-
---*/
-
-#ifndef _SYSVAD_HANDSETSPEAKERTOPTABLE_H_
-#define _SYSVAD_HANDSETSPEAKERTOPTABLE_H_
-
-//=============================================================================
-static
-KSDATARANGE HandsetSpeakerTopoPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-//=============================================================================
-static
-PKSDATARANGE HandsetSpeakerTopoPinDataRangePointersBridge[] =
-{
- &HandsetSpeakerTopoPinDataRangesBridge[0]
-};
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR HandsetSpeakerTopoMiniportPins[] =
-{
- // KSPIN_TOPO_WAVEOUT_SOURCE
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(HandsetSpeakerTopoPinDataRangePointersBridge), // DataRangesCount
- HandsetSpeakerTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_IN, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSCATEGORY_AUDIO, // Category
- NULL, // Name
- 0 // Reserved
- }
- },
- // KSPIN_TOPO_LINEOUT_DEST
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(HandsetSpeakerTopoPinDataRangePointersBridge), // DataRangesCount
- HandsetSpeakerTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_OUT, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSNODETYPE_HANDSET, // Category
- NULL, // Name
- 0 // Reserved
- }
- }
-};
-
-//=============================================================================
-static
-KSJACK_DESCRIPTION HandsetSpeakerJackDesc =
-{
- KSAUDIO_SPEAKER_MONO,
- 0x0000, // no color
- eConnTypeUnknown,
- eGeoLocBottom,
- eGenLocInternal,
- ePortConnIntegratedDevice,
- TRUE
-};
-
-// Only return a KSJACK_DESCRIPTION for the physical bridge pin.
-static
-PKSJACK_DESCRIPTION HandsetSpeakerJackDescriptions[] =
-{
- NULL,
- &HandsetSpeakerJackDesc
-};
-
-//=============================================================================
-static
-PCCONNECTION_DESCRIPTOR HandsetSpeakerTopoMiniportConnections[] =
-{
- // FromNode, FromPin, ToNode, ToPin
- { PCFILTER_NODE, KSPIN_TOPO_WAVEOUT_SOURCE, PCFILTER_NODE, KSPIN_TOPO_LINEOUT_DEST}
-};
-
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesHandsetSpeakerTopoFilter[] =
-{
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_HandsetSpeakerTopoFilter
- },
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_HandsetSpeakerTopoFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetSpeakerTopoFilter, PropertiesHandsetSpeakerTopoFilter);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR HandsetSpeakerTopoMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationHandsetSpeakerTopoFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(HandsetSpeakerTopoMiniportPins), // PinCount
- HandsetSpeakerTopoMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- 0, // NodeCount
- NULL, // Nodes
- SIZEOF_ARRAY(HandsetSpeakerTopoMiniportConnections), // ConnectionCount
- HandsetSpeakerTopoMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories
-};
-
-#endif // _SYSVAD_HANDSETSPEAKERTOPTABLE_H_
-
-
diff --git a/audio/sysvad/PhoneAudioSample/handsetspeakerwavtable.h b/audio/sysvad/PhoneAudioSample/handsetspeakerwavtable.h
deleted file mode 100644
index 73548626..00000000
--- a/audio/sysvad/PhoneAudioSample/handsetspeakerwavtable.h
+++ /dev/null
@@ -1,550 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- handsetspeakerwavtable.h
-
-Abstract:
-
- Declaration of wave miniport tables for the handsetspeaker endpoint.
-
- Note: the HANDSETSPEAKER in this sample shows how to do h/w loopback
- for non-offloaded devices.
-
---*/
-
-#ifndef _SYSVAD_HANDSETSPEAKERWAVTABLE_H_
-#define _SYSVAD_HANDSETSPEAKERWAVTABLE_H_
-
-
-// To keep the code simple assume device supports only 48KHz, 16-bit, stereo (PCM and NON-PCM)
-
-
-#define HANDSETSPEAKER_DEVICE_MAX_CHANNELS 2 // Max Channels.
-
-#define HANDSETSPEAKER_HOST_MAX_CHANNELS 2 // Max Channels.
-#define HANDSETSPEAKER_HOST_MIN_BITS_PER_SAMPLE 16 // Min Bits Per Sample
-#define HANDSETSPEAKER_HOST_MAX_BITS_PER_SAMPLE 16 // Max Bits Per Sample
-#define HANDSETSPEAKER_HOST_MIN_SAMPLE_RATE 24000 // Min Sample Rate
-#define HANDSETSPEAKER_HOST_MAX_SAMPLE_RATE 96000 // Max Sample Rate
-
-#define HANDSETSPEAKER_LOOPBACK_MAX_CHANNELS HANDSETSPEAKER_HOST_MAX_CHANNELS // Must be equal to host pin's Max Channels.
-#define HANDSETSPEAKER_LOOPBACK_MIN_BITS_PER_SAMPLE HANDSETSPEAKER_HOST_MIN_BITS_PER_SAMPLE // Must be equal to host pin's Min Bits Per Sample
-#define HANDSETSPEAKER_LOOPBACK_MAX_BITS_PER_SAMPLE HANDSETSPEAKER_HOST_MAX_BITS_PER_SAMPLE // Must be equal to host pin's Max Bits Per Sample
-#define HANDSETSPEAKER_LOOPBACK_MIN_SAMPLE_RATE HANDSETSPEAKER_HOST_MIN_SAMPLE_RATE // Must be equal to host pin's Min Sample Rate
-#define HANDSETSPEAKER_LOOPBACK_MAX_SAMPLE_RATE HANDSETSPEAKER_HOST_MAX_SAMPLE_RATE // Must be equal to host pin's Max Sample Rate
-
-#define HANDSETSPEAKER_DOLBY_DIGITAL_MAX_CHANNELS 2 // Max Channels.
-#define HANDSETSPEAKER_DOLBY_DIGITAL_MIN_BITS_PER_SAMPLE 16 // Min Bits Per Sample
-#define HANDSETSPEAKER_DOLBY_DIGITAL_MAX_BITS_PER_SAMPLE 16 // Max Bits Per Sample
-#define HANDSETSPEAKER_DOLBY_DIGITAL_MIN_SAMPLE_RATE 44100 // Min Sample Rate
-#define HANDSETSPEAKER_DOLBY_DIGITAL_MAX_SAMPLE_RATE 44100 // Max Sample Rate
-
-//
-// Max # of pin instances.
-//
-#define HANDSETSPEAKER_MAX_INPUT_SYSTEM_STREAMS 3
-#define HANDSETSPEAKER_MAX_OUTPUT_LOOPBACK_STREAMS MAX_OUTPUT_LOOPBACK_STREAMS
-
-//=============================================================================
-static
-KSDATAFORMAT_WAVEFORMATEXTENSIBLE HandsetSpeakerHostPinSupportedDeviceFormats[] =
-{
- { // 0
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 24000,
- 96000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 1
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 32000,
- 128000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 2
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 44100,
- 176400,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 3
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 48000,
- 192000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 4
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 88200,
- 352800,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 5
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 96000,
- 384000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- }
-};
-
-//
-// Supported modes (only on streaming pins).
-//
-static
-MODE_AND_DEFAULT_FORMAT HandsetSpeakerHostPinSupportedDeviceModes[] =
-{
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_RAW,
- &HandsetSpeakerHostPinSupportedDeviceFormats[3].DataFormat, // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_DEFAULT,
- &HandsetSpeakerHostPinSupportedDeviceFormats[3].DataFormat, // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS,
- &HandsetSpeakerHostPinSupportedDeviceFormats[0].DataFormat, // 24KHz
- }
-};
-
-//
-// The entries here must follow the same order as the filter's pin
-// descriptor array.
-//
-static
-PIN_DEVICE_FORMATS_AND_MODES HandsetSpeakerPinDeviceFormatsAndModes[] =
-{
- {
- SystemRenderPin,
- HandsetSpeakerHostPinSupportedDeviceFormats,
- SIZEOF_ARRAY(HandsetSpeakerHostPinSupportedDeviceFormats),
- HandsetSpeakerHostPinSupportedDeviceModes,
- SIZEOF_ARRAY(HandsetSpeakerHostPinSupportedDeviceModes)
- },
- {
- RenderLoopbackPin,
- HandsetSpeakerHostPinSupportedDeviceFormats, // Must support all the formats supported by host pin
- SIZEOF_ARRAY(HandsetSpeakerHostPinSupportedDeviceFormats),
- NULL, // loopback doesn't support modes.
- 0
- },
- {
- BridgePin,
- NULL,
- 0,
- NULL,
- 0
- }
-};
-
-//=============================================================================
-static
-KSDATARANGE_AUDIO HandsetSpeakerPinDataRangesStream[] =
-{
- { // 0
- {
- sizeof(KSDATARANGE_AUDIO),
- KSDATARANGE_ATTRIBUTES, // An attributes list follows this data range
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- HANDSETSPEAKER_HOST_MAX_CHANNELS,
- HANDSETSPEAKER_HOST_MIN_BITS_PER_SAMPLE,
- HANDSETSPEAKER_HOST_MAX_BITS_PER_SAMPLE,
- HANDSETSPEAKER_HOST_MIN_SAMPLE_RATE,
- HANDSETSPEAKER_HOST_MAX_SAMPLE_RATE
- },
- { // 1
- {
- sizeof(KSDATARANGE_AUDIO),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- HANDSETSPEAKER_LOOPBACK_MAX_CHANNELS,
- HANDSETSPEAKER_LOOPBACK_MIN_BITS_PER_SAMPLE,
- HANDSETSPEAKER_LOOPBACK_MAX_BITS_PER_SAMPLE,
- HANDSETSPEAKER_LOOPBACK_MIN_SAMPLE_RATE,
- HANDSETSPEAKER_LOOPBACK_MAX_SAMPLE_RATE
- }
-};
-
-static
-PKSDATARANGE HandsetSpeakerPinDataRangePointersStream[] =
-{
- PKSDATARANGE(&HandsetSpeakerPinDataRangesStream[0]),
- PKSDATARANGE(&PinDataRangeAttributeList)
-};
-
-static
-PKSDATARANGE HandsetSpeakerPinDataRangePointersLoopbackStream[] =
-{
- PKSDATARANGE(&HandsetSpeakerPinDataRangesStream[1])
-};
-
-//=============================================================================
-static
-KSDATARANGE HandsetSpeakerPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-static
-PKSDATARANGE HandsetSpeakerPinDataRangePointersBridge[] =
-{
- &HandsetSpeakerPinDataRangesBridge[0]
-};
-
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR HandsetSpeakerWaveMiniportPins[] =
-{
- // Wave Out Streaming Pin (Renderer) KSPIN_WAVE_RENDER2_SINK_SYSTEM
- {
- HANDSETSPEAKER_MAX_INPUT_SYSTEM_STREAMS,
- HANDSETSPEAKER_MAX_INPUT_SYSTEM_STREAMS,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(HandsetSpeakerPinDataRangePointersStream),
- HandsetSpeakerPinDataRangePointersStream,
- KSPIN_DATAFLOW_IN,
- KSPIN_COMMUNICATION_SINK,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
- // Wave Out Streaming Pin (Renderer) KSPIN_WAVE_RENDER2_SINK_LOOPBACK
- {
- HANDSETSPEAKER_MAX_OUTPUT_LOOPBACK_STREAMS,
- HANDSETSPEAKER_MAX_OUTPUT_LOOPBACK_STREAMS,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(HandsetSpeakerPinDataRangePointersLoopbackStream),
- HandsetSpeakerPinDataRangePointersLoopbackStream,
- KSPIN_DATAFLOW_OUT,
- KSPIN_COMMUNICATION_SINK,
- &KSNODETYPE_AUDIO_LOOPBACK,
- NULL,
- 0
- }
- },
- // Wave Out Bridge Pin (Renderer) KSPIN_WAVE_RENDER2_SOURCE
- {
- 0,
- 0,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(HandsetSpeakerPinDataRangePointersBridge),
- HandsetSpeakerPinDataRangePointersBridge,
- KSPIN_DATAFLOW_OUT,
- KSPIN_COMMUNICATION_NONE,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
-};
-
-//=============================================================================
-static
-PCPROPERTY_ITEM HandsetSpeakerPropertiesVolume[] =
-{
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_VOLUMELEVEL,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetSpeakerVolume, HandsetSpeakerPropertiesVolume);
-
-//=============================================================================
-static
-PCPROPERTY_ITEM HandsetSpeakerPropertiesMute[] =
-{
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_MUTE,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetSpeakerMute, HandsetSpeakerPropertiesMute);
-
-//=============================================================================
-static
-PCPROPERTY_ITEM HandsetSpeakerPropertiesPeakMeter[] =
-{
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_PEAKMETER2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_CPU_RESOURCES,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetSpeakerPeakMeter, HandsetSpeakerPropertiesPeakMeter);
-
-//=============================================================================
-static
-PCNODE_DESCRIPTOR HandsetSpeakerWaveMiniportNodes[] =
-{
- // KSNODE_WAVE_SUM
- {
- 0, // Flags
- NULL, // AutomationTable
- &KSNODETYPE_SUM, // Type
- NULL // Name
- },
- // KSNODE_WAVE_VOLUME
- {
- 0, // Flags
- &AutomationHandsetSpeakerVolume, // AutomationTable
- &KSNODETYPE_VOLUME, // Type
- &KSAUDFNAME_WAVE_VOLUME // Name
- },
- // KSNODE_WAVE_MUTE
- {
- 0, // Flags
- &AutomationHandsetSpeakerMute, // AutomationTable
- &KSNODETYPE_MUTE, // Type
- &KSAUDFNAME_WAVE_MUTE // Name
- },
- // KSNODE_WAVE_PEAKMETER
- {
- 0, // Flags
- &AutomationHandsetSpeakerPeakMeter, // AutomationTable
- &KSNODETYPE_PEAKMETER, // Type
- &KSAUDFNAME_PEAKMETER // Name
- }
-};
-
-C_ASSERT( KSNODE_WAVE_SUM == 0 );
-C_ASSERT( KSNODE_WAVE_VOLUME == 1 );
-C_ASSERT( KSNODE_WAVE_MUTE == 2 );
-C_ASSERT( KSNODE_WAVE_PEAKMETER == 3 );
-
-
-//=============================================================================
-//
-// Note:
-// 1) A sum node can be used to 'sum' multiple streams associated to different
-// instances of the same pin.
-// 2) Any node output has an implicit 'tee' node associated with it. Thus in the
-// scenario below it is ok for the peak meter node to have two identical outputs.
-//
-// ----------------------------------------------------------
-// | |
-// System Pin 0 | |-----| |--------| |------| |-----------| |--> 1 Loopback Pin
-// [instances:0...n]-->| -->| Sum |--->| Volume |-->| Mute |-->| PeakMeter |--> |
-// | |-----| |--------| |------| |-----------| |--> 2 KSPIN_WAVE_RENDER2_SOURCE
-// | |
-// ----------------------------------------------------------
-
-static
-PCCONNECTION_DESCRIPTOR HandsetSpeakerWaveMiniportConnections[] =
-{
- { PCFILTER_NODE, KSPIN_WAVE_RENDER2_SINK_SYSTEM, KSNODE_WAVE_SUM, 1 },
- { KSNODE_WAVE_SUM, 0, KSNODE_WAVE_VOLUME, 1 },
- { KSNODE_WAVE_VOLUME, 0, KSNODE_WAVE_MUTE, 1 },
- { KSNODE_WAVE_MUTE, 0, KSNODE_WAVE_PEAKMETER, 1 },
- { KSNODE_WAVE_PEAKMETER, 2, PCFILTER_NODE, KSPIN_WAVE_RENDER2_SINK_LOOPBACK },
- { KSNODE_WAVE_PEAKMETER, 0, PCFILTER_NODE, KSPIN_WAVE_RENDER2_SOURCE },
-};
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesHandsetSpeakerWaveFilter[] =
-{
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationHandsetSpeakerWaveFilter, PropertiesHandsetSpeakerWaveFilter);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR HandsetSpeakerWaveMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationHandsetSpeakerWaveFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(HandsetSpeakerWaveMiniportPins), // PinCount
- HandsetSpeakerWaveMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- SIZEOF_ARRAY(HandsetSpeakerWaveMiniportNodes), // NodeCount
- HandsetSpeakerWaveMiniportNodes, // Nodes
- SIZEOF_ARRAY(HandsetSpeakerWaveMiniportConnections), // ConnectionCount
- HandsetSpeakerWaveMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories - use defaults (audio, render, capture)
-};
-
-#endif // _SYSVAD_HANDSETSPEAKERWAVTABLE_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/michstopo.cpp b/audio/sysvad/PhoneAudioSample/michstopo.cpp
deleted file mode 100644
index f96a58e5..00000000
--- a/audio/sysvad/PhoneAudioSample/michstopo.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- michstopo.cpp
-
-Abstract:
-
- Implementation of topology miniport for the mic (external: headset).
-
---*/
-
-#pragma warning (disable : 4127)
-
-#include <sysvad.h>
-#include "simple.h"
-#include "mintopo.h"
-#include "michstopo.h"
-#include "michstoptable.h"
-
-
-#pragma code_seg("PAGE")
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_MicHsJackDescription
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_MicHsJackDescription]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- ULONG cJackDescriptions = ARRAYSIZE(MicHsJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = MicHsJackDescriptions;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION pDesc = (PKSJACK_DESCRIPTION)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlCopyMemory(pDesc, JackDescriptions[nPinId], sizeof(KSJACK_DESCRIPTION));
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_MicHsJackDescription2
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION2 )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_MicHsJackDescription2]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- ULONG cJackDescriptions = ARRAYSIZE(MicHsJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = MicHsJackDescriptions;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION2);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION2 pDesc = (PKSJACK_DESCRIPTION2)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlZeroMemory(pDesc, sizeof(KSJACK_DESCRIPTION2));
-
- //
- // Specifies the lower 16 bits of the DWORD parameter. This parameter indicates whether
- // the jack is currently active, streaming, idle, or hardware not ready.
- //
- pDesc->DeviceStateInfo = 0;
-
- //
- // From MSDN:
- // "If an audio device lacks jack presence detection, the IsConnected member of
- // the KSJACK_DESCRIPTION structure must always be set to TRUE. To remove the
- // ambiguity that results from this dual meaning of the TRUE value for IsConnected,
- // a client application can call IKsJackDescription2::GetJackDescription2 to read
- // the JackCapabilities flag of the KSJACK_DESCRIPTION2 structure. If this flag has
- // the JACKDESC2_PRESENCE_DETECT_CAPABILITY bit set, it indicates that the endpoint
- // does in fact support jack presence detection. In that case, the return value of
- // the IsConnected member can be interpreted to accurately reflect the insertion status
- // of the jack."
- //
- // Bit definitions:
- // 0x00000001 - JACKDESC2_PRESENCE_DETECT_CAPABILITY
- // 0x00000002 - JACKDESC2_DYNAMIC_FORMAT_CHANGE_CAPABILITY
- //
- pDesc->JackCapabilities = JACKDESC2_PRESENCE_DETECT_CAPABILITY;
-
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_MicHsTopoFilter
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Redirects property request to miniport object
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_MicHsTopoFilter]"));
-
- // PropertryRequest structure is filled by portcls.
- // MajorTarget is a pointer to miniport object for miniports.
- //
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
-
- //
- // This line shows how to get a pointer to the miniport topology object.
- //
- PCMiniportTopology pMiniport = (PCMiniportTopology)PropertyRequest->MajorTarget;
- UNREFERENCED_VAR(pMiniport);
-
- if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_Jack))
- {
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION)
- {
- ntStatus = PropertyHandler_MicHsJackDescription(PropertyRequest);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION2)
- {
- ntStatus = PropertyHandler_MicHsJackDescription2(PropertyRequest);
- }
- }
-
- return ntStatus;
-} // PropertyHandler_MicHsTopoFilter
-
-#pragma code_seg()
-
diff --git a/audio/sysvad/PhoneAudioSample/michstopo.h b/audio/sysvad/PhoneAudioSample/michstopo.h
deleted file mode 100644
index b8f9b106..00000000
--- a/audio/sysvad/PhoneAudioSample/michstopo.h
+++ /dev/null
@@ -1,21 +0,0 @@
-
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- michstopo.h
-
-Abstract:
-
- Declaration of topology miniport for the mic (external: headset).
-
---*/
-
-#ifndef _SYSVAD_MICHSTOPO_H_
-#define _SYSVAD_MICHSTOPO_H_
-
-NTSTATUS PropertyHandler_MicHsTopoFilter(_In_ PPCPROPERTY_REQUEST PropertyRequest);
-
-#endif // _SYSVAD_MICHSTOPO_H_
diff --git a/audio/sysvad/PhoneAudioSample/michstoptable.h b/audio/sysvad/PhoneAudioSample/michstoptable.h
deleted file mode 100644
index 0b4ed73c..00000000
--- a/audio/sysvad/PhoneAudioSample/michstoptable.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- michstopotable.h
-
-Abstract:
-
- Declaration of topology table for the mic (external: headset)
-
---*/
-
-#ifndef _SYSVAD_MICHSTOPTABLE_H_
-#define _SYSVAD_MICHSTOPTABLE_H_
-
-#include <mintopo.h>
-
-// Function declarations.
-NTSTATUS
-PropertyHandler_MicHsTopoFilter(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
- );
-
-//=============================================================================
-static
-KSDATARANGE MicHsTopoPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-//=============================================================================
-static
-PKSDATARANGE MicHsTopoPinDataRangePointersBridge[] =
-{
- &MicHsTopoPinDataRangesBridge[0]
-};
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR MicHsTopoMiniportPins[] =
-{
- // KSPIN - topology filter in-pin
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(MicHsTopoPinDataRangePointersBridge),// DataRangesCount
- MicHsTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_IN, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSNODETYPE_HEADSET_MICROPHONE, // Category
- NULL, // Name
- 0 // Reserved
- }
- },
-
- // KSPIN - topology filter out-in
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(MicHsTopoPinDataRangePointersBridge),// DataRangesCount
- MicHsTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_OUT, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSCATEGORY_AUDIO, // Category
- NULL, // Name
- 0 // Reserved
- }
- }
-};
-
-//=============================================================================
-static
-KSJACK_DESCRIPTION MicHsJackDesc =
-{
- KSAUDIO_SPEAKER_MONO,
- JACKDESC_RGB(179, 201, 140),
- eConnTypeCombination,
- eGeoLocRear,
- eGenLocPrimaryBox,
- ePortConnJack,
- FALSE // NOTE: For convenience, wired headset jacks will be "unplugged" at boot.
-};
-
-//=============================================================================
-// Only return a KSJACK_DESCRIPTION for the physical bridge pin.
-static
-PKSJACK_DESCRIPTION MicHsJackDescriptions[] =
-{
- &MicHsJackDesc,
- NULL
-};
-
-//=============================================================================
-static
-PCPROPERTY_ITEM MicHsPropertiesVolume[] =
-{
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_VOLUMELEVEL,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_Topology
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationMicHsVolume, MicHsPropertiesVolume);
-
-//=============================================================================
-static
-PCPROPERTY_ITEM MicHsPropertiesMute[] =
-{
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_MUTE,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_Topology
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationMicHsMute, MicHsPropertiesMute);
-
-//=============================================================================
-static
-PCPROPERTY_ITEM MicHsPropertiesPeakMeter[] =
-{
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_PEAKMETER2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_Topology
- },
- {
- &KSPROPSETID_Audio,
- KSPROPERTY_AUDIO_CPU_RESOURCES,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_Topology
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationMicHsPeakMeter, MicHsPropertiesPeakMeter);
-
-//=============================================================================
-static
-PCNODE_DESCRIPTOR MicHsTopologyNodes[] =
-{
- // KSNODE_TOPO_VOLUME
- {
- 0, // Flags
- &AutomationMicHsVolume, // AutomationTable
- &KSNODETYPE_VOLUME, // Type
- &KSAUDFNAME_MIC_VOLUME // Name
- },
- // KSNODE_TOPO_MUTE
- {
- 0, // Flags
- &AutomationMicHsMute, // AutomationTable
- &KSNODETYPE_MUTE, // Type
- &KSAUDFNAME_MIC_MUTE // Name
- },
- // KSNODE_TOPO_PEAKMETER
- {
- 0, // Flags
- &AutomationMicHsPeakMeter, // AutomationTable
- &KSNODETYPE_PEAKMETER, // Type
- &KSAUDFNAME_PEAKMETER // Name
- }
-};
-
-C_ASSERT( KSNODE_TOPO_VOLUME == 0 );
-C_ASSERT( KSNODE_TOPO_MUTE == 1 );
-C_ASSERT( KSNODE_TOPO_PEAKMETER == 2 );
-
-//=============================================================================
-static
-PCCONNECTION_DESCRIPTOR MicHsMiniportConnections[] =
-{
- // FromNode, FromPin, ToNode, ToPin
- { PCFILTER_NODE, KSPIN_TOPO_MIC_ELEMENTS, KSNODE_TOPO_VOLUME, 1 },
- { KSNODE_TOPO_VOLUME, 0, KSNODE_TOPO_MUTE, 1 },
- { KSNODE_TOPO_MUTE, 0, KSNODE_TOPO_PEAKMETER, 1 },
- { KSNODE_TOPO_PEAKMETER, 0, PCFILTER_NODE, KSPIN_TOPO_BRIDGE }
-};
-
-
-//=============================================================================
-static
-PCPROPERTY_ITEM MicHsPropertiesTopoFilter[] =
-{
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_MicHsTopoFilter
- },
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_MicHsTopoFilter
- }
-};
-
-static PCEVENT_ITEM MicHsJackInfoChangeEvent[] =
-{
- {
- &KSEVENTSETID_PinCapsChange, // Something changed
- KSEVENT_PINCAPS_JACKINFOCHANGE, // Jack Info Changes
- KSEVENT_TYPE_ENABLE | KSEVENT_TYPE_BASICSUPPORT,
- CMiniportTopology_EventHandler_JackState
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP_EVENT(AutomationMicHsTopoFilter, MicHsPropertiesTopoFilter, MicHsJackInfoChangeEvent);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR MicHsTopoMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationMicHsTopoFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(MicHsTopoMiniportPins), // PinCount
- MicHsTopoMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- SIZEOF_ARRAY(MicHsTopologyNodes), // NodeCount
- MicHsTopologyNodes, // Nodes
- SIZEOF_ARRAY(MicHsMiniportConnections), // ConnectionCount
- MicHsMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories
-};
-
-#endif // _SYSVAD_MICHSTOPTABLE_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/michswavtable.h b/audio/sysvad/PhoneAudioSample/michswavtable.h
deleted file mode 100644
index 4bfa66db..00000000
--- a/audio/sysvad/PhoneAudioSample/michswavtable.h
+++ /dev/null
@@ -1,447 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- michswavtable.h
-
-Abstract:
-
- Declaration of wave miniport tables for the mic (external: headset).
-
---*/
-
-#ifndef _SYSVAD_MICHSWAVTABLE_H_
-#define _SYSVAD_MICHSWAVTABLE_H_
-
-//
-// Mic in (external: headset) range.
-//
-#define MICHS_DEVICE_MAX_CHANNELS 1 // Max Channels.
-#define MICHS_MIN_BITS_PER_SAMPLE_PCM 16 // Min Bits Per Sample
-#define MICHS_MAX_BITS_PER_SAMPLE_PCM 16 // Max Bits Per Sample
-#define MICHS_MIN_SAMPLE_RATE 8000 // Min Sample Rate
-#define MICHS_MAX_SAMPLE_RATE 48000 // Max Sample Rate
-
-//
-// Max # of pin instances.
-//
-#define MICHS_MAX_INPUT_STREAMS 4
-
-//=============================================================================
-static
-KSDATAFORMAT_WAVEFORMATEXTENSIBLE MicHsPinSupportedDeviceFormats[] =
-{
- { // 0
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 8000,
- 16000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 1
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 11025,
- 22050,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 2
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 16000,
- 32000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 3
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 22050,
- 44100,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 4
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 24000,
- 48000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 5
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 32000,
- 64000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 6
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 44100,
- 88200,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 7
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 1,
- 48000,
- 96000,
- 2,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_MONO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- }
-};
-
-//
-// Supported modes (only on streaming pins).
-//
-static
-MODE_AND_DEFAULT_FORMAT MicHsPinSupportedDeviceModes[] =
-{
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_RAW,
- &MicHsPinSupportedDeviceFormats[SIZEOF_ARRAY(MicHsPinSupportedDeviceFormats) - 1].DataFormat, // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_DEFAULT,
- &MicHsPinSupportedDeviceFormats[SIZEOF_ARRAY(MicHsPinSupportedDeviceFormats) - 1].DataFormat, // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_SPEECH,
- &MicHsPinSupportedDeviceFormats[2].DataFormat, // 16KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS,
- &MicHsPinSupportedDeviceFormats[4].DataFormat, // 24KHz
- }
-};
-
-//
-// The entries here must follow the same order as the filter's pin
-// descriptor array.
-//
-static
-PIN_DEVICE_FORMATS_AND_MODES MicHsPinDeviceFormatsAndModes[] =
-{
- {
- BridgePin,
- NULL,
- 0,
- NULL,
- 0
- },
- {
- SystemCapturePin,
- MicHsPinSupportedDeviceFormats,
- SIZEOF_ARRAY(MicHsPinSupportedDeviceFormats),
- MicHsPinSupportedDeviceModes,
- SIZEOF_ARRAY(MicHsPinSupportedDeviceModes)
- }
-};
-
-//=============================================================================
-static
-KSDATARANGE_AUDIO MicHsPinDataRangesStream[] =
-{
- {
- {
- sizeof(KSDATARANGE_AUDIO),
- KSDATARANGE_ATTRIBUTES, // An attributes list follows this data range
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- MICHS_DEVICE_MAX_CHANNELS,
- MICHS_MIN_BITS_PER_SAMPLE_PCM,
- MICHS_MAX_BITS_PER_SAMPLE_PCM,
- MICHS_MIN_SAMPLE_RATE,
- MICHS_MAX_SAMPLE_RATE
- },
-};
-
-static
-PKSDATARANGE MicHsPinDataRangePointersStream[] =
-{
- PKSDATARANGE(&MicHsPinDataRangesStream[0]),
- PKSDATARANGE(&PinDataRangeAttributeList),
-};
-
-//=============================================================================
-static
-KSDATARANGE MicHsPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-static
-PKSDATARANGE MicHsPinDataRangePointersBridge[] =
-{
- &MicHsPinDataRangesBridge[0]
-};
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR MicHsWaveMiniportPins[] =
-{
- // Wave In Bridge Pin (Capture - From Topology) KSPIN_WAVE_BRIDGE
- {
- 0,
- 0,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(MicHsPinDataRangePointersBridge),
- MicHsPinDataRangePointersBridge,
- KSPIN_DATAFLOW_IN,
- KSPIN_COMMUNICATION_NONE,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
-
- // Wave In Streaming Pin (Capture) KSPIN_WAVEIN_HOST
- {
- MICHS_MAX_INPUT_STREAMS,
- MICHS_MAX_INPUT_STREAMS,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(MicHsPinDataRangePointersStream),
- MicHsPinDataRangePointersStream,
- KSPIN_DATAFLOW_OUT,
- KSPIN_COMMUNICATION_SINK,
- &KSCATEGORY_AUDIO,
- &KSAUDFNAME_RECORDING_CONTROL,
- 0
- }
- }
-};
-
-//=============================================================================
-static
-PCNODE_DESCRIPTOR MicHsWaveMiniportNodes[] =
-{
- // KSNODE_WAVE_ADC
- {
- 0, // Flags
- NULL, // AutomationTable
- &KSNODETYPE_ADC, // Type
- NULL // Name
- }
-};
-
-//=============================================================================
-static
-PCCONNECTION_DESCRIPTOR MicHsWaveMiniportConnections[] =
-{
- { PCFILTER_NODE, KSPIN_WAVE_BRIDGE, KSNODE_WAVE_ADC, 1 },
- { KSNODE_WAVE_ADC, 0, PCFILTER_NODE, KSPIN_WAVEIN_HOST }
-};
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesMicHsWaveFilter[] =
-{
- {
- &KSPROPSETID_General,
- KSPROPERTY_GENERAL_COMPONENTID,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationMicHsWaveFilter, PropertiesMicHsWaveFilter);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR MicHsWaveMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationMicHsWaveFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(MicHsWaveMiniportPins), // PinCount
- MicHsWaveMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- SIZEOF_ARRAY(MicHsWaveMiniportNodes), // NodeCount
- MicHsWaveMiniportNodes, // Nodes
- SIZEOF_ARRAY(MicHsWaveMiniportConnections), // ConnectionCount
- MicHsWaveMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories - use defaults (audio, render, capture)
-};
-
-#endif // _SYSVAD_MICHSWAVTABLE_H_
diff --git a/audio/sysvad/PhoneAudioSample/minipairs.h b/audio/sysvad/PhoneAudioSample/minipairs.h
deleted file mode 100644
index 6b219462..00000000
--- a/audio/sysvad/PhoneAudioSample/minipairs.h
+++ /dev/null
@@ -1,602 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- minipairs.h
-
-Abstract:
-
- Local audio endpoint filter definitions.
-
---*/
-
-#ifndef _SYSVAD_MINIPAIRS_H_
-#define _SYSVAD_MINIPAIRS_H_
-
-#include "speakertopo.h"
-#include "speakertoptable.h"
-#include "speakerwavtable.h"
-
-#include "speakerhstopo.h"
-#include "speakerhstoptable.h"
-#include "speakerhswavtable.h"
-
-#include "michstopo.h"
-#include "michstoptable.h"
-#include "michswavtable.h"
-
-#include "micarraytopo.h"
-#include "micarray1toptable.h"
-#include "micarraywavtable.h"
-
-#include "cellulartopo.h"
-#include "cellularwave.h"
-#include "cellulartoptable.h"
-#include "cellularwavtable.h"
-
-#include "fmtopo.h"
-#include "fmwave.h"
-#include "fmtoptable.h"
-#include "fmwavtable.h"
-
-#include "handsetspeakertopo.h"
-#include "handsetspeakertoptable.h"
-#include "handsetspeakerwavtable.h"
-
-#include "handsetmictopo.h"
-#include "handsetmictoptable.h"
-#include "handsetmicwavtable.h"
-
-
-NTSTATUS
-CreateMiniportWaveRTSYSVAD
-(
- _Out_ PUNKNOWN *,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN,
- _In_ POOL_TYPE,
- _In_ PUNKNOWN,
- _In_opt_ PVOID,
- _In_ PENDPOINT_MINIPAIR
-);
-
-NTSTATUS
-CreateMiniportTopologySYSVAD
-(
- _Out_ PUNKNOWN *,
- _In_ REFCLSID,
- _In_opt_ PUNKNOWN,
- _In_ POOL_TYPE,
- _In_ PUNKNOWN,
- _In_opt_ PVOID,
- _In_ PENDPOINT_MINIPAIR
-);
-
-//
-// Describe buffer size constraints for WaveRT buffers
-//
-static struct
-{
- KSAUDIO_PACKETSIZE_CONSTRAINTS2 TransportPacketConstraints;
- KSAUDIO_PACKETSIZE_PROCESSINGMODE_CONSTRAINT AdditionalProcessingConstraints[1];
-} SysvadWaveRtPacketSizeConstraintsRender =
-{
- {
- 2 * HNSTIME_PER_MILLISECOND, // 2 ms minimum processing interval
- FILE_BYTE_ALIGNMENT, // 1 byte packet size alignment
- 0, // no maximum packet size constraint
- 2, // 2 processing constraints follow
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_DEFAULT, // constraint for default processing mode
- 128, // 128 samples per processing frame
- 0, // NA hns per processing frame
- },
- },
- {
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_MOVIE, // constraint for movie processing mode
- 1024, // 1024 samples per processing frame
- 0, // NA hns per processing frame
- },
- }
-};
-
-const SYSVAD_DEVPROPERTY SysvadWaveFilterInterfacePropertiesRender[] =
-{
- {
- &DEVPKEY_KsAudio_PacketSize_Constraints2, // Key
- DEVPROP_TYPE_BINARY, // Type
- sizeof(SysvadWaveRtPacketSizeConstraintsRender), // BufferSize
- &SysvadWaveRtPacketSizeConstraintsRender, // Buffer
- },
-};
-
-static struct
-{
- KSAUDIO_PACKETSIZE_CONSTRAINTS2 TransportPacketConstraints;
-} SysvadWaveRtPacketSizeConstraintsCapture =
-{
- {
- 2 * HNSTIME_PER_MILLISECOND, // 2 ms minimum processing interval
- FILE_BYTE_ALIGNMENT, // 1 byte packet size alignment
- 0x100000, // 1 MB maximum packet size
- 1, // 1 processing constraint follows
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS, // constraint for communications processing mode
- 0, // NA samples per processing frame
- 20 * HNSTIME_PER_MILLISECOND, // 200000 hns (20ms) per processing frame
- },
- },
-};
-
-const SYSVAD_DEVPROPERTY SysvadWaveFilterInterfacePropertiesCapture[] =
-{
- {
- &DEVPKEY_KsAudio_PacketSize_Constraints2, // Key
- DEVPROP_TYPE_BINARY, // Type
- sizeof(SysvadWaveRtPacketSizeConstraintsCapture), // BufferSize
- &SysvadWaveRtPacketSizeConstraintsCapture, // Buffer
- },
-};
-
-//
-// Render miniports.
-//
-
-/*********************************************************************
-* Topology/Wave bridge connection for speaker (internal) *
-* *
-* +------+ +------+ *
-* | Wave | | Topo | *
-* | | | | *
-* System --->|0 2|---> Loopback | | *
-* | | | | *
-* Offload --->|1 3|--------------->|0 1|---> Line Out *
-* | | | | *
-* +------+ +------+ *
-*********************************************************************/
-static
-PHYSICALCONNECTIONTABLE SpeakerTopologyPhysicalConnections[] =
-{
- {
- KSPIN_TOPO_WAVEOUT_SOURCE, // TopologyIn
- KSPIN_WAVE_RENDER_SOURCE, // WaveOut
- CONNECTIONTYPE_WAVE_OUTPUT
- }
-};
-
-static
-ENDPOINT_MINIPAIR SpeakerMiniports =
-{
- eSpeakerDevice,
- SPEAKER_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
- NULL, // optional template name
- CreateMiniportTopologySYSVAD,
- &SpeakerTopoMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- L"WaveSpeaker", // make sure this or the template name matches with KSNAME_WaveSpeaker in the inf's [Strings] section
- NULL, // optional template name
- CreateMiniportWaveRTSYSVAD,
- &SpeakerWaveMiniportFilterDescriptor,
- ARRAYSIZE(SysvadWaveFilterInterfacePropertiesRender), // Interface properties
- SysvadWaveFilterInterfacePropertiesRender,
- SPEAKER_DEVICE_MAX_CHANNELS,
- SpeakerPinDeviceFormatsAndModes,
- SIZEOF_ARRAY(SpeakerPinDeviceFormatsAndModes),
- SpeakerTopologyPhysicalConnections,
- SIZEOF_ARRAY(SpeakerTopologyPhysicalConnections),
- ENDPOINT_OFFLOAD_SUPPORTED,
- SpeakerModulesWaveFilter,
- SIZEOF_ARRAY(SpeakerModulesWaveFilter),
- &SpeakerModuleNotificationDeviceId,
-};
-
-/*********************************************************************
-* Topology/Wave bridge connection for speaker (external:headset) *
-* *
-* +------+ +------+ *
-* | Wave | | Topo | *
-* | | | | *
-* System --->|0 2|---> Loopback | | *
-* | | | | *
-* Offload --->|1 3|--------------->|0 1|---> Line Out *
-* | | | | *
-* +------+ +------+ *
-*********************************************************************/
-static
-PHYSICALCONNECTIONTABLE SpeakerHsTopologyPhysicalConnections[] =
-{
- {
- KSPIN_TOPO_WAVEOUT_SOURCE, // TopologyIn
- KSPIN_WAVE_RENDER_SOURCE, // WaveOut
- CONNECTIONTYPE_WAVE_OUTPUT
- }
-};
-
-static
-ENDPOINT_MINIPAIR SpeakerHsMiniports =
-{
- eSpeakerHsDevice,
- SPEAKER_HEADSET_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
- NULL, // optional template name
- CreateMiniportTopologySYSVAD,
- &SpeakerHsTopoMiniportFilterDescriptor, // use the speaker headset topo filter descriptor, not headset.
- 0, NULL, // Interface properties
- L"WaveSpeakerHeadset", // make sure this or the template name matches with KSNAME_WaveSpeakerHeadset in the inf's [Strings] section
- NULL, // optional template name
- CreateMiniportWaveRTSYSVAD,
- &SpeakerHsWaveMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- SPEAKERHS_DEVICE_MAX_CHANNELS,
- SpeakerHsPinDeviceFormatsAndModes,
- SIZEOF_ARRAY(SpeakerHsPinDeviceFormatsAndModes),
- SpeakerHsTopologyPhysicalConnections,
- SIZEOF_ARRAY(SpeakerHsTopologyPhysicalConnections),
- ENDPOINT_OFFLOAD_SUPPORTED,
- NULL, 0, NULL, // audio module settings.
-};
-
-//
-// headset microphone miniports.
-//
-
-/*********************************************************************
-* Topology/Wave bridge connection for mic in *
-* *
-* +------+ +------+ *
-* | Topo | | Wave | *
-* | | | | *
-* Mic in --->|0 1|===>|0 1|---> Capture Host Pin *
-* | | | | *
-* +------+ +------+ *
-*********************************************************************/
-static
-PHYSICALCONNECTIONTABLE MicHsTopologyPhysicalConnections[] =
-{
- {
- KSPIN_TOPO_BRIDGE, // TopologyOut
- KSPIN_WAVE_BRIDGE, // WaveIn
- CONNECTIONTYPE_TOPOLOGY_OUTPUT
- }
-};
-
-static
-ENDPOINT_MINIPAIR MicHsMiniports =
-{
- eMicHsDevice,
- MIC_HEADSET_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
- NULL, // optional template name
- CreateMiniportTopologySYSVAD,
- &MicHsTopoMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- L"WaveMicHeadset", // make sure this or the template name matches with KSNAME_WaveMicHeadset in the inf's [Strings] section
- NULL, // optional template name
- CreateMiniportWaveRTSYSVAD,
- &MicHsWaveMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- MICHS_DEVICE_MAX_CHANNELS,
- MicHsPinDeviceFormatsAndModes,
- SIZEOF_ARRAY(MicHsPinDeviceFormatsAndModes),
- MicHsTopologyPhysicalConnections,
- SIZEOF_ARRAY(MicHsTopologyPhysicalConnections),
- ENDPOINT_NO_FLAGS,
- NULL, 0, NULL, // audio module settings.
-};
-
-
-//
-// Capture miniports.
-//
-
-/*********************************************************************
-* Topology/Wave bridge connection for mic array 1 (front) *
-* *
-* +------+ +------+ *
-* | Topo | | Wave | *
-* | | | | *
-* Mic in --->|0 1|===>|0 1|---> Capture Host Pin *
-* | | | | *
-* +------+ +------+ *
-*********************************************************************/
-static
-PHYSICALCONNECTIONTABLE MicArray1TopologyPhysicalConnections[] =
-{
- {
- KSPIN_TOPO_BRIDGE, // TopologyOut
- KSPIN_WAVE_BRIDGE, // WaveIn
- CONNECTIONTYPE_TOPOLOGY_OUTPUT
- }
-};
-
-static
-ENDPOINT_MINIPAIR MicArray1Miniports =
-{
- eMicArrayDevice1,
- L"TopologyMicArray1", // make sure this or the template name matches with KSNAME_TopologyMicArray1 in the inf's [Strings] section
- NULL, // optional template name
- CreateMicArrayMiniportTopology,
- &MicArray1TopoMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- L"WaveMicArray1", // make sure this or the tempalte name matches with KSNAME_WaveMicArray1 in the inf's [Strings] section
- NULL, // optional template name
- CreateMiniportWaveRTSYSVAD,
- &MicArrayWaveMiniportFilterDescriptor,
- ARRAYSIZE(SysvadWaveFilterInterfacePropertiesCapture), // Interface properties
- SysvadWaveFilterInterfacePropertiesCapture,
- MICARRAY_DEVICE_MAX_CHANNELS,
- MicArrayPinDeviceFormatsAndModes,
- SIZEOF_ARRAY(MicArrayPinDeviceFormatsAndModes),
- MicArray1TopologyPhysicalConnections,
- SIZEOF_ARRAY(MicArray1TopologyPhysicalConnections),
- ENDPOINT_SOUNDDETECTOR_SUPPORTED,
- NULL, 0, NULL, // audio module settings.
-};
-
-/*********************************************************************
-* Topology/Wave bridge connection for cellular endpoint *
-* *
-* +------+ +------+ *
-* | Wave1| | Topo | *
-* | | | | *
-* | | | | *
-* | | | | *
-* System BiDi <--|0 1|<---------------|1 0|<-- BIDI *
-* | | | | *
-* +------+ | | *
-* | | *
-* +------+ | | *
-* | Wave2| | | *
-* | | | | *
-* | | | | *
-* | | | | *
-* System BiDi <--|0 1|<---------------|3 2|<-- BIDI *
-* | | | | *
-* +------+ +------+ *
-* *
-*********************************************************************/
-
-static
-PHYSICALCONNECTIONTABLE CellularTopologyPhysicalConnections[] =
-{
- {
- KSPIN_TOPO_BIDI1_BRIDGE, // TopologyOut
- KSPIN_WAVE_BIDI_BRIDGE, // WaveIn
- CONNECTIONTYPE_TOPOLOGY_OUTPUT
- }
-};
-
-static
-ENDPOINT_MINIPAIR CellularMiniports =
-{
- eCellularDevice,
- L"TopologyCellular", // make sure this or the template name matches with KSNAME_TopologyCellular in the inf's [Strings] section
- NULL, // optional template name
- CreateCellularMiniportTopology,
- &CellularTopoMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- L"WaveCellular", // make sure this or the template name matches with KSNAME_WaveCellular in the inf's [Strings] section
- NULL, // optional template name
- CreateCellularMiniportWaveRT,
- &CellularWaveMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- CELLULAR_DEVICE_MAX_CHANNELS,
- CellularPinDeviceFormatsAndModes,
- SIZEOF_ARRAY(CellularPinDeviceFormatsAndModes),
- CellularTopologyPhysicalConnections,
- SIZEOF_ARRAY(CellularTopologyPhysicalConnections),
- ENDPOINT_CELLULAR_PROVIDER1,
- NULL, 0, NULL, // audio module settings.
-};
-
-
-static
-PHYSICALCONNECTIONTABLE CellularTopologyPhysicalConnections2[] =
-{
- {
- KSPIN_TOPO_BIDI2_BRIDGE, // TopologyOut
- KSPIN_WAVE_BIDI_BRIDGE, // WaveIn
- CONNECTIONTYPE_TOPOLOGY_OUTPUT
- }
-};
-
-static
-ENDPOINT_MINIPAIR CellularMiniports2 =
-{
- eCellularDevice,
- L"TopologyCellular", // make sure this or the template name matches with KSNAME_TopologyCellular in the inf's [Strings] section
- NULL, // optional template name
- CreateCellularMiniportTopology,
- &CellularTopoMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- L"WaveCellular2", // make sure this or the template name matches with KSNAME_WaveCellular in the inf's [Strings] section
- NULL, // optional template name
- CreateCellularMiniportWaveRT,
- &CellularWaveMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- CELLULAR_DEVICE_MAX_CHANNELS,
- CellularPinDeviceFormatsAndModes,
- SIZEOF_ARRAY(CellularPinDeviceFormatsAndModes),
- CellularTopologyPhysicalConnections2,
- SIZEOF_ARRAY(CellularTopologyPhysicalConnections2),
- ENDPOINT_CELLULAR_PROVIDER2,
- NULL, 0, NULL, // audio module settings.
-};
-
-/*********************************************************************
-* Topology/Wave bridge connection for handset speaker endpoint *
-* *
-* +------+ +------+ *
-* | Wave | | Topo | *
-* | | | | *
-* System --->|0 1|---> Loopback | | *
-* | | | | *
-* | 2|--------------->|0 1|---> Line Out *
-* | | | | *
-* +------+ +------+ *
-*********************************************************************/
-static
-PHYSICALCONNECTIONTABLE HandsetSpeakerTopologyPhysicalConnections[] =
-{
- {
- KSPIN_TOPO_WAVEOUT_SOURCE, // TopologyIn
- KSPIN_WAVE_RENDER2_SOURCE, // WaveOut (no offloading)
- CONNECTIONTYPE_WAVE_OUTPUT
- }
-};
-
-static
-ENDPOINT_MINIPAIR HandsetSpeakerMiniports =
-{
- eHandsetSpeakerDevice,
- HANDSET_SPEAKER_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
- NULL, // optional template name
- CreateHandsetSpeakerMiniportTopology,
- &HandsetSpeakerTopoMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- L"WaveHandsetSpeaker", // make sure this or the template name matches with KSNAME_WaveHandsetSpeaker in the inf's [Strings] section
- NULL, // optional template name
- CreateMiniportWaveRTSYSVAD,
- &HandsetSpeakerWaveMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- HANDSETSPEAKER_DEVICE_MAX_CHANNELS,
- HandsetSpeakerPinDeviceFormatsAndModes,
- SIZEOF_ARRAY(HandsetSpeakerPinDeviceFormatsAndModes),
- HandsetSpeakerTopologyPhysicalConnections,
- SIZEOF_ARRAY(HandsetSpeakerTopologyPhysicalConnections),
- ENDPOINT_LOOPBACK_SUPPORTED,
- NULL, 0, NULL, // audio module settings.
-};
-
-//
-// handset microphone miniports.
-//
-
-/*********************************************************************
-* Topology/Wave bridge connection for mic in *
-* *
-* +------+ +------+ *
-* | Topo | | Wave | *
-* | | | | *
-* Mic in --->|0 1|===>|0 1|---> Capture Host Pin *
-* | | | | *
-* +------+ +------+ *
-*********************************************************************/
-static
-PHYSICALCONNECTIONTABLE HandsetMicTopologyPhysicalConnections[] =
-{
- {
- KSPIN_TOPO_BRIDGE, // TopologyOut
- KSPIN_WAVE_BRIDGE, // WaveIn
- CONNECTIONTYPE_TOPOLOGY_OUTPUT
- }
-};
-
-static
-ENDPOINT_MINIPAIR HandsetMicMiniports =
-{
- eHandsetMicDevice,
- HANDSET_MIC_TOPONAME, // defined in cellulartopo.h for use with cellular routing control
- NULL, // optional template name
- CreateMiniportTopologySYSVAD,
- &HandsetMicTopoMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- L"WaveHandsetMic", // make sure this or the template name matches with KSNAME_WaveHandsetMic in the inf's [Strings] section
- NULL, // optional template name
- CreateMiniportWaveRTSYSVAD,
- &HandsetMicWaveMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- HANDSETMIC_DEVICE_MAX_CHANNELS,
- HandsetMicPinDeviceFormatsAndModes,
- SIZEOF_ARRAY(HandsetMicPinDeviceFormatsAndModes),
- HandsetMicTopologyPhysicalConnections,
- SIZEOF_ARRAY(HandsetMicTopologyPhysicalConnections),
- ENDPOINT_NO_FLAGS,
- NULL, 0, NULL, // audio module settings.
-};
-
-/*********************************************************************
-* Topology/Wave bridge connection for FM RX *
-* *
-* +------+ +------+ *
-* | Topo | | Wave | *
-* | | | | *
-* FM RX --->|0 1|===>|1 0|---> Capture Host Pin *
-* | | | | *
-* +------+ +------+ *
-*********************************************************************/
-static
-PHYSICALCONNECTIONTABLE FmRxTopologyPhysicalConnections[] =
-{
- {
- KSPIN_TOPO_FMRX_BRIDGE, // TopologyOut
- KSPIN_WAVE_FMRX_BRIDGE, // WaveIn
- CONNECTIONTYPE_TOPOLOGY_OUTPUT
- }
-};
-
-static
-ENDPOINT_MINIPAIR FmRxMiniports =
-{
- eFmRxDevice,
- L"TopologyFmRx", // make sure this name matches with KSNAME_TopologyFmRx
- NULL, // optional template name
- CreateFmMiniportTopology,
- &FmTopoMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- L"WaveFmRx", // make sure this or the template name matches with KSNAME_WaveFmRx in the inf's [Strings] section
- NULL, // optional template name
- CreateFmMiniportWaveRT,
- &FmWaveMiniportFilterDescriptor,
- 0, NULL, // Interface properties
- FMRX_DEVICE_MAX_CHANNELS,
- FmRxPinDeviceFormatsAndModes,
- SIZEOF_ARRAY(FmRxPinDeviceFormatsAndModes),
- FmRxTopologyPhysicalConnections,
- SIZEOF_ARRAY(FmRxTopologyPhysicalConnections),
- ENDPOINT_NO_FLAGS,
- NULL, 0, NULL, // audio module settings.
-};
-
-//=============================================================================
-//
-// Render miniport pairs. NOTE: the split of render and capture is arbitrary and
-// unnessary, this array could contain capture endpoints.
-//
-static
-PENDPOINT_MINIPAIR g_RenderEndpoints[] =
-{
- &SpeakerMiniports,
- &SpeakerHsMiniports,
- &HandsetSpeakerMiniports,
- &CellularMiniports, // SIM 1
- &CellularMiniports2 // SIM 2
-};
-
-#define g_cRenderEndpoints (SIZEOF_ARRAY(g_RenderEndpoints))
-
-//=============================================================================
-//
-// Capture miniport pairs. NOTE: the split of render and capture is arbitrary and
-// unnessary, this array could contain render endpoints.
-//
-static
-PENDPOINT_MINIPAIR g_CaptureEndpoints[] =
-{
- &MicHsMiniports,
- &MicArray1Miniports,
- &HandsetMicMiniports,
- &FmRxMiniports
-};
-
-#define g_cCaptureEndpoints (SIZEOF_ARRAY(g_CaptureEndpoints))
-
-//=============================================================================
-//
-// Total miniports = # endpoints * 2 (topology + wave).
-//
-#define g_MaxMiniports ((g_cRenderEndpoints + g_cCaptureEndpoints) * 2)
-
-#endif // _SYSVAD_MINIPAIRS_H_
-
diff --git a/audio/sysvad/PhoneAudioSample/phoneaudiosample.inx b/audio/sysvad/PhoneAudioSample/phoneaudiosample.inx
deleted file mode 100644
index a1d45cf4..00000000
--- a/audio/sysvad/PhoneAudioSample/phoneaudiosample.inx
+++ /dev/null
Binary files differ
diff --git a/audio/sysvad/PhoneAudioSample/speakerhstopo.cpp b/audio/sysvad/PhoneAudioSample/speakerhstopo.cpp
deleted file mode 100644
index bbd7a97c..00000000
--- a/audio/sysvad/PhoneAudioSample/speakerhstopo.cpp
+++ /dev/null
@@ -1,275 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- speakerhstopo.cpp
-
-Abstract:
-
- Implementation of topology miniport for the speaker (external: headset).
-
---*/
-
-#pragma warning (disable : 4127)
-
-#include <sysvad.h>
-#include "simple.h"
-#include "mintopo.h"
-#include "speakerhstopo.h"
-#include "speakerhstoptable.h"
-
-
-#pragma code_seg("PAGE")
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_SpeakerHsJackDescription
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_SpeakerHsJackDescription]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- ULONG cJackDescriptions = ARRAYSIZE(SpeakerHsJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = SpeakerHsJackDescriptions;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION pDesc = (PKSJACK_DESCRIPTION)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlCopyMemory(pDesc, JackDescriptions[nPinId], sizeof(KSJACK_DESCRIPTION));
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_SpeakerHsJackDescription2
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Handles ( KSPROPSETID_Jack, KSPROPERTY_JACK_DESCRIPTION2 )
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_SpeakerHsJackDescription2]"));
-
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
- ULONG nPinId = (ULONG)-1;
-
- ULONG cJackDescriptions = ARRAYSIZE(SpeakerHsJackDescriptions);
- PKSJACK_DESCRIPTION * JackDescriptions = SpeakerHsJackDescriptions;
-
- if (PropertyRequest->InstanceSize >= sizeof(ULONG))
- {
- nPinId = *(PULONG(PropertyRequest->Instance));
-
- if ((nPinId < cJackDescriptions) && (JackDescriptions[nPinId] != NULL))
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
- {
- ntStatus =
- PropertyHandler_BasicSupport
- (
- PropertyRequest,
- KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
- VT_ILLEGAL
- );
- }
- else
- {
- ULONG cbNeeded = sizeof(KSMULTIPLE_ITEM) + sizeof(KSJACK_DESCRIPTION2);
-
- if (PropertyRequest->ValueSize == 0)
- {
- PropertyRequest->ValueSize = cbNeeded;
- ntStatus = STATUS_BUFFER_OVERFLOW;
- }
- else if (PropertyRequest->ValueSize < cbNeeded)
- {
- ntStatus = STATUS_BUFFER_TOO_SMALL;
- }
- else
- {
- if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
- {
- PKSMULTIPLE_ITEM pMI = (PKSMULTIPLE_ITEM)PropertyRequest->Value;
- PKSJACK_DESCRIPTION2 pDesc = (PKSJACK_DESCRIPTION2)(pMI+1);
-
- pMI->Size = cbNeeded;
- pMI->Count = 1;
-
- RtlZeroMemory(pDesc, sizeof(KSJACK_DESCRIPTION2));
-
- //
- // Specifies the lower 16 bits of the DWORD parameter. This parameter indicates whether
- // the jack is currently active, streaming, idle, or hardware not ready.
- //
- pDesc->DeviceStateInfo = 0;
-
- //
- // From MSDN:
- // "If an audio device lacks jack presence detection, the IsConnected member of
- // the KSJACK_DESCRIPTION structure must always be set to TRUE. To remove the
- // ambiguity that results from this dual meaning of the TRUE value for IsConnected,
- // a client application can call IKsJackDescription2::GetJackDescription2 to read
- // the JackCapabilities flag of the KSJACK_DESCRIPTION2 structure. If this flag has
- // the JACKDESC2_PRESENCE_DETECT_CAPABILITY bit set, it indicates that the endpoint
- // does in fact support jack presence detection. In that case, the return value of
- // the IsConnected member can be interpreted to accurately reflect the insertion status
- // of the jack."
- //
- // Bit definitions:
- // 0x00000001 - JACKDESC2_PRESENCE_DETECT_CAPABILITY
- // 0x00000002 - JACKDESC2_DYNAMIC_FORMAT_CHANGE_CAPABILITY
- //
- pDesc->JackCapabilities = JACKDESC2_PRESENCE_DETECT_CAPABILITY;
-
- ntStatus = STATUS_SUCCESS;
- }
- }
- }
- }
- }
-
- return ntStatus;
-}
-
-
-//=============================================================================
-NTSTATUS
-PropertyHandler_SpeakerHsTopoFilter
-(
- _In_ PPCPROPERTY_REQUEST PropertyRequest
-)
-/*++
-
-Routine Description:
-
- Redirects property request to miniport object
-
-Arguments:
-
- PropertyRequest -
-
-Return Value:
-
- NT status code.
-
---*/
-{
- PAGED_CODE();
-
- ASSERT(PropertyRequest);
-
- DPF_ENTER(("[PropertyHandler_SpeakerHsTopoFilter]"));
-
- // PropertryRequest structure is filled by portcls.
- // MajorTarget is a pointer to miniport object for miniports.
- //
- NTSTATUS ntStatus = STATUS_INVALID_DEVICE_REQUEST;
-
- //
- // This line shows how to get a pointer to the miniport topology object.
- //
- PCMiniportTopology pMiniport = (PCMiniportTopology)PropertyRequest->MajorTarget;
- UNREFERENCED_VAR(pMiniport);
-
- if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, KSPROPSETID_Jack))
- {
- if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION)
- {
- ntStatus = PropertyHandler_SpeakerHsJackDescription(PropertyRequest);
- }
- else if (PropertyRequest->PropertyItem->Id == KSPROPERTY_JACK_DESCRIPTION2)
- {
- ntStatus = PropertyHandler_SpeakerHsJackDescription2(PropertyRequest);
- }
- }
-
- return ntStatus;
-} // PropertyHandler_SpeakerHsTopoFilter
-
-#pragma code_seg()
-
diff --git a/audio/sysvad/PhoneAudioSample/speakerhstopo.h b/audio/sysvad/PhoneAudioSample/speakerhstopo.h
deleted file mode 100644
index ea7c760f..00000000
--- a/audio/sysvad/PhoneAudioSample/speakerhstopo.h
+++ /dev/null
@@ -1,21 +0,0 @@
-
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- speakerhstopo.h
-
-Abstract:
-
- Declaration of topology miniport for the speaker (external: headset).
-
---*/
-
-#ifndef _SYSVAD_SPEAKERHSTOPO_H_
-#define _SYSVAD_SPEAKERHSTOPO_H_
-
-NTSTATUS PropertyHandler_SpeakerHsTopoFilter(_In_ PPCPROPERTY_REQUEST PropertyRequest);
-
-#endif // _SYSVAD_SPEAKERHSTOPO_H_
diff --git a/audio/sysvad/PhoneAudioSample/speakerhstoptable.h b/audio/sysvad/PhoneAudioSample/speakerhstoptable.h
deleted file mode 100644
index adb941ff..00000000
--- a/audio/sysvad/PhoneAudioSample/speakerhstoptable.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- speakerhstoptable.h
-
-Abstract:
-
- Declaration of topology tables for the speaker (external: headset).
-
---*/
-
-#ifndef _SYSVAD_SPEAKERHSTOPTABLE_H_
-#define _SYSVAD_SPEAKERHSTOPTABLE_H_
-
-#include <mintopo.h>
-
-//=============================================================================
-static
-KSDATARANGE SpeakerHsTopoPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-//=============================================================================
-static
-PKSDATARANGE SpeakerHsTopoPinDataRangePointersBridge[] =
-{
- &SpeakerHsTopoPinDataRangesBridge[0]
-};
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR SpeakerHsTopoMiniportPins[] =
-{
- // KSPIN - topology filter in-pin
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(SpeakerHsTopoPinDataRangePointersBridge),// DataRangesCount
- SpeakerHsTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_IN, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSCATEGORY_AUDIO, // Category
- NULL, // Name
- 0 // Reserved
- }
- },
- // KSPIN - topology filter out-pin
- {
- 0,
- 0,
- 0, // InstanceCount
- NULL, // AutomationTable
- { // KsPinDescriptor
- 0, // InterfacesCount
- NULL, // Interfaces
- 0, // MediumsCount
- NULL, // Mediums
- SIZEOF_ARRAY(SpeakerHsTopoPinDataRangePointersBridge),// DataRangesCount
- SpeakerHsTopoPinDataRangePointersBridge, // DataRanges
- KSPIN_DATAFLOW_OUT, // DataFlow
- KSPIN_COMMUNICATION_NONE, // Communication
- &KSNODETYPE_HEADSET_SPEAKERS, // Category
- NULL, // Name
- 0 // Reserved
- }
- }
-};
-
-static
-KSJACK_DESCRIPTION SpeakerHsJackDesc =
-{
- KSAUDIO_SPEAKER_MONO,
- JACKDESC_RGB(179, 201, 140),
- eConnTypeCombination,
- eGeoLocRear,
- eGenLocPrimaryBox,
- ePortConnJack,
- FALSE // NOTE: For convenience, wired headset jacks will be "unplugged" at boot.
-};
-
-//=============================================================================
-// Only return a KSJACK_DESCRIPTION for the physical bridge pin.
-static
-PKSJACK_DESCRIPTION SpeakerHsJackDescriptions[] =
-{
- NULL,
- &SpeakerHsJackDesc
-};
-
-//=============================================================================
-static
-PCCONNECTION_DESCRIPTOR SpeakerHsTopoMiniportConnections[] =
-{
- // FromNode, FromPin, ToNode, ToPin
- { PCFILTER_NODE, KSPIN_TOPO_WAVEOUT_SOURCE, PCFILTER_NODE, KSPIN_TOPO_LINEOUT_DEST}
-};
-
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesSpeakerHsTopoFilter[] =
-{
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_SpeakerHsTopoFilter
- },
- {
- &KSPROPSETID_Jack,
- KSPROPERTY_JACK_DESCRIPTION2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_SpeakerHsTopoFilter
- }
-};
-
-static PCEVENT_ITEM SpeakerHsJackInfoChangeEvent[] =
-{
- {
- &KSEVENTSETID_PinCapsChange, // Something changed
- KSEVENT_PINCAPS_JACKINFOCHANGE, // Jack Info Changes
- KSEVENT_TYPE_ENABLE | KSEVENT_TYPE_BASICSUPPORT,
- CMiniportTopology_EventHandler_JackState
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP_EVENT(AutomationSpeakerHsTopoFilter, PropertiesSpeakerHsTopoFilter, SpeakerHsJackInfoChangeEvent);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR SpeakerHsTopoMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationSpeakerHsTopoFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(SpeakerHsTopoMiniportPins), // PinCount
- SpeakerHsTopoMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- 0, // NodeCount
- NULL, // Nodes
- SIZEOF_ARRAY(SpeakerHsTopoMiniportConnections), // ConnectionCount
- SpeakerHsTopoMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories
-};
-
-#endif // _SYSVAD_SPEAKERHSTOPTABLE_H_
-
-
diff --git a/audio/sysvad/PhoneAudioSample/speakerhswavtable.h b/audio/sysvad/PhoneAudioSample/speakerhswavtable.h
deleted file mode 100644
index cc7b55fc..00000000
--- a/audio/sysvad/PhoneAudioSample/speakerhswavtable.h
+++ /dev/null
@@ -1,755 +0,0 @@
-/*++
-
-Copyright (c) Microsoft Corporation All Rights Reserved
-
-Module Name:
-
- speakerhswavtable.h
-
-Abstract:
-
- Declaration of wave miniport tables for the speaker (external: headset).
-
---*/
-
-#ifndef _SYSVAD_SPEAKERHSWAVTABLE_H_
-#define _SYSVAD_SPEAKERHSWAVTABLE_H_
-
-
-// To keep the code simple assume device supports only 48KHz, 16-bit, stereo (PCM and NON-PCM)
-
-#define SPEAKERHS_DEVICE_MAX_CHANNELS 2 // Max Channels.
-
-#define SPEAKERHS_HOST_MAX_CHANNELS 2 // Max Channels.
-#define SPEAKERHS_HOST_MIN_BITS_PER_SAMPLE 16 // Min Bits Per Sample
-#define SPEAKERHS_HOST_MAX_BITS_PER_SAMPLE 16 // Max Bits Per Sample
-#define SPEAKERHS_HOST_MIN_SAMPLE_RATE 24000 // Min Sample Rate
-#define SPEAKERHS_HOST_MAX_SAMPLE_RATE 96000 // Max Sample Rate
-
-#define SPEAKERHS_OFFLOAD_MAX_CHANNELS 2 // Max Channels.
-#define SPEAKERHS_OFFLOAD_MIN_BITS_PER_SAMPLE 16 // Min Bits Per Sample
-#define SPEAKERHS_OFFLOAD_MAX_BITS_PER_SAMPLE 16 // Max Bits Per Sample
-#define SPEAKERHS_OFFLOAD_MIN_SAMPLE_RATE 44100 // Min Sample Rate
-#define SPEAKERHS_OFFLOAD_MAX_SAMPLE_RATE 48000 // Max Sample Rate
-
-#define SPEAKERHS_LOOPBACK_MAX_CHANNELS SPEAKERHS_HOST_MAX_CHANNELS // Must be equal to host pin's Max Channels.
-#define SPEAKERHS_LOOPBACK_MIN_BITS_PER_SAMPLE SPEAKERHS_HOST_MIN_BITS_PER_SAMPLE // Must be equal to host pin's Min Bits Per Sample
-#define SPEAKERHS_LOOPBACK_MAX_BITS_PER_SAMPLE SPEAKERHS_HOST_MAX_BITS_PER_SAMPLE // Must be equal to host pin's Max Bits Per Sample
-#define SPEAKERHS_LOOPBACK_MIN_SAMPLE_RATE SPEAKERHS_HOST_MIN_SAMPLE_RATE // Must be equal to host pin's Min Sample Rate
-#define SPEAKERHS_LOOPBACK_MAX_SAMPLE_RATE SPEAKERHS_HOST_MAX_SAMPLE_RATE // Must be equal to host pin's Max Sample Rate
-
-#define SPEAKERHS_DOLBY_DIGITAL_MAX_CHANNELS 2 // Max Channels.
-#define SPEAKERHS_DOLBY_DIGITAL_MIN_BITS_PER_SAMPLE 16 // Min Bits Per Sample
-#define SPEAKERHS_DOLBY_DIGITAL_MAX_BITS_PER_SAMPLE 16 // Max Bits Per Sample
-#define SPEAKERHS_DOLBY_DIGITAL_MIN_SAMPLE_RATE 44100 // Min Sample Rate
-#define SPEAKERHS_DOLBY_DIGITAL_MAX_SAMPLE_RATE 44100 // Max Sample Rate
-
-//
-// Max # of pin instances.
-//
-#define SPEAKERHS_MAX_INPUT_SYSTEM_STREAMS 6
-#define SPEAKERHS_MAX_INPUT_OFFLOAD_STREAMS MAX_INPUT_OFFLOAD_STREAMS
-#define SPEAKERHS_MAX_OUTPUT_LOOPBACK_STREAMS MAX_OUTPUT_LOOPBACK_STREAMS
-
-//=============================================================================
-static
-KSDATAFORMAT_WAVEFORMATEXTENSIBLE SpeakerHsAudioEngineSupportedDeviceFormats[] =
-{
- { // 0 : First entry in htis table is the default format for the audio engine
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 44100,
- 176400,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 1
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 24000,
- 96000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 2
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 48000,
- 192000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 3
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 88200,
- 352800,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 4
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 96000,
- 384000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- }
-};
-
-static
-KSDATAFORMAT_WAVEFORMATEXTENSIBLE SpeakerHsHostPinSupportedDeviceFormats[] =
-{
- { // 0
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 24000,
- 96000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 1
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 32000,
- 128000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 2
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 44100,
- 176400,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 3
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 48000,
- 192000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 4
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 88200,
- 352800,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 5
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 96000,
- 384000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- }
-};
-
-static
-KSDATAFORMAT_WAVEFORMATEXTENSIBLE SpeakerHsOffloadPinSupportedDeviceFormats[] =
-{
- { // 0
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 44100,
- 176400,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- },
- { // 1
- {
- sizeof(KSDATAFORMAT_WAVEFORMATEXTENSIBLE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- {
- {
- WAVE_FORMAT_EXTENSIBLE,
- 2,
- 48000,
- 192000,
- 4,
- 16,
- sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)
- },
- 16,
- KSAUDIO_SPEAKER_STEREO,
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM)
- }
- }
-};
-
-//
-// Supported modes (only on streaming pins).
-//
-static
-MODE_AND_DEFAULT_FORMAT SpeakerHsHostPinSupportedDeviceModes[] =
-{
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_RAW,
- &SpeakerHsHostPinSupportedDeviceFormats[3].DataFormat // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_DEFAULT,
- &SpeakerHsHostPinSupportedDeviceFormats[3].DataFormat // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_MEDIA,
- &SpeakerHsHostPinSupportedDeviceFormats[3].DataFormat // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_MOVIE,
- &SpeakerHsHostPinSupportedDeviceFormats[3].DataFormat // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_COMMUNICATIONS,
- &SpeakerHsHostPinSupportedDeviceFormats[0].DataFormat // 24KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_NOTIFICATION,
- &SpeakerHsHostPinSupportedDeviceFormats[3].DataFormat // 48KHz
- }
-};
-
-static
-MODE_AND_DEFAULT_FORMAT SpeakerHsOffloadPinSupportedDeviceModes[] =
-{
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_DEFAULT,
- &SpeakerHsOffloadPinSupportedDeviceFormats[1].DataFormat // 48KHz
- },
- {
- STATIC_AUDIO_SIGNALPROCESSINGMODE_MEDIA,
- &SpeakerHsOffloadPinSupportedDeviceFormats[1].DataFormat // 48KHz
- }
-};
-
-//
-// The entries here must follow the same order as the filter's pin
-// descriptor array.
-//
-static
-PIN_DEVICE_FORMATS_AND_MODES SpeakerHsPinDeviceFormatsAndModes[] =
-{
- {
- SystemRenderPin,
- SpeakerHsHostPinSupportedDeviceFormats,
- SIZEOF_ARRAY(SpeakerHsHostPinSupportedDeviceFormats),
- SpeakerHsHostPinSupportedDeviceModes,
- SIZEOF_ARRAY(SpeakerHsHostPinSupportedDeviceModes)
- },
- {
- OffloadRenderPin,
- SpeakerHsOffloadPinSupportedDeviceFormats,
- SIZEOF_ARRAY(SpeakerHsOffloadPinSupportedDeviceFormats),
- SpeakerHsOffloadPinSupportedDeviceModes,
- SIZEOF_ARRAY(SpeakerHsOffloadPinSupportedDeviceModes),
- },
- {
- RenderLoopbackPin,
- SpeakerHsHostPinSupportedDeviceFormats, // Must support all the formats supported by host pin
- SIZEOF_ARRAY(SpeakerHsHostPinSupportedDeviceFormats),
- NULL, // loopback doesn't support modes.
- 0
- },
- {
- BridgePin,
- NULL,
- 0,
- NULL,
- 0
- },
- {
- NoPin, // For convenience, offload engine device formats appended here
- SpeakerHsAudioEngineSupportedDeviceFormats,
- SIZEOF_ARRAY(SpeakerHsAudioEngineSupportedDeviceFormats),
- NULL, // no modes for this entry.
- 0
- }
-};
-
-//=============================================================================
-static
-KSDATARANGE_AUDIO SpeakerHsPinDataRangesStream[] =
-{
- { // 0
- {
- sizeof(KSDATARANGE_AUDIO),
- KSDATARANGE_ATTRIBUTES, // An attributes list follows this data range
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- SPEAKERHS_HOST_MAX_CHANNELS,
- SPEAKERHS_HOST_MIN_BITS_PER_SAMPLE,
- SPEAKERHS_HOST_MAX_BITS_PER_SAMPLE,
- SPEAKERHS_HOST_MIN_SAMPLE_RATE,
- SPEAKERHS_HOST_MAX_SAMPLE_RATE
- },
- { // 1
- {
- sizeof(KSDATARANGE_AUDIO),
- KSDATARANGE_ATTRIBUTES, // An attributes list follows this data range
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- SPEAKERHS_OFFLOAD_MAX_CHANNELS,
- SPEAKERHS_OFFLOAD_MIN_BITS_PER_SAMPLE,
- SPEAKERHS_OFFLOAD_MAX_BITS_PER_SAMPLE,
- SPEAKERHS_OFFLOAD_MIN_SAMPLE_RATE,
- SPEAKERHS_OFFLOAD_MAX_SAMPLE_RATE
- },
- { // 2
- {
- sizeof(KSDATARANGE_AUDIO),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_PCM),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
- },
- SPEAKERHS_LOOPBACK_MAX_CHANNELS,
- SPEAKERHS_LOOPBACK_MIN_BITS_PER_SAMPLE,
- SPEAKERHS_LOOPBACK_MAX_BITS_PER_SAMPLE,
- SPEAKERHS_LOOPBACK_MIN_SAMPLE_RATE,
- SPEAKERHS_LOOPBACK_MAX_SAMPLE_RATE
- }
-};
-
-static
-PKSDATARANGE SpeakerHsPinDataRangePointersStream[] =
-{
- PKSDATARANGE(&SpeakerHsPinDataRangesStream[0]),
- PKSDATARANGE(&PinDataRangeAttributeList)
-};
-
-static
-PKSDATARANGE SpeakerHsPinDataRangePointersOffloadStream[] =
-{
- PKSDATARANGE(&SpeakerHsPinDataRangesStream[1]),
- PKSDATARANGE(&PinDataRangeAttributeList)
-};
-
-static
-PKSDATARANGE SpeakerHsPinDataRangePointersLoopbackStream[] =
-{
- PKSDATARANGE(&SpeakerHsPinDataRangesStream[2])
-};
-
-//=============================================================================
-static
-KSDATARANGE SpeakerHsPinDataRangesBridge[] =
-{
- {
- sizeof(KSDATARANGE),
- 0,
- 0,
- 0,
- STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
- STATICGUIDOF(KSDATAFORMAT_SUBTYPE_ANALOG),
- STATICGUIDOF(KSDATAFORMAT_SPECIFIER_NONE)
- }
-};
-
-static
-PKSDATARANGE SpeakerHsPinDataRangePointersBridge[] =
-{
- &SpeakerHsPinDataRangesBridge[0]
-};
-
-//=============================================================================
-
-static
-PCPROPERTY_ITEM PropertiesSpeakerHsOffloadPin[] =
-{
- {
- &KSPROPSETID_OffloadPin, // define new property set
- KSPROPERTY_OFFLOAD_PIN_GET_STREAM_OBJECT_POINTER, // define properties
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_OffloadPin
- },
- {
- &KSPROPSETID_OffloadPin, // define new property set
- KSPROPERTY_OFFLOAD_PIN_VERIFY_STREAM_OBJECT_POINTER, // define properties
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_OffloadPin
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationSpeakerHsOffloadPin, PropertiesSpeakerHsOffloadPin);
-
-//=============================================================================
-static
-PCPIN_DESCRIPTOR SpeakerHsWaveMiniportPins[] =
-{
- // Wave Out Streaming Pin (renderer) KSPIN_WAVE_RENDER_SINK_SYSTEM
- {
- SPEAKERHS_MAX_INPUT_SYSTEM_STREAMS,
- SPEAKERHS_MAX_INPUT_SYSTEM_STREAMS,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(SpeakerHsPinDataRangePointersStream),
- SpeakerHsPinDataRangePointersStream,
- KSPIN_DATAFLOW_IN,
- KSPIN_COMMUNICATION_SINK,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
- // Wave Out Streaming Pin (Renderer) KSPIN_WAVE_RENDER_SINK_OFFLOAD
- {
- SPEAKERHS_MAX_INPUT_OFFLOAD_STREAMS,
- SPEAKERHS_MAX_INPUT_OFFLOAD_STREAMS,
- 0,
- &AutomationSpeakerHsOffloadPin, // AutomationTable
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(SpeakerHsPinDataRangePointersOffloadStream),
- SpeakerHsPinDataRangePointersOffloadStream,
- KSPIN_DATAFLOW_IN,
- KSPIN_COMMUNICATION_SINK,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
- // Wave Out Streaming Pin (Renderer) KSPIN_WAVE_RENDER_SINK_LOOPBACK
- {
- SPEAKERHS_MAX_OUTPUT_LOOPBACK_STREAMS,
- SPEAKERHS_MAX_OUTPUT_LOOPBACK_STREAMS,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(SpeakerHsPinDataRangePointersLoopbackStream),
- SpeakerHsPinDataRangePointersLoopbackStream,
- KSPIN_DATAFLOW_OUT,
- KSPIN_COMMUNICATION_SINK,
- &KSNODETYPE_AUDIO_LOOPBACK,
- NULL,
- 0
- }
- },
- // Wave Out Bridge Pin (Renderer) KSPIN_WAVE_RENDER_SOURCE
- {
- 0,
- 0,
- 0,
- NULL,
- {
- 0,
- NULL,
- 0,
- NULL,
- SIZEOF_ARRAY(SpeakerHsPinDataRangePointersBridge),
- SpeakerHsPinDataRangePointersBridge,
- KSPIN_DATAFLOW_OUT,
- KSPIN_COMMUNICATION_NONE,
- &KSCATEGORY_AUDIO,
- NULL,
- 0
- }
- },
-};
-
-//=============================================================================
-static
-PCNODE_DESCRIPTOR SpeakerHsWaveMiniportNodes[] =
-{
- // KSNODE_WAVE_AUDIO_ENGINE
- {
- 0, // Flags
- NULL, // AutomationTable
- &KSNODETYPE_AUDIO_ENGINE, // Type KSNODETYPE_AUDIO_ENGINE
- NULL // Name
- }
-};
-//=============================================================================
-//
-// ----------------------------
-// | |
-// System Pin 0-->| |--> 2 Loopback Pin
-// | HW Audio Engine node |
-// Offload Pin 1-->| |--> 3 KSPIN_WAVE_RENDER_SOURCE
-// | |
-// ----------------------------
-static
-PCCONNECTION_DESCRIPTOR SpeakerHsWaveMiniportConnections[] =
-{
- { PCFILTER_NODE, KSPIN_WAVE_RENDER_SINK_SYSTEM, KSNODE_WAVE_AUDIO_ENGINE, 1 },
- { PCFILTER_NODE, KSPIN_WAVE_RENDER_SINK_OFFLOAD, KSNODE_WAVE_AUDIO_ENGINE, 2 },
- { KSNODE_WAVE_AUDIO_ENGINE, 3, PCFILTER_NODE, KSPIN_WAVE_RENDER_SINK_LOOPBACK },
- { KSNODE_WAVE_AUDIO_ENGINE, 0, PCFILTER_NODE, KSPIN_WAVE_RENDER_SOURCE },
-};
-
-//=============================================================================
-static
-PCPROPERTY_ITEM PropertiesSpeakerHsWaveFilter[] =
-{
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT,
- KSPROPERTY_TYPE_SET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- },
- {
- &KSPROPSETID_Pin,
- KSPROPERTY_PIN_PROPOSEDATAFORMAT2,
- KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_BASICSUPPORT,
- PropertyHandler_WaveFilter
- }
-};
-
-DEFINE_PCAUTOMATION_TABLE_PROP(AutomationSpeakerHsWaveFilter, PropertiesSpeakerHsWaveFilter);
-
-//=============================================================================
-static
-PCFILTER_DESCRIPTOR SpeakerHsWaveMiniportFilterDescriptor =
-{
- 0, // Version
- &AutomationSpeakerHsWaveFilter, // AutomationTable
- sizeof(PCPIN_DESCRIPTOR), // PinSize
- SIZEOF_ARRAY(SpeakerHsWaveMiniportPins), // PinCount
- SpeakerHsWaveMiniportPins, // Pins
- sizeof(PCNODE_DESCRIPTOR), // NodeSize
- SIZEOF_ARRAY(SpeakerHsWaveMiniportNodes), // NodeCount
- SpeakerHsWaveMiniportNodes, // Nodes
- SIZEOF_ARRAY(SpeakerHsWaveMiniportConnections), // ConnectionCount
- SpeakerHsWaveMiniportConnections, // Connections
- 0, // CategoryCount
- NULL // Categories - use defaults (audio, render, capture)
-};
-
-#endif // _SYSVAD_SPEAKERHSWAVTABLE_H_
-
diff --git a/audio/sysvad/README.md b/audio/sysvad/README.md
index 77de39a3..d5af8044 100644
--- a/audio/sysvad/README.md
+++ b/audio/sysvad/README.md
@@ -11,6 +11,12 @@ urlFragment: sysvad-virtual-audio-device-driver-sample
# SysVAD Virtual Audio Device Driver Sample
+## Important note
+
+With the [end of support for Windows 10 Mobile](https://support.microsoft.com/en-us/help/4484693/windows-10-mobile-end-of-support), the Phone Audio sample has been also removed from the SysVAD driver sample.
+
+## Introduction
+
The Microsoft SysVAD Virtual Audio Device Driver (SYSVAD) shows how to develop a WDM audio driver that exposes support for multiple audio devices.
Some of these audio devices are embedded in the system (for example, speakers, microphone arrays) while others are pluggable (like headphones, Bluetooth headsets etc.). The driver uses WaveRT and audio offloading for rendering devices. The driver uses a "virtual audio device" instead of an actual hardware-based adapter, and highlights the different aspects of the audio offloading WDM audio driver architecture.
@@ -25,19 +31,18 @@ The following table shows the features that are implemented in the various subdi
| Directory | Description |
| --- | --- |
-| TabletAudioSample | Endpoints that are present in TabletAudioSample driver |
-| PhoneAudioSample | Endpoints that are present in PhoneAudioSample driver |
+| TabletAudioSample | Endpoints that are present in TabletAudioSample driver. |
| EndpointsCommon | Endpoints that are present in both TabletAudioSample and PhoneAudioSample. It also contains other common code shared by both sample drivers. |
-| SwapAPO | Sample APO that installs onto endpoints exposed by the SysVAD sample driver and swaps the left and right channels |
-| DelayAPO | Sample APO that adds a delay to the input samples |
+| SwapAPO | Sample APO that installs onto endpoints exposed by the SysVAD sample driver and swaps the left and right channels. |
+| DelayAPO | Sample APO that adds a delay to the input samples. |
| KwsAPO | Sample APO that uses KSPROPERTY_INTERLEAVEDAUDIO_FORMATINFORMATION to determine if the keyword spotter pin is interleaving loopback audio with the microphone audio and identify which channels contain loopback audio. If it is interleaved the APO will strip out the loopback audio and deliver only the microphone audio upstream. Because channel data is removed, the APO negotiates an output format which is different than the input format. |
-| KeywordDetectorAdapter | Sample Keyword Detector Adapter |
+| KeywordDetectorAdapter | Sample Keyword Detector Adapter. |
For more information about the Windows audio engine, see [Hardware-Offloaded Audio Processing](https://docs.microsoft.com/windows-hardware/drivers/audio/hardware-offloaded-audio-processing), and note that audio hardware that is offload-capable replicates the architecture that is presented in the diagram shown in the topic.
## Build the sample
-If you simply want to Build this sample driver and don't intend to run or test it, then you do not need a target computer (also called a test computer). If, however, you would like to deploy, run and test this sample driver, then you need a second computer that will server as your target computer. Instructions are provided in the **Run the sample** section to show you how to set up the target computer - also referred to as *provisioning* a target computer.
+If you simply want to Build this sample driver and don't intend to run or test it, then you do not need a target computer (also called a test computer). If, however, you would like to deploy, run and test this sample driver, then you need a second computer that will serve as your target computer. Instructions are provided in the **Run the sample** section to show you how to set up the target computer - also referred to as *provisioning* a target computer.
Perform the following steps to build this sample driver.
@@ -45,11 +50,11 @@ Perform the following steps to build this sample driver.
In Microsoft Visual Studio, Click **File** \> **Open** \> **Project/Solution...** and navigate to the folder that contains the sample files (for example, *C:\Windows-driver-samples\audio\sysvad*). Double-click the *sysvad* solution file.
-In Visual Studio locate the Solution Explorer. (If this is not already open, choose **Solution Explorer** from the **View** menu.) In Solution Explorer, you can see one solution that has eight projects.
+In Visual Studio locate the Solution Explorer. (If this is not already open, choose **Solution Explorer** from the **View** menu.) In Solution Explorer, you can see one solution that has seven projects.
### 2. Set the sample's configuration and platform
-In Solution Explorer, right-click **Solution 'sysvad' (8 projects)**, and choose **Configuration Manager**. Make sure that the configuration and platform settings are the same for the eight projects. By default, the configuration is set to **Debug**, and the platform is set to **Win32** for all the projects. If you make any configuration and/or platform changes for one project, you must make the same changes for the remaining three projects.
+In Solution Explorer, right-click **Solution 'sysvad' (7 of 7 projects)**, and choose **Configuration Manager**. Make sure that the configuration and platform settings are the same for the seven projects. By default, the configuration is set to **Debug**, and the platform is set to **Win32** for all the projects. If you make any configuration and/or platform changes for one project, you must make the same changes for all the remaining projects.
### 3. Build the sample using Visual Studio
@@ -65,97 +70,108 @@ The package should contain these files:
| File | Description |
| --- | --- |
-| TabletAudioSample.sys OR PhoneAudioSample.sys| The driver file |
-| SwapAPO.dll | The swap APO |
-| DelayAPO.dll | The delay APO |
-| KWSApo.dll | The KWS APO |
+| TabletAudioSample.sys | The driver file. |
+| DelayAPO.dll | The delay APO. |
+| KeywordDetectorContosoAdapter.dll | Sample Keyword detector adapter. |
+| KWSApo.dll | The KWS APO. |
+| SwapAPO.dll | The swap APO. |
| sysvad.cat | A signed catalog file, which serves as the signature for the entire package. |
-| TabletAudioSample.inf | An information (INF) file that contains information needed to install the driver. |
-| PhoneAudioSample.inf | An information (INF) file that contains information needed to install the driver. |
-| KeywordDetectorContosoAdapter.dll | Sample Keyword detector adapter |
+| ComponentizedApoSample.inf | A componentized information (INF) file that installs an APO device. |
+| ComponentizedAudioSample.inf | A componentized information (INF) file that contains information needed to install the Tablet Audio Sample driver. |
+| ComponentizedAudioSampleExtension.inf | An extension information (INF) file that extends the Tablet Audio Sample driver functionality by associating an APO device to it. |
+| TabletAudioSample.inf | A non-componentized information (INF) file that contains information needed to install the driver. |
+
+For more information on extension INF files, see [Using an extension INF file](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/using-an-extension-inf-file).
## Run the sample
The computer where you install the driver is called the *target computer* or the *test computer*. Typically this is a separate computer from the computer on which you develop and build the driver package. The computer where you develop and build the driver is called the *host computer*.
-The process of moving the driver package to the target computer and installing the driver is called *deploying* the driver. You can deploy the sample driver, TabletAudioSample or PhoneAudioSample, automatically or manually.
+The process of moving the driver package to the target computer and installing the driver is called *deploying* the driver. You can deploy the TabletAudioSample sample driver automatically or manually.
-### Automatic deployment
+### Prepare the target computer
-Before you automatically deploy a driver, you must provision the target computer. Verify that the target computer has an ethernet cable connecting it to your local network, and that your host and target computers can ping each other. Then perform the following steps to prepare your host and target computers.
+First of all, install the latest [Windows Driver Kit](https://docs.microsoft.com/windows-hardware/drivers/download-the-wdk) (WDK) on the target computer.
-#### 1. Provision the target computer
+Before you manually deploy a driver, you must prepare the target computer by turning on test signing and by installing a certificate. You also need to locate the DevCon tool in your WDK installation. After that you're ready to run the built driver sample.
-On the target computer install the latest [Windows Driver Kit](https://docs.microsoft.com/windows-hardware/drivers/download-the-wdk) (WDK), and then when the installation is completed, navigate to the following folder:
+Open a Command Prompt window as Administrator. Then enter the following command:
-\\Program Files (x86)\\Windows Kits\\10\\Remote\\<*architecture*>\\
+`bcdedit /set TESTSIGNING ON`
-For example, if your target computer is an x64 machine, you would navigate to:
+and reboot the target computer.
-\\Program Files (x86)\\Windows Kits\\10\\Remote\\x64\\
+[!IMPORTANT]
+Before using BCDEdit to change boot information you may need to temporarily suspend Windows security features such as BitLocker and Secure Boot on the test PC.
-Double-click the *WDK Test Target Setup x64-x64\_en-us.msi* file to run it. This program prepares the target computer for provisioning.
+Re-enable these security features when testing is complete and appropriately manage the test PC, when the security features are disabled.
-On the host computer, in Visual Studio click **Driver** \> **Test** \> **Configure Computers...**, and then click **Add a new computer**.
+After rebooting, navigate to the Tools folder in your WDK installation and locate the DevCon tool. For example, look in the following folder:
-Type the name of the target computer, select **Provision computer and choose debugger settings**, and click **Next**. In the next window, verify that the **Connection Type** is set to Network. Leave the other (default) settings as they are, and click **Next**. For more information about the settings in this window, see [Setting Up Debugging](https://docs.microsoft.com/windows-hardware/drivers/debugger/getting-set-up-for-debugging).
+C:\\Program Files (x86)\\Windows Kits\\10\\Tools\\x64\\devcon.exe
-#### 2. Prepare the host computer
+Copy *devcon.exe* to a folder on the target computer where it is easier to find. For example, create a *C:\\Tools* folder and copy *devcon.exe* to that folder.
-If you haven't already done so, then preform the steps in the **Build the sample** section, to build the sample driver.
+Create a folder on the target for the built driver package (for example, *C:\\SysvadDriver*). Copy all the files from the built driver package on the host computer and save them to the folder that you created on the target computer.
-In Visual Studio, in Solution Explorer, right click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties** \> **Driver Install** \> **Deployment**.
+Create a folder on the target computer for the certificate created by the build process. For example, you could create a folder named *C:\\Certificates* on the target computer, and then copy *package.cer* to it from the host computer. You can find this certificate in the same folder on the host computer, as the *package* folder that contains the built driver files. On the target computer, right-click the certificate file, and click **Install**, then follow the prompts to install the test certificate.
-Check , **Enable deployment** and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Hardware ID Driver Update**, and enter *ROOT\Sysvad_TabletAudioSample* for the hardware ID. Click **OK**.
+If you need more detailed instructions for setting up the target computer, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment).
-On the **Build** menu, choose **Deploy Package** or **Build Solution**. This will deploy the sample driver to your target computer.
+#### A note on signatures
-On the target computer, perform the steps in the **Test the sample** section to test the sample driver.
+Since most of these binary files are executed in kernel mode, it is important that they are signed and, optionally, to have a kernel debugger attached.
-### Manual deployment
+Without any signature or kernel debugger, the driver will not be installed in the target computer. With a kernel debugger attached, the driver can be installed and the driver files (.sys extension) would be loaded, but any user mode files (.dll files) will not be loaded.
-Before you manually deploy a driver, you must prepare the target computer by turning on test signing and by installing a certificate. You also need to locate the DevCon tool in your WDK installation. After that you're ready to run the built driver sample.
+The only way of installing and executing the whole driver sample is to have all the files (.sys, .dll and .cat) signed with a trusted certificate. This will allow the entire driver to be loaded even without a kernel debugger attached.
-#### 1. Prepare the target computer
+For more information on the subject, see [Driver signing](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/driver-signing).
-Open a Command Prompt window as Administrator. Then enter the following command:
+### Install the driver
-`bcdedit /set TESTSIGNING ON`
+#### Componentized INF files
-Reboot the target computer. Then navigate to the Tools folder in your WDK installation and locate the DevCon tool. For example, look in the following folder:
+The TabletAudioSample driver package contains a sample driver, an extension sample and an APO software component. The following instructions show you how to install and test the sample driver, the APO component and then the extension to apply the software component to the driver.
-C:\\Program Files (x86)\\Windows Kits\\10\\Tools\\x64\\devcon.exe
+First, the base INF, *ComponentizedAudioSample.inf*, has to be installed. To install it, open a Command Prompt window as administrator on the target computer, then navigate to your driver package folder and enter the following command:
-Copy *devcon.exe* to a folder on the target computer where it is easier to find. For example, create a *C:\\Tools* folder and copy *devcon.exe* to that folder.
+`devcon install ComponentizedAudioSample.inf Root\Sysvad_ComponentizedAudioSample`
-Create a folder on the target for the built driver package (for example, *C:\\SysvadDriver*). Copy all the files from the built driver package on the host computer and save them to the folder that you created on the target computer.
+If you get an error message about *devcon* not being recognized, try adding the path to the *devcon* tool. For example, if you copied it to a folder called *C:\\Tools*, then try using the following command:
-Create a folder on the target computer for the certificate created by the build process. For example, you could create a folder named *C:\\Certificates* on the target computer, and then copy *package.cer* to it from the host computer. You can find this certificate in the same folder on the host computer, as the *package* folder that contains the built driver files. On the target computer, right-click the certificate file, and click **Install**, then follow the prompts to install the test certificate.
+`C:\\tools\\devcon install ComponentizedAudioSample.inf Root\Sysvad_ComponentizedAudioSample`
-If you need more detailed instructions for setting up the target computer, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment).
+This installs the base Tablet Audio Sample driver with a hardware ID of "Root\Sysvad_ComponentizedAudioSample".
-#### 2. Install the driver
+Then, either the extension INF (*ComponentizedAudioSampleExtension.inf*) or the APO INF (*ComponentizedApoSample.inf*) can be installed.
-The TabletAudioSample or PhoneAudioSample driver package contains a sample driver and 2 driver extension samples. The following instructions show you how to install and test the sample driver.
+If the extension INF is installed first, it will create a new component called *Audio Proxy APO Sample*. Until the APO is installed, this component will appear in Device Manager under the section of Software Components, because it does not have a driver attached yet. The driver is attached by installing the APO INF.
-The INF file required for installing this driver is *TabletAudioSample.inf*.
+If the APO is installed first, it will install a driver, but it will not create a device, so the APO will not be visible in Device Manager until the extension INF creates a software component that will then have the APO driver installed.
-On the target computer, open a Command Prompt window as Administrator. Navigate to your driver package folder, and enter the following command:
+Both extension and APO INFs can be installed by right-clicking on any of the files and selecting "install" from the menu.
-`devcon dp_add TabletAudioSample.inf`
+Once the three componentized INF files are installed, an APO device should appear in Device Manager and the *Microsoft Virtual Audio Device (WDM) - Tablet Audio Sample* device should now be named *SYSVAD (with APO Extensions)*.
-If you get an error message about *devcon* not being recognized, try adding the path to the *devcon* tool. For example, if you copied it to a folder called *C:\\Tools*, then try using the following command:
+For more detailed instructions, see [Provision a computer for driver deployment and testing](https://docs.microsoft.com/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1).
-`C:\\tools\\devcon dp_add TabletAudioSample.inf`
+#### Single INF files
-For more detailed instructions, see [Provision a computer for driver deployment and testing](https://docs.microsoft.com/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1).
+TabletAudioSample also contains an INF file, tabletaudiosample.inf, which install the sample driver using a single INF file.
+
+Componentized driver packages are required since Windows 10 1809 release. However, for backward compatibility, instructions on how to install the TabletAudioSample.inf are provided below.
+
+On the target computer, open a Command Prompt window as Administrator. Navigate to your driver package folder, and enter the following command:
+
+`devcon dp_add TabletAudioSample.inf`
After successfully installing the sample driver, you're now ready to test it.
### Test the driver
-On the target computer, in a Command Prompt window, enter **devmgmt** to open Device Manager. In Device Manager, on the **View** menu, choose **Devices by type**. In the device tree, locate *Microsoft Virtual Audio Device (WDM) - Tablet Audio Sample*. This is typically under the **Sound, video and game controllers** node.
+On the target computer, in a Command Prompt window, enter **devmgmt.msc** to open Device Manager. In Device Manager, on the **View** menu, choose **Devices by type**. In the device tree, locate *SYSVAD (with APO Extensions)*. This is typically under the **Sound, video and game controllers** node.
-On the target computer, open Control Panel and navigate to **Hardware and Sound** \> **Manage audio devices**. In the Sound dialog box, select the speaker icon labeled as *Microsoft Virtual Audio Device (WDM) - Tablet Audio Sample*, then click **Set Default**, but do not click **OK**. This will keep the Sound dialog box open.
+On the target computer, open Control Panel and navigate to **Hardware and Sound** \> **Manage audio devices**. In the Sound dialog box, select the speaker icon labeled as *SYSVAD (with APO Extensions)*, then click **Set Default**, but do not click **OK**. This will keep the Sound dialog box open.
-Locate an MP3 or other audio file on the target computer and double-click to play it. Then in the Sound dialog box, verify that there is activity in the volume level indicator associated with the *Microsoft Virtual Audio Device (WDM) - Tablet Audio Sample* driver.
+Locate an MP3 or other audio file on the target computer and double-click to play it. Then in the Sound dialog box, verify that there is activity in the volume level indicator associated with the *SYSVAD (with APO Extensions)* driver.
diff --git a/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inx b/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inx
index 4ee84101..a6bfb4af 100644
--- a/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inx
+++ b/audio/sysvad/TabletAudioSample/ComponentizedApoSample.inx
Binary files differ
diff --git a/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inx b/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inx
index 4f29c985..ce3ed335 100644
--- a/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inx
+++ b/audio/sysvad/TabletAudioSample/ComponentizedAudioSampleExtension.inx
Binary files differ
diff --git a/audio/sysvad/sysvad.sln b/audio/sysvad/sysvad.sln
index 2965165c..1935f749 100644
--- a/audio/sysvad/sysvad.sln
+++ b/audio/sysvad/sysvad.sln
@@ -9,8 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "KeywordDetectorAdapter", "K
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EndpointsCommon", "EndpointsCommon", "{0B4B8E51-20A8-43A4-A8DA-42FF90D628AC}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PhoneAudioSample", "PhoneAudioSample", "{D0DBEBE9-0DCC-4EA7-966B-C029C1334D9E}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TabletAudioSample", "TabletAudioSample", "{C06F6070-75EE-4F57-8D35-4AC2AB08D029}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "package\package.VcxProj", "{830B14D5-0E32-4F9E-AEFA-4C9F6FC13C2A}"
@@ -19,11 +17,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeywordDetectorContosoAdapt
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EndpointsCommon", "EndpointsCommon\EndpointsCommon.vcxproj", "{33E61864-6F2C-4F9F-BE70-8F8985A4F283}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PhoneAudioSample", "PhoneAudioSample\PhoneAudioSample.vcxproj", "{FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}"
- ProjectSection(ProjectDependencies) = postProject
- {33E61864-6F2C-4F9F-BE70-8F8985A4F283} = {33E61864-6F2C-4F9F-BE70-8F8985A4F283}
- EndProjectSection
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TabletAudioSample", "TabletAudioSample\TabletAudioSample.vcxproj", "{E4DF0EEE-D35B-47F2-A9B1-41EA97C465FF}"
ProjectSection(ProjectDependencies) = postProject
{33E61864-6F2C-4F9F-BE70-8F8985A4F283} = {33E61864-6F2C-4F9F-BE70-8F8985A4F283}
@@ -83,18 +76,6 @@ Global
{33E61864-6F2C-4F9F-BE70-8F8985A4F283}.Release|Win32.Build.0 = Release|Win32
{33E61864-6F2C-4F9F-BE70-8F8985A4F283}.Release|x64.ActiveCfg = Release|x64
{33E61864-6F2C-4F9F-BE70-8F8985A4F283}.Release|x64.Build.0 = Release|x64
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Debug|ARM64.Build.0 = Debug|ARM64
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Debug|Win32.ActiveCfg = Debug|Win32
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Debug|Win32.Build.0 = Debug|Win32
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Debug|x64.ActiveCfg = Debug|x64
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Debug|x64.Build.0 = Debug|x64
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Release|ARM64.ActiveCfg = Release|ARM64
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Release|ARM64.Build.0 = Release|ARM64
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Release|Win32.ActiveCfg = Release|Win32
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Release|Win32.Build.0 = Release|Win32
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Release|x64.ActiveCfg = Release|x64
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE}.Release|x64.Build.0 = Release|x64
{E4DF0EEE-D35B-47F2-A9B1-41EA97C465FF}.Debug|ARM64.ActiveCfg = Debug|ARM64
{E4DF0EEE-D35B-47F2-A9B1-41EA97C465FF}.Debug|ARM64.Build.0 = Debug|ARM64
{E4DF0EEE-D35B-47F2-A9B1-41EA97C465FF}.Debug|Win32.ActiveCfg = Debug|Win32
@@ -151,7 +132,6 @@ Global
{830B14D5-0E32-4F9E-AEFA-4C9F6FC13C2A} = {FA56D96B-290B-4C73-A5E1-02C1861D3224}
{E0F02048-78A4-4FE8-B863-66E6CB6A2C37} = {DBD14E7B-7F95-4743-86E3-4E16FA43F990}
{33E61864-6F2C-4F9F-BE70-8F8985A4F283} = {0B4B8E51-20A8-43A4-A8DA-42FF90D628AC}
- {FABA4668-DB5E-4F6C-9D25-A0B25AD084EE} = {D0DBEBE9-0DCC-4EA7-966B-C029C1334D9E}
{E4DF0EEE-D35B-47F2-A9B1-41EA97C465FF} = {C06F6070-75EE-4F57-8D35-4AC2AB08D029}
{8851AB85-70B3-4798-A149-BA366DF9EC25} = {D86F9A10-C48D-4048-A03C-DD7BCA6E165F}
{691F1D0F-CA50-46CD-8BBA-A59E9E8EB601} = {D86F9A10-C48D-4048-A03C-DD7BCA6E165F}