[wdmaudiodev] Re: Change default sound format with an inf File in Win7

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Tue, 23 Feb 2010 10:20:10 -0800

Ueli Giger wrote:
> That's a good idea cause I only want to make the format Stereo 16Bit
> 44100 Hz, but how can I do this?
> My problem is that I've no experience in programming a lower filter
> driver. Can you give me any good
> links or examples?

Is this a device that your company is manufacturing?  If so, then just
change the configuration descriptors to advertise that one format only. 
Easy solution.

Filter drivers are pretty easy with KMDF.  There are good samples in the
DDK, in src\general\toaster\filter for one.  One way to do this is to
have your filter driver intercept the URB_GET_DESCRIPTOR_FROM_DEVICE
request, and rewrite it to have only the format you want.  That's not
rocket science, but there are a lot of details.  You have to allocate
memory to hold the revised descriptor, parse it well enough to find the
format descriptor, and copy it back into the URB.

> Problem 1:
> When you plug in the PCM2904, Win7 finds the USB Audio Codec and
> installs it with the default format
> Mono, 16 Bit, 44100 Hz. But we need the format Stereo, 16 Bit, 44100
> Hz. To solve this problem
> my idea was to copy the standard .inf file and add the lines for the
> default format and then install
> this driver over the standard usb audio driver.

I don't understand that.  Windows should choose the most capable format
the device offers, unless there is already a format override.  But
regardless of that, if the application needs a specific format, why
can't you have your LabView application override the format?  THAT'S the
right solution, not this ugly driver mucking.  Kernel code should always
be a last resort.

> Problem 2:
> Under Win7 we have an additional gain of +40dB against the
> measurements with win XP. When I change
> the format over the control panel when the LabView application is
> running, the gain disappears and the
> measurement is the same as in XP.
> What could be the reasons for this gain? And how can I bypass my
> signal without any gains?

How is that possible?  +40dB is a ratio of 10,000 to 1.  A 16-bit format
only has a range of +/- 32,768.  There must be something else going on

Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.


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


Other related posts: