[wdmaudiodev] Re: kernel mode streaming

  • From: Tim Roberts <timr@xxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 20 Jul 2010 10:09:24 -0700

 Andrew Sha...... wrote:
> Is it possible to stream data in the kernel mode? In other words, say,
> I have audio data in kernel mode (not in audio stack), so is it
> possible to find and open a pin and play data entirely in kernel mode
> w/o user mode components engaged?

Theoretically, yes.  Kernel Streaming is just a (rather complex) set of
ioctls.  Those ioctls can be used from kernel mode or user mode.

However, in practice things are not so clear.  There are no good ways
for a kernel driver to, for example, enumerate the list of installed
devices to find an audio output device to connect to.  Device
enumeration is a user-mode task.  If you want to send your data into a
real KS audio device so that it comes out of a speaker, you will
generally be much better off to get a user-mode process involved.  Even
with a user-mode controller, the streaming can be kept in KM, as long as
there are no UM components in the graph.

The situation is a little different in Vista and beyond.  Here, the
primary audio engine is a user-mode process to begin with.  The
incentive to stay in kernel mode no longer exists.

Now, if you have custom audio-like data that you want to pipe to another
custom kernel component, then you can invent whatever scheme you need. 
It probably isn't worth the trouble to involve KS at all.

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

Other related posts: