[wdmaudiodev] Fwd: Re: AVStream driver: can't register as microphone

  • From: Alexander Ivash <elderorb@xxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Fri, 24 Jun 2016 13:49:00 +0300

Big thank you for all the replies, Tim!

Unfortunately introducing topology didn't solve the issue, looks like
something else is still missing..

Could it be the case that this is because audio pin is still being
created dynamically as it used to in original avssamp?

Just in case here is my filter descriptor definition:

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

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

const
GUID
CaptureFilterCategories [CAPTURE_FILTER_CATEGORIES_COUNT] = {
    STATICGUIDOF (KSCATEGORY_CAPTURE),
   STATICGUIDOF (KSCATEGORY_AUDIO)
};

const
KSFILTER_DESCRIPTOR
CaptureFilterDescriptor = {
    &CaptureFilterDispatch,                 // Dispatch Table
    &CaptureFilterAutomation, // Automation Table
    KSFILTER_DESCRIPTOR_VERSION,            // Version
    KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING,// Flags
    &KSNAME_Filter,                         // Reference GUID
0, sizeof(KSPIN_DESCRIPTOR_EX), NULL,
    // DEFINE_KSFILTER_PIN_DESCRIPTORS (CaptureFilterPinDescriptors),
    DEFINE_KSFILTER_CATEGORIES (CaptureFilterCategories),

    DEFINE_KSFILTER_NODE_DESCRIPTORS(AudioNodes),
    DEFINE_KSFILTER_CONNECTIONS(AudioConnections),

    NULL                                    // Component ID
};



Do I understand correctly that the first step is to add
'AddInterface=%KSCATEGORY_AUDIO%' in the same way as it was done in avshws
?

Well, that does what the RunOnce call to streamci.dll does.

Also I've updated inf file to switch from RunOnce to AddInterface and
make it installable via devcon, probably I've messed something..  From
the first look it registers correctly (I can see entries in registry
and manipulate driver in graphedit, but it is still visible only in
WDM Capture Devices category), but I'm not sure I didn't mess
anything, because for some reasons I can see 9 DispatchCreate calls on
attempt to install the driver via devcon. Previous implementation (via
RunOnce) behaved differently and I believe only one DispatchCreate
call was executed as the result of installation.  Just in case, here
it is:

[Version]
Signature="$Windows NT$"
Class=MEDIA
ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318}
Provider=%ProviderName%
CatalogFile=avssamp.cat
DriverVer=09/30/2004,1.0.0.0

[SourceDisksNames]
1000 = %cdname%,,,

[SourceDisksFiles]
avssamp.sys = 1000

[ControlFlags]
ExcludeFromSelect=*

[DestinationDirs]
DefaultDestDir=12
avssamp.CopyFiles=12

[avssamp.CopyFiles]
avssamp.sys

[Manufacturer]
%ManufacturerName%=Standard,NTamd64,NTx86

[Standard.NTx86]
%avssamp.DeviceDesc%=avssamp,SW\{20698827-7099-4c4e-861A-4879D639A35F}

[Standard.NTamd64]
%avssamp.DeviceDesc%=avssamp,SW\{20698827-7099-4c4e-861A-4879D639A35F}

;-------------------------------------------------
; D D I n s t a l l
;-------------------------------------------------

[avssamp.NT]
include=ks.inf,kscaptur.inf
needs=KS.Registration,KSCAPTUR.Registration.NT
CopyFiles=avssamp.CopyFiles

;-------------------------------------------------
; interfaces
;-------------------------------------------------
[avssamp.NT.Interfaces]
AddInterface=%KSCATEGORY_CAPTURE%,"GLOBAL",CaptureInterface.NT,0
AddInterface=%KSCATEGORY_AUDIO%,"GLOBAL",CaptureInterface.NT,0

;[avssamp.Reader.Install]
;AddReg=avssamp.Reader.AddReg

[CaptureInterface.NT]
AddReg=avssamp.Reader.AddReg

;-------------------------------------------------
; add reg
;-------------------------------------------------

[avssamp.Reader.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%avssamp.Reader.FriendlyName%
HKLM,System\CurrentControlSet\Control\MediaCategories\%AudioCapturePinGUID%
HKLM,System\CurrentControlSet\Control\MediaCategories\%AudioCapturePinGUID%,Name,,%AudioCapturePinName%

;-------------------------------------------------
; services
;-------------------------------------------------

[avssamp.NT.Services]
AddService=avssamp, 0x00000002, avssamp.ServiceInstall

[avssamp.ServiceInstall]
DisplayName=%avssamp.DeviceDesc%
ServiceType=%SERVICE_KERNEL_DRIVER%
StartType=%SERVICE_DEMAND_START%
ErrorControl=%SERVICE_ERROR_NORMAL%
ServiceBinary=%12%\avssamp.sys
LoadOrderGroup=ExtendedBase

;-------------------------------------------------
; strings
;-------------------------------------------------

[Strings]
; non-localizable
RunOnce="SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"
Proxy.CLSID="{17CCA71B-ECD7-11D0-B908-00A0C9223196}"
avssamp.DeviceId="{20698827-7099-4c4e-861A-4879D639A35F}"
KSCATEGORY_CAPTURE="{65E8773D-8F56-11D0-A3B9-00A0C9223196}"
KSCATEGORY_AUDIO="{6994ad04-93ef-11d0-a3cc-00a0c9223196}"
KSSTRING_Filter="{9B365890-165F-11D0-A195-0020AFD156E4}"
AudioCapturePinGUID="{BA1184B9-1FE6-488a-AE78-6E997B02CAEA}"
AudioCapturePinName="Audio Capture"

SERVICE_KERNEL_DRIVER=1
SERVICE_DEMAND_START=3
SERVICE_ERROR_NORMAL=1
REG_EXPAND_SZ=0x00020000
REG_DWORD=0x00010001

;localizable
ProviderName="TODO-Set-Provider"
ManufacturerName="TODO-Set-Manufacturer"
avssamp.DeviceDesc="AVStream Filter-Centric Sample Driver"
avssamp.Reader.FriendlyName="avssamp Source"

cdname="Disk 1"



What is also not clear to me is how multi-Filter nature of avssamp can be
'mapped' to concept of single mic? Do I need to specify somehow that the
first instance of Filter plus the first (and only) pin is a mic? (is it
what topology serves for?)

Avssamp is not "multi-filter".  Each device instance exposes one filter.

Yes, you are right of course, I just used wrong terminology.. What I
was trying to say, is that it is possible to create as many instances
of the Filter as you like using graphedit. But virtual mic needs only
one instance of the filter... So looks like I need somehow to 'bind'
some particular instance of Filter to 'virtual mic'.. Not sure if this
makes any sense for you but I just don't know how to express my
concerns better... :)


Did you add a topology to your KSFILTER_DESCRIPTOR?  Sysaudio does not
believe you are a legitimate Windows audio device unless you have a
topology with at least one internal node.  You need to supply a simple
KSNODE_DESCRIPTOR structure and a simple KSTOPOLOGY_CONNECTION
structure  in the 8th and 9th fields of the KSFILTER_DESCRIPTOR.  The
default ones supply NULL.  It doesn't take much:

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

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

As I said previously, I've added all this, but still no luck.. What
else can be checked ?


already there?  If you didn't change the GUID (and shame on you if you
didn't), you will be in CurrentControlSet\Enum\SW\{20698827-7099-etc.

I'm ashamed and of course will change it :) Just wasn't aware this is
bad (by the way, why?).


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/

Other related posts: