[wdmaudiodev] Re: Driver model for multi-client MIDI

  • From: Alexander Spasov <a.s.spasov@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Wed, 6 May 2015 15:30:29 +0200

I'd say that PortClass is designed for external buses, but does not
strictly enforce them. I've seen virtual audio devices using all three wave
models (cyclic, pci, rt (yes, for rt, it's in one of the MS samples)), plus
MIDI/Dmus/well.. everything. I guess you should be able to do a USB one,
unless there's something blocking you from sending IRPs down the stack
(haven't done any usb drivers, so you quite likely know better ;) ).

On a side-note for the MS people here, what's up with the documentation on
WaveRT's notification mode? It's only present in a virtual sample driver
(which is the last thing one would look for, given the AC97 sample), and in
the reference section on MSDN (can't see it in the design guidelines). I
didn't even know that it existed, and probably wouldn't have unless I
hadn't spent a good chunk of time lurking through user discussions about
the vista audio model, thereby catching a glimpse of "notification mode"
multiple times, and then after some google-fu I saw the interface in the
spec.

On 5 May 2015 at 23:00, Andrew Vogan <andrewvog@xxxxxxxxx> wrote:

Tim Roberts wrote:

Just as a side note, it's not at all clear that a Port-class miniport
is any less work than an AVStream miniport. If you're already comfortable
with Port-class, that may be a good enough reason to make a decision.


While trying to decide between AVStream and PortCls, I found the
following tidbit from MSDN:

*"Port class drivers [...] Do not support external buses (for example,
USB)."*

This is quoted from:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff536829%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

Since I'm coding for USB, that makes me think I should focus on AVStream.
What makes me a little uncomfortable here is how little documentation there
is for doing MIDI via AVStream, in particular the expected pin setup and
registry/installation steps. All the MIDI samples are for PortCls. Also,
from my googling, it seems like the already-sparse online questions
regarding AVStream MIDI tend to go ignored/unanswered.

It seems odd that Microsoft's UsbAudio.sys is built on PortCls.sys, at
least on Windows 8.1 per Device Manager. Seems like a contradiction to the
MSDN quote above, but no doubt there's a piece of this I'm not seeing.

KsStudio has been a really useful tool to study UsbAudio.sys's MIDI setup
for my device (it supports it fine, just isn't multi-client). It's not
quite as good as having a sample AVStream MIDI driver, though, if such a
thing existed.

Other related posts: