[wdmaudiodev] Re: newbie questions about filter drivers

  • From: dprado@xxxxxxxxxxxxxx
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 14 Oct 2004 15:54:08 -0300

First of all thank you for the reply.  I´ll explain what I need , a little
better. I have a third party application ( that cannot be changed ) , and this
application aallows me to configure two different audio output devices, that it
uses simultaneously, writing different PCM data to each of them. I have a USB
audio hardware that has obviously left and write channels. I want to configure
this application to use two "different" audio devices that actually are virtual
sound devices, one of them writes only to left channel of the real usb audio
hardware and the other to the right channel of the real usb audio hardware.
That way since I do not need stereo sound, I can use ONE hardware and the
application believes it is writing to two differente devices. 
I know this would be much easier to do in user mode. But the application is
already written and I have no control over it.

> That's a rather strange request.  If you're trying to do this to support 
> an application, it would be better to do this kind of thing in user 
> mode, either in the application code, or in a DShow filter graph.
> 
> To do this as you have described it, you need to have two audio devices 
> created.  You could conceivably write a lower filter to usbaudio.sys 
> that creates two separate PDOs.  As filter drivers go, a usbaudio.sys 
> filter is one of the easier choices, but that all changes when you have 
> to touch the streaming data.  You will need to intercept both of the 
> streaming endpoints and mix the two.  This is going to be very 
> complicated.  How are you going to manage synchronization?  You won't be 
> getting the two streams at the same time, of course.
> 
> What's the real purpose here?
see above
> >Would I be better off trying a rewrite of usbaudio.sys?
> >  
> >
> 
> Good lord, no.  There are 10 years of development and debugging in 
> usbaudio.sys.
thank you for warning me, I told you I was totally lost.
> >Is it easy or even possible to do
> >some minimal audio filtering using a filter ( in the sense of IRP filtering
> )
> >driver ( changing data before and then forwarding an IRP )?
> >  
> >
> 
> Well, when you are a lower filter to usbaudio.sys, you're actually 
> manipulating URBs, not IRPs.  (OK, URBs are all contained in IRPs, but 
> that's not the point).  Yes, it is certainly possible to filter audio 
> data that way.  I've done three products where the hardware was not 
> quite USB Audio-Class compliant, and in each case I was able to write a 
> relatively simple lower filter to usbaudio.sys that manipulated the 
> configuration descriptors and intercepted the control interface requests 
> so that they looked compliant.  Worked great, and even passed WHQL.
> 
> However, neither of those had to touch the streaming interface: I just 
> passed them through (after changing the interface number).  What you're 
> talking about is not "minimal audio filtering".  You're talking about 
> buffering, synchronizing, and mixing.  That's a whole lot of work.
from what I understand a lower filter will not work, how can the lower filter
know which "virtual device" the user application used? The main point is to
have two different virtual audio devices that the application believes it is
talking to.
> >As you can see I am totally lost, any info in this subject will be greatly
> >appreciated.
> >  
> >
> 
> As always here, what you should do is tell us what you actually want to 
> do, NOT how you think you need to do it.  Give us the real use case, and 
> we can probably offer some do-able suggestions.
Thanks for the tips, I tried to explain a little better above, what I need to
do.


Dimitri Prado


******************

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.de/

Other related posts: