Mmsys.cpl only shows formats that are actually supported by the device. The driver can set the preferred format at install time using an inf. To do this, put the following AddReg on the device interface >>> AddReg=OEMSettingsOverride.AddReg ;; ;; Set default format to 48kHz, 16-bit, Stereo ;; [OEMSettingsOverride.AddReg] HKR,"EP\\0", %PKEY_AudioEndpoint_Association%,,%KSNODETYPE_MICROPHONE% HKR,"EP\\0", %PKEY_AudioEngine_OEMFormat%, %REG_BINARY%, 41,00,8C,70,28,00,00,00,FE,FF,02,00,80,BB,00,00,00,EE,02,00,04,00,10,00, 16,00,10,00,03,00,00,00,01,00,00,00,00,00,10,00,80,00,00,AA,00,38,9B,71 [Strings] PKEY_AudioEndpoint_Association = "{1DA5D803-D492-4EDD-8C23-E0C0FFEE7F0E},2" PKEY_AudioEngine_OEMFormat = "{E4870E26-3CC5-4CD2-BA46-CA0A9A70ED04},3" >>> Regards, Mitch Rundle Microsoft Corp. This posting is provided "as is" with no warranties, and confers no rights -----Original Message----- From: wdmaudiodev-bounce@xxxxxxxxxxxxx [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Dugan Porter Sent: Tuesday, July 18, 2006 10:31 AM To: wdmaudiodev@xxxxxxxxxxxxx Subject: [wdmaudiodev] Re: sample rate control on Vista I *believe* that Vista looks at the actual hardware formats supported by the driver, and only lists those in the mmsys.cpl dropdown. I also *believe* that the driver can express its preferred format when it is installed, and the system will default to that. But I'm not at all certain of these beliefs - please don't take them on trust unless they're confirmed by someone on the team that actually owns this area (I only own DirectSound)... Dugan Porter - Game Audio Team - Microsoft This posting is provided "as is" with no warranties, and confers no rights -----Original Message----- From: wdmaudiodev-bounce@xxxxxxxxxxxxx [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Jeff Pages Sent: Monday, July 17, 2006 4:53 PM To: wdmaudiodev@xxxxxxxxxxxxx Subject: [wdmaudiodev] Re: sample rate control on Vista Related to this, I was wondering if there's any way the driver can indicate its preferred default sampling rate and bit depth, or does Vista always set this to 44.1kHz 16-bit regardless of the capabilities of the hardware. Jeff Pages Innes Corporation Pty Ltd ----- Original Message ----- From: "Dugan Porter" <duganp@xxxxxxxxxxxxxxxxxxxxx> To: <wdmaudiodev@xxxxxxxxxxxxx> Sent: Tuesday, July 18, 2006 9:40 AM Subject: [wdmaudiodev] Re: sample rate control on Vista > Hi Nikolay. Here's a multi-part answer for you: > > 1. There is no programmatic way for an app to set the mmsys.cpl capture > rate, because the Vista philosophy is that no audio app can make > configuration changes that affect any other apps. The setting in > mmsys.cpl is only meant to be changed by the user. > > 2. If an app uses the legacy APIs (waveIn and DirectSoundCapture) to > capture audio at a rate other than mmsys.cpl's, the system will convert > from the mmsys.cpl rate to the app's requested rate using a sample rate > converter. > > 3. However, if an app uses the new WASAPI API in exclusive mode (by using > the AUDCLNT_SHAREMODE_EXCLUSIVE flag), it can open the device in any > format supported by the driver, and no SRC will be used. The downside is > that no other app will be able capture audio. > > 4. If you need to use a legacy API, you can at least *discover* the system > capture rate setting using the new Vista APIs, and then capture at that > rate, to avoid the SRC; however this doesn't let you *control* the rate. > > Hope that helps - > Dugan Porter - Game Audio Team - Microsoft > This posting is provided "as is" with no warranties, and confers no rights > > > -----Original Message----- > From: wdmaudiodev-bounce@xxxxxxxxxxxxx > [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Nikolay V. Pyatkov > Sent: Sunday, July 16, 2006 3:22 PM > To: wdmaudiodev@xxxxxxxxxxxxx > Subject: [wdmaudiodev] sample rate control on Vista > > Hi, > > We have an input only WDM portcls audio driver on Vista 5456. The driver > can > support 48,000 and 44,100 sample rate. The application needs to open this > driver at 48,000. Here is the code: > > WAVEFORMATEX wf; > wf.wFormatTag = WAVE_FORMAT_PCM; > wf.nChannels = 2; > wf.nSamplesPerSec = 48000; > wf.nAvgBytesPerSec = 192000; > wf.nBlockAlign = nBlockAlign; > wf.wBitsPerSample = UCODEC_BIT_PER_SAMPLE_PCM; > wf.cbSize = 0; > > mmResult = waveInOpen( > &m_hWaveIn, > nInputDeviceId, > &m_WaveFormat, > (DWORD_PTR)m_hWaveInEvent, > 0, > CALLBACK_EVENT); > > mmResult is 0. > > But the trace in the driver shows: > > 00000431 9.63108540 ValidatePcm : > 00000432 9.63109016 ---- cbSize = 22 > 00000433 9.63109398 ---- nChannels = 2 > 00000434 9.63109875 ---- nSamplesPerSec = 44100 > 00000435 9.63110352 ---- wBitsPerSample = 16 > > The Vista audio subsystem took the parameters from "Audio > Devices->Recording->My Device->Properties->Options" .If I manually modify > value in the Options panel Vista will use the value to open my device. > > I tried to check/uncheck "exclusive control" box. Does not help. How do I > get > control over the bit rate back to the application? > > Thanks, > Nikolay > > > > > > > > > ****************** > > WDMAUDIODEV addresses: > Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx > Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe > Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe > Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx > > URL to WDMAUDIODEV page: > http://www.wdmaudiodev.com/ > > > ****************** > > WDMAUDIODEV addresses: > Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx > Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe > Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe > Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx > > URL to WDMAUDIODEV page: > http://www.wdmaudiodev.com/ > > > ****************** WDMAUDIODEV addresses: Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to WDMAUDIODEV page: http://www.wdmaudiodev.com/ ****************** WDMAUDIODEV addresses: Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to WDMAUDIODEV page: http://www.wdmaudiodev.com/ ****************** WDMAUDIODEV addresses: Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to WDMAUDIODEV page: http://www.wdmaudiodev.com/