How does my existing app change the master volume on Vista?
After I posted the "How do I set the master volume in Vista", DanT commented:
Thanks Larry. I'll have to send a link to this to the people at Griffin so they can fix my PowerMate. I loved this volume knob on XP. On Vista it only changes the volume for itself which is somewhat less than useful.
It turns out that we expected that this would be a common issue for our customers, so we built a mechanism into Vista to allow legacy applications to control the hardware using the old mixer APIs (I hinted about this in my original volume posts, but at the time we'd not finalized our plans, so I couldn't comment any more about it).
On Vista, the mixer APIs detect if your application is running in XP compatibility mode, and if your application is running in XP mode, it disables the virtualized mixer and instead allows the application to directly interact with the hardware.
Now this won't work for all applications (the XP mixer used to lie about the capabilities of the hardware (for instance it would create a fake volume control for audio hardware that didn't have a hardware volume control (like my laptop)), the Vista mixer won't lie), but it can be used to get existing applications (like the PowerMate application listed above) working on Vista.
Comments
Anonymous
March 07, 2007
How would I do the same if I wanted to control my app's volume control. Particularly if I'd like a UI element inside my app to reflect changes in Vista's Mixer UI.Anonymous
March 07, 2007
The comment has been removedAnonymous
March 08, 2007
By default, the mixer APIs in Vista are per-application. So if you don't do anything, you're controlling your per-application volume. This is for those relatively few control panel type applications that really MUST control the master volumeAnonymous
March 08, 2007
On a completely un-related note, how do you feel about being a Hagrid look-a-like :-) http://blogs.msdn.com/danielfe/archive/2007/02/26/microsoft-bloggers-the-movie.aspxAnonymous
March 08, 2007
Excellent news, this means that the pesky Realplayer finally has met its foe. Windows Media Player, Winamp etc. are all good citizens on my XP, changing only their own volume and leaving the master volume as it is. Except for Realplayer. Slide the volume down, and it slides the master volume down. But with some luck not on Vista! Rgrds HenryAnonymous
March 08, 2007
Henry, apps like Real Player are exactly the reason we chose to shim the mixer APIs.Anonymous
March 08, 2007
Is "XP compatibility mode" the application compatibility settings, or just the lack of the Vista aware manifest items? My apps sole use is to change the master volume (it docks to the side of my car PCs touchscreen)Anonymous
March 08, 2007
The problem, of course, being that apparantly it's now easier to mess up the entire system, and therefore RealPlayer will get code along the lines of this: if( UsingVista() ) messUpWithLessEffort(); else messUpWithLotsOfEffort(); Either that or the RealPlayer authors were just not smart enough to realise there was a problem, and they'll be happy that Vista protects them from themselves. What's up with optimists? Are they delusional, or just deficient? :)Anonymous
March 09, 2007
Dean, it's the application compatibility settings - go to the exe, click "Compatibility", select For Windows XP.Anonymous
March 14, 2007
If you want to control the volume of your own app in Windows Vista, do you have to use the old mixer API (shudder)? Or is there a new and easier way to do it?Anonymous
March 14, 2007
J. Edward: There's always waveOutSetVolume and waveOutGetVolume :) There's also a new easier way, but it's not that much easier, I'll discuss that in a post soon (maybe tomorrow).Anonymous
March 21, 2007
Will this XP compatibility mode allow me to somehow set the default playback device? On my Vista HTPC which I've had to resort to automating registry changes when I launch Media Center. I'd really like Media Center (and zoomplayer) to use my spdif connection automatically while other apps (ie IE7) should still use my computer speakers/headphones. I understand the Vista Audio Stack was built to support this, but the functionality was removed from the control panel in a RC release of Vista.Anonymous
March 21, 2007
Shawn, no, we've NEVER supported 3rd party apps changing the default playback device.Anonymous
March 21, 2007
Ok I didn't know that. My problem is that the concept of playback device changed from acutal physical device (ie soundblaster 16) to end point connection (ie speakers or spdif) now ... correct? In XP i could use send audio to my spdif and headphone jack, but in Vista I have to choose one. Is there anyway to get this functionality back?Anonymous
March 27, 2007
My problem is similar to Shawn's. My requirements are simple: Send the output from Windows Media Player to a USB device that broadcasts audio wirelessly, and send the output from everything else to the desktop speakers. With XP, I had no problem with this. With Vista, I have found no way to accomplish that.