none
IMiniportAudioSignalProcessing support in driver RRS feed

  • Question

  • Hi,

    I recently ran into a problem while running WHQL tests on one of our PortCls audio drives. Apparently, under Windows 8.1, miniports must support the IMiniportAudioSignalProcessing interface. So, I've gone ahead and implemented the IMiniportAudioSignalProcessing::GetModes routine, following the documentation here: http://msdn.microsoft.com/en-us/library/windows/hardware/dn457660(v=vs.85).aspx. I've also added code to the delegate routine, and inherit from the interface:

    class MiniportWaveCyclic :
    	public IMiniportWaveCyclic,
    	public IMiniportAudioSignalProcessing,
    	public IPowerNotify,
    	public CUnknown {
    	
    	...
    	
    }
    
    ...
    
    NTSTATUS 
    IBTMiniportWaveCyclic::NonDelegatingQueryInterface(
    	_In_ REFIID Interface, 
    	_COM_Outptr_ PVOID *Object
    	) 
    {
    	NTSTATUS status = STATUS_SUCCESS;
    
    	if(!Object) {
    		status = STATUS_INVALID_PARAMETER;
    		goto exit;
    	}
    
    	...
    	
    	else if(IsEqualGUIDAligned(Interface, IID_IMiniportAudioSignalProcessing)) {
    		(*Object) = (PVOID)(PMINIPORTAudioSignalProcessing) this;
    	}
    		
    	...
    
    	if(*Object) {
    		((PUNKNOWN) (*Object))->AddRef();
    	}
    		
    exit:
    	return status;
    }
    
    ...
    
    NTSTATUS 
    IBTMiniportWaveCyclic::GetModes(
    	_In_ ULONG Pin,
    	_Out_writes_opt_(*NumSignalProcessingModes) PGUID SignalProcessingModes,
    	_Inout_ PULONG NumSignalProcessingModes
    	)
    {
    	errno_t err;
    	NTSTATUS status = STATUS_SUCCESS;
    
    	if(!NumSignalProcessingModes) {
    		status = STATUS_INVALID_PARAMETER;
    		goto exit;
    	}
    
    	if(Pin > PIN_WAVE_SOURCE) {
    		status = STATUS_INVALID_PARAMETER;
    		goto complete;
    	}
    
    	// bridge pins are not supported
    	if(Pin == PIN_WAVE_SOURCE) {
    		status = STATUS_NOT_SUPPORTED;
    		goto complete;
    	}
    
    	if(SignalProcessingModes) {
    
    		// check caller supplied buffer size
    		if((*NumSignalProcessingModes) < SUPPORTED_AUDIO_PROCESSING_MODES) {
    			status = STATUS_BUFFER_TOO_SMALL;
    			goto complete;
    		}
    
    		// copy supported processing modes
    		err = memcpy_s(
    			SignalProcessingModes, 
    			sizeof(GUID), 
    			&AUDIO_SIGNALPROCESSINGMODE_RAW, 
    			sizeof(GUID)
    			);
    
    		if(err) {
    			status = STATUS_UNSUCCESSFUL;
    			goto complete;
    		}
    	}
    
    complete:
    	if(NT_SUCCESS(status)) {
    		(*NumSignalProcessingModes) = SUPPORTED_AUDIO_PROCESSING_MODES;
    	} else {
    		(*NumSignalProcessingModes) = 0;
    	}
    
    exit:
    	return status;
    }

    This appears to do the trick for passing the VerifyAudioEffectsDiscovery test that was failed previously. However, I can no longer stream audio through the endpoint. The Sound Panel simply displays a dialog box saying that the test sound failed to play:

    I'm not sure what's wrong? Perhaps I'm missing something? The endpoint streamed fine prior to the inclusion of this interface. I should also note that while the endpoint can't be instantiated by the Sound Panel, it can be instantiated in KSStudio.

    Any help would be greatly appreciated. Thanks,

    David

    Wednesday, February 19, 2014 12:40 AM

All replies

  • Hey David,

    I am trying to do the same for my driver. What does PIN_WAVE_SOURCE and SUPPORTED_AUDIO_PROCESSING_MODES stand for in here? What are their values? 

    Did you figure out what you were missing?

    Monday, August 10, 2015 6:35 PM