[wdmaudiodev] Re: Fwd: Re: WDM audio driver for 32 bit floating point device.

  • From: Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Fri, 11 Sep 2015 21:56:38 +0000

I don’t have any evidence either way… so maybe not.

From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Zubin Polra
Sent: Wednesday, September 9, 2015 9:56 PM
To: Wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Fwd: Re: WDM audio driver for 32 bit floating point
device.

Still clueless for implementing 32 bit floating point pcm format in WDM audio
driver. No sample(msvad or sysvad) comes to my rescue.
Could anybody please clarify about it whether it is possible with windows audio
stack or not?

Thanks,
Zubin
---------- Forwarded message ----------
From: Zubin Polra <zubin.polra2007@xxxxxxxxx<mailto:zubin.polra2007@xxxxxxxxx>>
Date: Tue, Aug 11, 2015 at 5:15 PM
Subject: Re: [wdmaudiodev] Re: WDM audio driver for 32 bit floating point
device.
To: wdmaudiodev@xxxxxxxxxxxxx<mailto:wdmaudiodev@xxxxxxxxxxxxx>

Hi Matthew,

I downloaded msvad sample from
https://code.msdn.microsoft.com/windowshardware/Windows-Driver-Kit-WDK-80-e3161626#content
I opened (<My downloads folder>\Windows Driver Kit (WDK) 8.0 Samples\C++\WDK
8.0 Samples\Microsoft Virtual Audio Device Driver Sample\Solution) in VS2012
integrated with wdk 8.0 on windows 7 and I built and successfully with Win7
Debug x64 configuration.
I deployed and installed vadsimpl.sys to my test machine.
I am able to see the devices added by the driver at playback device as well as
recording device tabs at sound dialog.

Now, I just changed data range of pin to support floating point PCM format
instead of integer PCM format.

static
KSDATARANGE_AUDIO PinDataRangesStream[] =
{
{
{
sizeof(KSDATARANGE_AUDIO),
0,
0,
0,
STATICGUIDOF(KSDATAFORMAT_TYPE_AUDIO),
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT), //Changed
STATICGUIDOF(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
},
MAX_CHANNELS_PCM, // 2
MIN_BITS_PER_SAMPLE_PCM, // 32
MAX_BITS_PER_SAMPLE_PCM, // 32
MIN_SAMPLE_RATE, // 44100
MAX_SAMPLE_RATE // 44100
},
};
Also made relevant changes to ValidateFormat

..............
...................
case WAVE_FORMAT_IEEE_FLOAT:
{
switch (pwfx->wFormatTag)
{
case WAVE_FORMAT_IEEE_FLOAT:
{
ntStatus = ValidatePcm(pwfx);
break;
}
}
break;
}
................
..............
and
PropertyHandlerProposedFormat

.......................
........................
if ((pKsFormat->DataFormat.MajorFormat ==
KSDATAFORMAT_TYPE_AUDIO) &&
(pKsFormat->DataFormat.SubFormat ==
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) &&
(pKsFormat->DataFormat.Specifier ==
KSDATAFORMAT_SPECIFIER_WAVEFORMATEX))
{
WAVEFORMATEX* pWfx =
(WAVEFORMATEX*)&pKsFormat->WaveFormatEx;

// make sure the WAVEFORMATEX part of the format makes sense
if ((pWfx->wBitsPerSample == 32) &&
((pWfx->nSamplesPerSec == 44100) ||
(pWfx->nSamplesPerSec == 48000)) &&
(pWfx->nBlockAlign == (pWfx->nChannels * 2)) &&
(pWfx->nAvgBytesPerSec == (pWfx->nSamplesPerSec *
pWfx->nBlockAlign)))
{
if ((pWfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) &&
(pWfx->cbSize == 0))
{
if (pWfx->nChannels == 2)
{
ntStatus = STATUS_SUCCESS;
}
}
else
if ((pWfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) &&
(pWfx->cbSize == CB_EXTENSIBLE))
{
WAVEFORMATEXTENSIBLE* pWfxT =
(WAVEFORMATEXTENSIBLE*)pWfx;

if (((pWfx->nChannels == 2) &&
(pWfxT->dwChannelMask == KSAUDIO_SPEAKER_STEREO)) ||
((pWfx->nChannels == 6) &&
(pWfxT->dwChannelMask == KSAUDIO_SPEAKER_5POINT1_SURROUND)) ||
((pWfx->nChannels == 8) &&
(pWfxT->dwChannelMask == KSAUDIO_SPEAKER_7POINT1_SURROUND)))
{
ntStatus = STATUS_SUCCESS;
}
}
}
...............................
.........................

I built,deployed and installed the driver with above changes.

No devices are added by the driver at playback device as well as recording
device tabs at sound dialog.

I am able to instantiate pin and change its states like acquire, start etc.
using KS Studio.

Could anybody please help me to use 32 bit floating point format in WDM audio
driver.

Thanks,
Zubin.

On Mon, Aug 10, 2015 at 9:01 PM, Matthew van Eerde
<Matthew.van.Eerde@xxxxxxxxxxxxx<mailto:Matthew.van.Eerde@xxxxxxxxxxxxx>> wrote:
Sure. Have your data range expose KSDATAFORMAT_SUBTYPE_IEEE_FLOAT instead of
KSDATAFORMAT_SUBTYPE_PCM.

From: wdmaudiodev-bounce@xxxxxxxxxxxxx<mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx>
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx<mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx>]
On Behalf Of Zubin Polra
Sent: Monday, August 10, 2015 4:46 AM
To: Wdmaudiodev@xxxxxxxxxxxxx<mailto:Wdmaudiodev@xxxxxxxxxxxxx>
Subject: [wdmaudiodev] WDM audio driver for 32 bit floating point device.

Hello everybody,
Our hardware device expects 32 bit floating point formatted samples. Is this
possible to develop WDM audio driver that can successfully advertise its pin
format as 32 bit floating point and Windows allows clients like windows media
player to feed data to the device?
Thanks
Zubin.


Other related posts: