[wdmaudiodev] Re: AVStream virtual mic: why could external application 'reset' volume level to 100%?

  • From: "Matthew van Eerde" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "Matthew.van.Eerde" for DMARC)
  • To: Alexander Ivash <elderorb@xxxxxxxxx>, "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Fri, 12 Aug 2016 15:46:12 +0000

If you want Windows (and apps) to manipulate the volume by talking to your 
driver, you need to update your topology to have a KSNODETYPE_VOLUME node which 
supports the KSPROPERTY_AUDIO_VOLUMELEVEL property.



The simplest such topology looks like this:



Microphone pin factory --> volume node --> streaming pin factory



The microphone factory represents the connection to the (fake) physical 
microphone. Windows will use the KSPIN_DESCRIPTOR.Category field to decide 
whether this is a microphone, a line in, etc.



The streaming pin factory represents the connection to Windows. Windows will 
query format support on this pin factory, call KsCreatePin here, and submit 
streaming IRPs.



Things in between (nodes) represent stuff that happens between the (fake) 
physical microphone and Windows. Volume is one such thing. You could also stick 
a mute node here, an automatic gain control, or all kinds of other things.



From: Alexander Ivash<mailto:elderorb@xxxxxxxxx>
Sent: Friday, August 12, 2016 4:59 AM
To: wdmaudiodev@xxxxxxxxxxxxx<mailto:wdmaudiodev@xxxxxxxxxxxxx>
Subject: [wdmaudiodev] Re: AVStream virtual mic: why could external application 
'reset' volume level to 100%?



Based on msdn, there is no such a node like
'KSPROPERTY_AUDIO_VOLUMELEVEL', did you mean
'KSPROPERTY_AUDIO_VOLUMELEVEL' property for 'KSNODETYPE_VOLUME' node?
If yes, do I understand correctly that I have to specify such a node,
adjust topology to make data flow through this node and implement
handler for 'KSPROPERTY_AUDIO_VOLUMELEVEL' ?

If all the above is true, I'n not sure how to achieve it with my
current structure / topology..

At the moment my filter has one input pin and one output, input pin is
not used, it is declared as 'bridged' just to make sysaudio happy and
allow driver to be visible as a mic. The actual data is being inside
'Process' function of output pin.

And topology is as simple as the following:

const
KSNODE_DESCRIPTOR AudioNodes[] =
{
DEFINE_NODE_DESCRIPTOR(NULL, &KSNODETYPE_ADC, NULL),
};

const
KSTOPOLOGY_CONNECTION AudioConnections[] =
{ //--FromNode-------FromPin----ToNode---------ToPin
{ KSFILTER_NODE,    1,      0,              0 },
{ 0,                1,      KSFILTER_NODE,  0 }
};

Pin 0 - is real output pin
Pin 1 - is not used bridged pin

Not sure what is the right place to insert 'KSNODETYPE_VOLUME' node
into such a topology... I feel like I should introduce additional
'real' input PIN (or just changed 'bridged' to real), move population
of data from 'output' to 'input' and introduce 'KSNODETYPE_VOLUME' in
between 'output' and 'input'. Does it makes any sense? Or I can just
implement 'KSPROPERTY_AUDIO_VOLUMELEVEL' for my output pin? Based on
my understanding it will not help because docs say:

'The KSPROPERTY_AUDIO_VOLUMELEVEL property specifies the volume level
of a channel in a volume node (KSNODETYPE_VOLUME)'

... but hopefully I'm wrong..

2016-08-12 1:19 GMT+03:00 Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>:

Windows offers an API to applications to change the endpoint volume.



If the driver offers a KSPROPERTY_AUDIO_VOLUMELEVEL node, the API will be
connected to this node.



If the driver does not, Windows will insert a software volume APO.



https://msdn.microsoft.com/en-us/library/windows/hardware/ff536251(v=vs.85).aspx



From: Alexander Ivash
Sent: Thursday, August 11, 2016 3:18 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] AVStream virtual mic: why could external application
'reset' volume level to 100%?



For some reasons it happens with virtual mic, but everything looks
fine with real one, what could be the difference?

Another observation, real mic's volume level changes from "+40dB" to
"+60dB" in Win10, while virtual mic changes from "0" to "100". Is it
because I didn't specify 'volume' node in topology or something like
this?

Regards, Alexander
******************

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: