[wdmaudiodev] Re: kmixer bypassing

  • From: "Jerry Evans" <jerry@xxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Mon, 28 May 2007 12:59:25 +0100

Hi Uwe

Interesting. Does your bypass mode get the expected performance increase? Is it possible for you to describe in slightly more detail how the driver is installed/configured?

Thx. I'm off to dig out the NT4 DDK :-)

Jerry
----- Original Message ----- From: "Uwe Kirst" <u.kirst@xxxxxx>
To: <wdmaudiodev@xxxxxxxxxxxxx>
Sent: Monday, May 28, 2007 10:04 AM
Subject: [wdmaudiodev] Re: kmixer bypassing


Borislav Trifonov schrieb:
My second question is about kmixer. I've been told by someone that if a sound device presents itself as having a hardware mixer, then XP will bypass kmixer, and he gave as an example a specific USB DAC. I was encouraged of having a simple way to get bit-perfect output. However, then I came across a Microsoft document claiming that any stream going to usbaudio.sys _always_ goes through kmixer.
Hello Borislav,

I'm not an expert about USB, but I can tell you everything about bypassing the kernel mixer. The kernel mixer is placed on top of the usb audio driver, but also on top of portclass. So it should not make a difference wether we are talking about a pci or usb device. Both suffer from kmixer. The microsoft kernel mixer introduces an additional buffering step. The data is copied from a user mode buffer to a kernel mode buffer. The sample rate may also change (sample rate conversations). The buffering introduces 10ms additional latency, the main disadvantage of this concept. Bit transparency can also not be garantied, it depends on so may factors: OS version, service pack state, sample rate in the driver, selected sample rate within the applications, selected sample rate within the ms controlpanel, bit resolution, playback or record, an so on. As you mentioned microsoft says that the data goes always through kmixer. In vista the kmixer moved form kernel mode to user space. But the basic concept (the additional buffering and mixing stage) remains the same.

Bypassing the kernel mixer means that you provide an additional data path. The user can now decide wether the data flows through kmixer or your own driver.dll. Copying the data is not necessary in your bypass driver. You can just pass a buffer down, without touching it.

The easiest way to do it is of course to use another driver model (e.g. ASIO), but that was not your question I think. If you really want to write a kmixer bypass driver (which I have already done, so I know what I'm talking about), you should look at a old nt 4.0 ddk, which contains an implementations of the wave api in the user mode. This code is missing in newer ddks, because it's part of the microsoft audio stack. So we do not have sources of that. The wave api is the upper interface of your kernel_mixer_bypass.dll. You can deceide which the the lower interface should be: DirectKS (MS example available) or you write your personal custom interface. I used DirectKS. My implementation works fine from w2k up to vista, but does not work on 64-Bit versions of the OS. I can not tell you why.

/Uwe
******************

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/

Other related posts: