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

  • From: "Who Cares" <universalkludge@xxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 30 Mar 2006 21:52:24 +0000

A kludgy way to do it (did not try it yet):

- request a device instance id by sending IRP_MJ_PNP/IRP_MN_QUERY_ID(BusQueryInstanceID)
- enumerate HKLM\..\MMDevices\Render sub-keys that are endpoint guids
- find your endpoint by matching your device instance id against an instance id located under EndpointGuid\Properties key
- change the DEVPKEY_DeviceInterface_FriendlyName string to whatever you need


Regards
Andrew




From: Kenny Ong <fluffy_ko@xxxxxxxxx>
Reply-To: wdmaudiodev@xxxxxxxxxxxxx
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer, midi or wave device name?
Date: Wed, 29 Mar 2006 22:13:06 -0800 (PST)


Hi Andrew.

  Correct me if i'm wrong...

The registry key ("HKLM\SOFTWARE\...\MMDevices\Audio\Render\SomeGuid\Properties\DEVPKEY_DeviceInterface_FriendlyName") that you mentioned does not come from the KSPROPERTY_GENERAL_COMPONENTID, but rather is another registry value that the Vista created after installing a audio device. And without doubt, the friendly name written is actually grabbed from the "DeviceDesc" located in the "HKLM\System\CurrentControlSet\Enum\PCI\...".

Hi Richard,
Any comments on the KSPROPERTY_GENERAL_COMPONENTID support in Vista? If the approach to overwrite friendlyname is via the "..\MMDevices" than "..\MediaCategories", then what is the best recommended way to do it, and exactly at which instant should the values be overwritten?



Thanks! Kenny.

Who Cares <universalkludge@xxxxxxxxxxx> wrote:
  So what?s the recommended way to specify an audio device friendly name
dynamically (in my case obtained from the low-end connection) on Vista?


>From: "Richard Fricks"
>Reply-To: wdmaudiodev@xxxxxxxxxxxxx
>To:
>Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer, midi or
>wave device name?
>Date: Wed, 29 Mar 2006 09:58:49 -0800
>
>Looks like the path has changed for Vista. The WDK still states:
>
>"WDMAud uses the Name GUID in the KSCOMPONENTID structure to look up a
>"Name" key in the registry. This key is located under the registry path
>name HKLM\System\CurrentControlSet\Control\MediaCategories."
>
>So, I'll need to make sure we get this documented correctly.
>
>Thanks for pointing this out.
>
>-Richard
>
>
>-----Original Message-----
>From: wdmaudiodev-bounce@xxxxxxxxxxxxx
>[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Who Cares
>Sent: Wednesday, March 29, 2006 9:46 AM
>To: wdmaudiodev@xxxxxxxxxxxxx
>Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer, midi
>or wave device name?
>
>Sorry, forgot to specify, that's 5344
>
>Regards
>Andrew
>
>
> >From: "Richard Fricks"
> >Reply-To: wdmaudiodev@xxxxxxxxxxxxx
> >To:
> >Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer, midi
>or
> >wave device name?
> >Date: Wed, 29 Mar 2006 09:35:46 -0800
> >
> >My comments were directed at XP. Is this the platform you noticed the
> >below behavior on?
> >
> >Thanks,
> >-Rich
> >
> >-----Original Message-----
> >From: wdmaudiodev-bounce@xxxxxxxxxxxxx
> >[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Who Cares
> >Sent: Wednesday, March 29, 2006 8:59 AM
> >To: wdmaudiodev@xxxxxxxxxxxxx
> >Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer, midi
> >or wave device name?
> >
> >Hi Richard,
> >
> >I implemented this stuff you described here in great details, but it
> >does
> >not to seem to work as expected - in the "Audio devices" applet I still
> >don't see the friendly name I specified. So I made some experiments w/
> >the
> >USB stereo device. It appears to be that the
> >HKLM\System\CurrentControlSet\Control\MediaCategories\\Name
> >value
> >is not queried at all - I checked it with the regmon. And I found out
> >that a
> >friendly name for the "Audio devices" applet is obtained from the
> >HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render\S
>o
> >meGuid\Properties\DEVPKEY_DeviceInterface_FriendlyName
> >value - I have changed it there, it got changed in the "Audio devices"
> >applet.
> >
> >Any clarifications?
> >
> >TIA
> >
> >Andrew
> >
> >
> >
> > >From: "Richard Fricks"
> > >Reply-To: wdmaudiodev@xxxxxxxxxxxxx
> > >To:
> > >Subject: [wdmaudiodev] Re: How to bind a symbolic link to a mixer,
>midi
> >or
> > >wave device name?
> > >Date: Thu, 9 Feb 2006 09:11:55 -0800
> > >
> > >
> > >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\>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-4
> >2
> > >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/
>
>******************
>
>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/




--------------------------------- Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.


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

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: