[wdmaudiodev] Re: Question about SYSVAD audio driver

  • From: think more <iiiii5322@xxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Thu, 25 Jan 2018 19:32:16 +0200

I just added couple of breakpoints, one in handler and another in function that 
calls this handler and both breakpoints doesn’t get hit when I start that 
effect scanner program sample :/

NTSTATUS
CMiniportWaveRT::PropertyHandler_MicAudioEffectsDiscoveryEffectsList
(
        _In_ PPCPROPERTY_REQUEST PropertyRequest
)
{
        PAGED_CODE();

        DPF_ENTER(("[PropertyHandler_MicAudioEffectsDiscoveryEffectsList]"));

        NTSTATUS    ntStatus = STATUS_INVALID_PARAMETER;
        ULONG       nPinId = (ULONG)-1;
        DbgBreakPoint();
        // 
        // Validate Pin ID.
        //


And another in:
NTSTATUS
PropertyHandler_WaveFilter

    _In_ PPCPROPERTY_REQUEST      PropertyRequest 
)
{
….
else if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, 
KSPROPSETID_AudioEffectsDiscovery))
        {
                DbgBreakPoint();
                switch (PropertyRequest->PropertyItem->Id)
                {
                case KSPROPERTY_AUDIOEFFECTSDISCOVERY_EFFECTSLIST:
                        ntStatus = 
pWaveHelper->PropertyHandler_MicAudioEffectsDiscoveryEffectsList(PropertyRequest);
                        break;
                }
        }

}
From: Matthew van Eerde
Sent: Thursday, January 25, 2018 19:12
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: Question about SYSVAD audio driver

Set a breakpoint on your handler. Run the effects discovery test. Does your 
breakpoint get hit?


From: wdmaudiodev-bounce@xxxxxxxxxxxxx <wdmaudiodev-bounce@xxxxxxxxxxxxx> on 
behalf of think more <iiiii5322@xxxxxxxxx>
Sent: Wednesday, January 24, 2018 11:37:17 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: Question about SYSVAD audio driver 
 
Thank you a lot, for responding, I have these lines in .inf file:

PKEY_FX_Association                 = "{D04E05A6-594B-4FB6-A80D-01AF5EED7D1D},0"
PKEY_FX_EndpointEffectClsid         = "{D04E05A6-594B-4fb6-A80D-01AF5EED7D1D},7"
PKEY_CompositeFX_StreamEffectClsid  = 
"{D04E05A6-594B-4fb6-A80D-01AF5EED7D1D},13"
PKEY_CompositeFX_ModeEffectClsid    = 
"{D04E05A6-594B-4fb6-A80D-01AF5EED7D1D},14"

FX_DISCOVER_EFFECTS_APO_CLSID  = "{889C03C8-ABAD-4004-BF0A-BC7BB825E166}"

PKEY_SFX_ProcessingModes_Supported_For_Streaming = 
"{D3993A3F-99C2-4402-B5EC-A92A0367664B},5"
PKEY_MFX_ProcessingModes_Supported_For_Streaming = 
"{D3993A3F-99C2-4402-B5EC-A92A0367664B},6"
PKEY_EFX_ProcessingModes_Supported_For_Streaming = 
"{D3993A3F-99C2-4402-B5EC-A92A0367664B},7"


;======================================================
; MsApoFxProxy APO registry
;======================================================
[MsApoFxProxy.I.Association0.AddReg]
HKR,FX\0,%PKEY_FX_Association%,,%KSNODETYPE_ANY%
HKR,FX\0,%PKEY_FX_EndpointEffectClsid%,,%FX_DISCOVER_EFFECTS_APO_CLSID%

[SYSVAD_SA.NT]
Include=ks.inf,wdmaudio.inf
Needs=KS.Registration, WDMAUDIO.Registration, MsApoFxProxy.Registration
CopyFiles=SYSVAD_SA.CopyList
AddReg=SYSVAD_SA.AddReg


What am In missing, for those effects to show up?
From: Matthew van Eerde
Sent: Wednesday, January 24, 2018 22:15
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: Question about SYSVAD audio driver

Oh, you did. Sorry.

The property handler you have written is supposed to be called by the 
msapofxproxy.dll Microsoft APO effects proxy. But for this to work you will 
need to include the right inf sections to pull it in. And you will also need to 
set the right FX\... property keys in your .inf to tell Windows to use it.


From: Matthew van Eerde (^_^)
Sent: Wednesday, January 24, 2018 12:13:20 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: RE: [wdmaudiodev] Question about SYSVAD audio driver 
 
Use the effects discovery tests in the HLK, and the Windows audio effects 
discovery sample, to verify that your effects are being reported properly.

https://docs.microsoft.com/en-us/windows-hardware/test/hlk/testref/9ffe6819-92f8-4cd8-8174-3f74a6468c8a
https://code.msdn.microsoft.com/windowsapps/Audio-effects-discovery-5fd65c15


From: wdmaudiodev-bounce@xxxxxxxxxxxxx <wdmaudiodev-bounce@xxxxxxxxxxxxx> on 
behalf of think more <iiiii5322@xxxxxxxxx>
Sent: Wednesday, January 24, 2018 12:08:55 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Question about SYSVAD audio driver 
 
Hi,

I am trying to send audio to Skype from virtual mic, using SYSVAD example. At 
the moment I can successfully send audio to any voip program from mic wxcept 
skype. When I start skype call, music gets muted to silence and white noise 
intensifies. If I listen to mic directly, sound is still coming and it sounds 
perfectly, but skype still removes it (maybe it things it’s noise). I’ve found 
this document: https://www.microsoft.com/en-us/download/details.aspx?id=42523, ;
in which they say, that if driver doesn’t implement NS and AEC, skype adds 
them. I think these two effects destroys my sound, so I want to say to skype, 
that I already applied these effects to RAW mic data. For validating effects, I 
am using this program 
https://code.msdn.microsoft.com/windowsapps/Audio-effects-discovery-5fd65c15.

In minwavert.cpp I added this function: 
NTSTATUS
CMiniportWaveRT::PropertyHandler_MicAudioEffectsDiscoveryEffectsList
(
                _In_ PPCPROPERTY_REQUEST PropertyRequest
)
/*++

Routine Description:

Handles ( 
KSPROPSETID_AudioEffectsDiscovery,KSPROPERTY_AUDIOEFFECTSDISCOVERY_EFFECTSLIST )

Arguments:

PropertyRequest -

Return Value:

NT status code.

--*/
{
                PAGED_CODE();

                
DPF_ENTER(("[PropertyHandler_MicAudioEffectsDiscoveryEffectsList]"));

                NTSTATUS    ntStatus = STATUS_INVALID_PARAMETER;
                ULONG       nPinId = (ULONG)-1;

                // 
                // Validate Pin ID.
                //
                if (PropertyRequest->InstanceSize >= sizeof(ULONG))
                {
                                nPinId = *(PULONG(PropertyRequest->Instance));

                                // This prop is valid only on streaming pins.
                                if (IsSystemRenderPin(nPinId) || 
IsSystemCapturePin(nPinId))
                                {
                                                ntStatus = STATUS_SUCCESS;
                                }
                                else if (IsBridgePin(nPinId) ||
                                                IsLoopbackPin(nPinId) ||
                                                IsOffloadPin(nPinId))
                                {
                                                ntStatus = STATUS_NOT_SUPPORTED;
                                }
                }

                IF_FAILED_JUMP(ntStatus, Done);

                //
                // Valid actions: get and basicsupport.
                //
                ntStatus = STATUS_INVALID_PARAMETER;

                if (PropertyRequest->Verb & KSPROPERTY_TYPE_BASICSUPPORT)
                {
                                ntStatus =
                                                PropertyHandler_BasicSupport
                                                (
                                                                PropertyRequest,
                                                                
KSPROPERTY_TYPE_BASICSUPPORT | KSPROPERTY_TYPE_GET,
                                                                VT_ILLEGAL
                                                );
                }
                else if (PropertyRequest->Verb & KSPROPERTY_TYPE_GET)
                {
                                //ASSERT(m_BthHfpDevice != NULL);

                                //
                                // bHfpNrecPresent is set to TRUE when the HF 
(remote device) handles NR + EC.
                                // Note that GetNRECDisableStatus() returns 
TRUE if the HF notified the AG to disable
                                // the NR + EC locally.
                                //
                                //BOOL bHfpNrecPresent = 
m_BthHfpDevice->IsNRECSupported() && m_BthHfpDevice->GetNRECDisableStatus();

                                // If it is HFP render pin (data flow in) or if 
the NR-EC is not supported, 
                                // return size 0 effect list
                                if (IsSystemRenderPin(nPinId)) //|| 
!bHfpNrecPresent)
                                {
                                                PropertyRequest->ValueSize = 0;
                                                ntStatus = STATUS_SUCCESS;
                                }
                                else
                                {
                                                // Compute total size, two 
effects: NS and EC (see below).
                                                ULONG   cbMinSize = 
sizeof(GUID) * 2;

                                                if (PropertyRequest->ValueSize 
== 0)
                                                {
                                                                
PropertyRequest->ValueSize = cbMinSize;
                                                                ntStatus = 
STATUS_BUFFER_OVERFLOW;
                                                }
                                                else if 
(PropertyRequest->ValueSize < cbMinSize)
                                                {
                                                                ntStatus = 
STATUS_BUFFER_TOO_SMALL;
                                                }
                                                else
                                                {
                                                                PGUID 
effectList = PGUID(PropertyRequest->Value);

                                                                *effectList = 
AUDIO_EFFECT_TYPE_ACOUSTIC_ECHO_CANCELLATION;
                                                                *(effectList + 
1) = AUDIO_EFFECT_TYPE_NOISE_SUPPRESSION;

                                                                
PropertyRequest->ValueSize = cbMinSize;
                                                                ntStatus = 
STATUS_SUCCESS;
                                                }
                                }
                }

Done:

                return ntStatus;
}

In minwavert.cpp in PropertyHandler_WaveFilter I added:

else if (IsEqualGUIDAligned(*PropertyRequest->PropertyItem->Set, 
KSPROPSETID_AudioEffectsDiscovery))
                {
                                DbgBreakPoint();
                                switch (PropertyRequest->PropertyItem->Id)
                                {
                                case 
KSPROPERTY_AUDIOEFFECTSDISCOVERY_EFFECTSLIST:
                                                ntStatus = 
pWaveHelper->PropertyHandler_MicAudioEffectsDiscoveryEffectsList(PropertyRequest);
                                                break;
                                }
                }
And in micinwavtable.h, in PropertiesMicInWaveFiler[], I added:

,
                {
                                &KSPROPSETID_AudioEffectsDiscovery,
                                KSPROPERTY_AUDIOEFFECTSDISCOVERY_EFFECTSLIST,
                                KSPROPERTY_TYPE_GET | 
KSPROPERTY_TYPE_BASICSUPPORT,
                                PropertyHandler_WaveFilter
                },


What I am missing? AEC and NS effects doesn’t show up in sample Effect program. 
Also PropertyHandler_MicAudioEffectsDiscoveryEffectsList function never is 
called. How could I say to skype, that I applied these effects myself, so that 
skype doesn’t degrade audio to noise. Thanks in advance.



PNG image

Attachment: 72D861E8AFE34AA2BEFF813761D2C329.png
Description: PNG image

Other related posts: