[wdmaudiodev] Re: Which audio driver model?

  • From: Matt Gonzalez <matt@xxxxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 25 Sep 2008 20:27:15 -0700

Tim Roberts wrote:
Matt Gonzalez wrote:

I have developed drivers using both PortCls and AVStream.

AVStream is better for handling external hardware since it can handle surprise removal.  It sounds like your solution is software only, so that doesn't matter.

Of the two that I have used, AVStream is more flexible but harder to implement.  There aren't any good sample drivers, so it's much harder to get started, especially if you don't have any experience with audio drivers.  In addition, an AVStream audio driver has to implement quite a bit of the functionality that PortCls does for you.

Do think so?  The "simple" MSVAD sample has about 15% more lines of code than than AVStream "avssamp" sample, which implements both a video and an audio pin.

I admit that I have done a lot of AVStream and not a lot of PortCls, but I think I would have given exactly the opposite advice.  Interesting.
I can see your point of view.  Maybe I just look at it the way I do because I started with PortCls, worked with that for many years, and moved to AVStream.  I had pain and struggle with both; perhaps I am leaning toward PortCls since my pain and struggle with AVStream was more recent.

Off the top of my head, I had to add support for these features with AVStream where it just worked with PortCls:

-duplicate data ranges for DirectSound


-add my own handler for KSPROPERTY_AUDIO_POSITION

Adding volume and mute controls and MIDI is undocumented with AVStream. 

Ultimately, the important thing to keep in mind is that all these different approaches are doing the same thing, even though they use different data structures and APIs. 

For what it's worth, if I have to write another audio driver from scratch, I'll use AVStream, unless I can use WaveRT.


****************** 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: