Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


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

dfindleydfindley Member Posts: 2

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

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,317
    edited May 2

    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.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • dfindleydfindley Member Posts: 2
    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?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 12 September 2022 Live, Online
Internals & Software Drivers 23 October 2022 Live, Online
Kernel Debugging 14 November 2022 Live, Online
Developing Minifilters 5 December 2022 Live, Online