[wdmaudiodev] Re: How to bind a symbolic link to a mixer, mid i or wave device name?

  • From: Yann Hamiaux <YHamiaux@xxxxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Wed, 22 Feb 2006 17:30:26 -0500

Hi Rich,

Sorry for this long delay before my reply, I've been busy with other stuff.

I took a look to KS Studio. Btw, I notice one bug under
KSCATEGORY_AUDIO_DEVICE Filter, when you instanciate a filter and look for
info under KSPROPSETID_Sysaudio, all the info belong to the first device
listed under KSCATEGORY_AUDIO_DEVICE instead of the proper device. In fact,
the structure required for this category required an additionnal parameter
ULONG to the structure KSPROPERTY in order to specify the device index
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/Audio_r/hh
/Audio_r/aud-prop_2e825138-0b97-41a7-a986-1b562bcef1ec.xml.asp).

Ok, that's for the note about KS Studio...

I did my own code to validate the parameters (in case the values in KS
Studio) present in other category wrong values.

I look to the KSPROPERTY_GENERAL_COMPONENTID for my 2 following devices:

device 1: \\?\usb#vid_06f8&pid_b100&mi_01#6&18ef8c&0&0001#...\global
device 2: \\?\usb#vid_06f8&pid_b100&mi_01#6&28fa08ee&0&0001#...\global

And they both report this structure filled with these values:
Manufacturer: 4E1CF3CA-1679-463B-A72F-A5BF64C86EBA
Product     : ABCD0B5E-C263-463B-A72F-A5BF64C86EBA
Component   : 8F1275F0-26E9-4264-BA4D-39FFF01D94AA
Name        : FC575740-DF08-463D-A72F-A5BF64C86EBA
Version     : 0x00000001
Revision    : 0x00000000

(FYI: got the same result in KS Studio too)

I did not check the corresponding value for each GUID, but since they are
the same for both... I know that I won't get the name found in Windows where
in the audio mixer I can see "Hercules DJ Console Mk2" and "Hercules DJ
Console Mk2 (2)".

I start looking to how these values could be reported and found that
winmm.dll seem to retrieve the name during a call made to the function
mixerGetNumDevs(). I wonder if it's not winmm.dll that add this suffixe "
(2)"!!! It does enumerate all the devices, which seem to call some setupDi
and KSPROPERTY... however, I still don't know how he could decided which one
is #1 and which one is #2. It could be base on the physical port, on the
order in which device are installed?

More info. would be appreciate!
regards,
yann


-----Original Message-----
From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx]On Behalf Of Richard Fricks
Sent: February 9, 2006 2:18 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer, midi
or wave device name?


USBAudio.sys does support KSPROPERTY_GENERAL_COMPONENTID, but it
requires that the USBAudio device itself include the necessary string
information in its descriptor. This will be the string that will go into
the registry and USBAudio will reference in this property call.

-Rich


-----Original Message-----
From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Yann Hamiaux
Sent: Thursday, February 09, 2006 10:53 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer, midi
or wave device name?

Hi Richard,

Okay, I will be more specific about my problem. Our device contain some
vendor specific drivers (ASIO, Midi and HID filters) and some not (we do
use
usbaudio.sys without any filter drivers). I am developping a library
that
will provide Get and Set to access some vendor specific command through
our
drivers. This library got functions where you can access multiple
devices
(even those with same VID and PID), but I am just providing extra
functionnalities to the various Windows API (DirectSound, WaveIn,
WaveOut,
Mixer, ...).

I think that the .INF solution you point me out would change the name of
all
devices that has same VID and PID. For the driver solution, talking with
the
driver developper, he told me that this would required change in the
usbaudio.sys or filter driver beeing install (on usbaudio.sys)?


yann,


-----Original Message-----
From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx]On Behalf Of Richard Fricks
Sent: February 9, 2006 12:12 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer, midi
or wave device name?



Windows XP and following supports the property
KSPROPERTY_GENERAL_COMPONENTID. This allows audio devices to uniquely
identify themselves by controlling the value of their friendly name. The
basic idea is that you write your unique friendly name to the registry:
HKLM\System\CurrentControlSet\Control\MediaCategories\<NAME GUID>\Name =
"your unique device name".

This value can bet set in your devices INF file using a statement like
[xxxxx.AddReg]
HKLM,"SYSTEM\CurrentControlSet\Control\MediaCategories\{946A7B1A-EBBC-42
2a-A81F-F07C8D40D3B4}",Name,,"My unique device name"

Or you can write this registry value when your driver loads in its
initialization routine. Note that the guid above needs to be unique -
run guidgen.exe to create one.

You then implement support for the KSPROPERTY_GENERAL_COMPONENTID
property in your driver. KS.H includes a macro
DEFINE_KSPROPERTY_ITEM_GENERAL_COMPONENTID that you can use to help
define this. The audio system will use the Name GUID you return in the
KSCOMPONENTID structure to look up a "Name" key in the registry. For
this example, the guid you would return from this property call would be
"{946A7B1A-EBBC-422a-A81F-F07C8D40D3B4}".

This should address the issue of how to get your device to uniquely
identify itself. If the above isn't working or is but still doesn't
address the issue let me know as I would like to understand why.

Thanks,
Richard Fricks
Technical Lead, Microsoft DDK


-----Original Message-----
From: wdmaudiodev-bounce@xxxxxxxxxxxxx
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of uwe kirst
Sent: Thursday, February 09, 2006 8:30 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer, midi
or wave device name?

Yann Hamiaux wrote:

>So far, I've been able to enumerate all MIDI symbolic link and get
their
>friendly name. However, when I have 2 devices with the same VID and
PID, the
>friendly name is exactly the same. While when I look to the list mixer
name
>they do have a different name "Mixer Device" and "Mixer Device (2)". 
>
Thats probably the situation under XP -> the instance id is added by 
windows atomatically.
Under Vista the instance id is missing (thats at least my experiance).
I tried to add it within my driver, but I found no reliable way of doing

so. If you have two physical identical devices and you install them
one after each other while the other is not powererd, they will get the 
same name. If you now power them both, they will have the same name, 
because the name is set during install not during driver load.
I personally would prefer to add the unique id owned by the device to 
the friendly name, but this seem to be impossible because the names are 
added during install by the .inf file. If no other idea comes to my mind

I think I will try to add a random (unique) name by my driver rather by 
.inf file. Maybee that will help?

>So far,
>I deal with some SetupDi... functions to enumerate all devices in a
>category. I also, kind of reverse-engineer the GUID I need for the
>enumeration by looking to the registry under
>"Local_Machine\System\CurrentControlSet\Control\DeviceClasses\". Maybe
there
>is a .h file I should look to have a proper list of these GUID?
>
>  
>
I was told that you generate these GUIDs by yourself with guigen. They 
are added during installation by the .inf file. The header file only 
cointains some predefined (by microsoft) device types.
Uwe

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

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

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

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: