ARTICLE AD BOX
I'm currently developing the APO driver for my USB audio device without drivers, but I have no idea where to start. Currently, I am making modifications based on the Windows-driver-samples/audio/sysvad project, but this project uses virtual devices.
I hope to install the apo driver on my USB audio to achieve custom sound effects. I referred to the sysvad project. Previously, I attempted to implement it using only the extended driver and the apo driver. The result is that the driver can be correctly recognized in the device manager, but when playing audio, the audiodg.exe does not load my sound effect DLL.
However, when I ran the sysvad project, I was able to successfully load the audio DLL. I have examined the code of sysvad. It seems that we need to create the device for the microphone and the speaker, and then add the extended driver and the APO driver to make it work properly.
So I began to research how to install the sys file and the three inf files compiled from sysvad onto my USB device. However, after installing the sys file, my USB device does not produce any sound.
Currently, I am modifying the minipairs.h file in the sysvad project. I have only created two devices, which correspond to the speaker and microphone of my USB audio device.
minipairs.h //============================================================================= // // Render miniport pairs. // static PENDPOINT_MINIPAIR g_RenderEndpoints[] = { &SpeakerMiniports, //&SpeakerHpMiniports, //&HdmiMiniports, //&SpdifMiniports, }; #define g_cRenderEndpoints (SIZEOF_ARRAY(g_RenderEndpoints)) //============================================================================= // // Capture miniport pairs. // static PENDPOINT_MINIPAIR g_CaptureEndpoints[] = { &MicInMiniports, //&MicArray1Miniports, //&MicArray2Miniports, //&MicArray3Miniports, };And I found the place where the audio data is stored. However, the audio data has been written by sysvad into a certain file. I don't know how to directly play the data on my USB audio device.
minwavertstream.cpp #pragma code_seg() VOID CMiniportWaveRTStream::ReadBytes ( _In_ ULONG ByteDisplacement ) /*++ Routine Description: This function reads the audio buffer and saves the data in a file. Arguments: ByteDisplacement - # of bytes to process. --*/ { ULONG bufferOffset = m_ullLinearPosition % m_ulDmaBufferSize; // Normally this will loop no more than once for a single wrap, but if // many bytes have been displaced then this may loops many times. while (ByteDisplacement > 0) { ULONG runWrite = min(ByteDisplacement, m_ulDmaBufferSize - bufferOffset); m_SaveData.WriteData(m_pDmaBuffer + bufferOffset, runWrite); bufferOffset = (bufferOffset + runWrite) % m_ulDmaBufferSize; ByteDisplacement -= runWrite; } }Should I base it on the Windows-driver-samples/audio/sysvad project and send the data of the virtual device to my USB device, or was the project I initially referred to incorrect?
