setting volume from driver

Hi,
Is there anyway I can set volume or mute the system from my driver. My driver is for driver USB device. My driver gets data from device which includes system audio settings. I need to write that setting to some where so that the application which puts these settings to system volume control uses it.
How can I do that

xxxxx@yahoo.com wrote:

Is there anyway I can set volume or mute the system from my driver. My driver is for driver USB device. My driver gets data from device which includes system audio settings. I need to write that setting to some where so that the application which puts these settings to system volume control uses it.
How can I do that

So, are you doing some kind of remote control application, where you are
sending system state via USB, and duplicating that state on another system?

You will need to do this as you describe: send the information to a
user-mode app, and control the volume from user mode. The best model
for that is usually the “inverted call”, where the application sends a
request to the driver and waits forever for the driver to complete it,


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

You can expose your device as a HID which reports a consumer page with volume usages (up, down, mute, etc) on it. You can simulate presses of these “keys” and the OS will automatically pick the new settings. This is how the volume buttons on a usb connected speaker works.

You can get the HID stuff working in 2 ways.

First, enumerate as a composite device. one function is the HID stuff, the other function is your other functionality in the device. the std hid stack will load and your hardware will generate raw HID data for the stack to report.

Second is to enumerate the hid part in software. Your FDO enumerates a PDO. On top of this new PDO you load a custom HID miniport (which you can use KMDF to write in which case it is not really a HID miniport). This custom hid miniport gets data from your FDO and reports HID data as determined by your driver. Being a bus driver is also much easier in KMDF, consider it if you are not already using it to begin with.

#1 is by far the simplest thing to do from a software POV. If your hardware has already shipped, #2 is probably the only option. I can expand on the KMDF HID “miniport” functionality if you want.

With that said, generating volume changes from the driver w/out the user taking action is a pretty horrible user experience. Random pieces of software changing my volume w/out my knowing what is going on would be aggravating at a minimum.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Thursday, October 16, 2008 3:14 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] setting volume from driver

Hi,
Is there anyway I can set volume or mute the system from my driver. My driver is for driver USB device. My driver gets data from device which includes system audio settings. I need to write that setting to some where so that the application which puts these settings to system volume control uses it.
How can I do that


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi Tim,
Yes, one of the application in my device is just wat you mentioned.
I can do what exactly you said, pending request and completing it when i have the data and than allow application to do sound settings.
But my requirment is i need to do this before i hear windows machine start up sound if device is already connected to machine. and other way also, meaning i need to transfer audio settings to deviceand i need to do that before my application comes up in windows

Note that for the HID route I just mentioned, HID usages are not processed until a user logs in. that means that the logon sound will not be affected by your mute via HID. This has been changed for the next windows release (Windows 7) though and HID usages are evaluated at the logon screen, although I don’t know how early they are evaluated. The machine start up sound may be too early.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Thursday, October 16, 2008 3:45 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] setting volume from driver

Hi Tim,
Yes, one of the application in my device is just wat you mentioned.
I can do what exactly you said, pending request and completing it when i have the data and than allow application to do sound settings.
But my requirment is i need to do this before i hear windows machine start up sound if device is already connected to machine. and other way also, meaning i need to transfer audio settings to deviceand i need to do that before my application comes up in windows


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi Doron,
Thanks for 2 quick replies. I have lot of information now. Let me do a prototype of the first solution you said and see the behaviour.