WDM Audio - Friendly Name for Speakers (KSPROPERTY_PIN_NAME on KSNODETYPE_SPEAKER pin)

Hello!

I’m new to driver development and I’m working on a project for a “Virtual audio cable” that’s based on AudioMirror, which appears to be a hobby project that started with the SYSVAD sample and adapted it into a virtual audio cable. AudioMirror does work as advertised (and does crash sometimes as advertised).

However, my question is about assigning friendly names to the virtual devices. I found this article which explains it very well.
https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/friendly-names-for-audio-endpoint-devices

I was able to follow these instructions to successfully set a friendly name on the virtual microphone device, but my attempts to set the friendly name for the speaker have been unsuccessful.

I’ve defined the friendly names in the INF with GUIDs

[PinNameRegistration]
HKR,%MediaCategories%\%GUID.Mic%,Name,,%Name.Mic%
HKR,%MediaCategories%\%GUID.Speaker%,Name,,%Name.Speaker%

[Strings]
GUID.Mic = "{ccc61975-19db-497a-9e35-479fc2fd1a94}"
GUID.Speaker= "{85e036af-6224-4631-a03a-39b37dfd37a9}"

Name.Mic= "My Virtual Mic"
Name.Speaker = "My Virtual Cable"

And then I updated the code to set the name GUIDs:

For the mic (which works) https://github.com/JannesP/AudioMirror/blob/master/AudioMirror/MicrophoneTopologyPropertiesh.h#L42
For the speaker (doesn’t work) https://github.com/JannesP/AudioMirror/blob/master/AudioMirror/SpeakerTopologyProperties.h#L78

Does the problem have to do with how the pin connections are created? From the docs it sounds like setting the name on the pin which has category of KSNODETYPE_SPEAKER should work.

Thank You!
David

Believe it or not, this is by design. Windows will ignore any friendly name customization for audio endpoints that have a KSPIN_DESCRIPTOR Category that looks like speakers. My guess is there is some backwards compatibility issue involved. Windows has quite a number of ill-advised bastardizations that were created to cater to a poorly-designed user app.

Having said that, as a USER you can go in and change those names in the Control Panel. As a hacker, you could make that change and then go figure out which registry entries got modified, and embed code to make those changes yourself. You would go to hell, of course.

Thanks Tim! If my driver has two speakers, is there any way I could make them distinguishable? Right now I have something like: “Speakers (My Device)” “Speakers (My Device)” Do you know if there’s any best practice for this? Should things be rearranged such that the device name in parentheses is different for each speaker?