Changing default speaker configuration on Vista

i am preparing application to test sound at different speaker configuration for windows vista and windows XP.

for doing this i am using API SetSpeakerConfig() to set the different configuration and API GetSpeakerConfig()

for getting same configuration. this is working fine in Windows XP. but not in Windows Vista.

The call to SetSpeakerConfig() succeeds, but doesn't actually change anything.

Is there any way other than by using the Sound control panel.

[1210 byte] By [anisk] at [2008-2-13]
# 1

IDirectSound::SetSpeakerConfig is a no-op on Vista. There is no longer a public method for setting the speaker config.

Regards,

Mitch Rundle

Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.

MitchRundle at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Vista Pro-Audio Application Development...
# 2

Also there no Interface in Audio Core APIs ...

SO, do we need to wait for new SDK release ?

anisk at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Vista Pro-Audio Application Development...
# 3

Hi Mitch,

Base on what you told on Forums, it doesn't seem possible to change the speaker configuration. I read the reason why you decided to do so, and even if I found it not convenient, I do respect your decision.

However, this morning, I found out on a sound card that inside their own Control Panel they do change the speaker configuration and it did reflect in Vista. So, it's either there is an API call for that or they found a way to hack it.

Now, a question can be asked... if application start to do some kind of hack to do it, would it be preferable to provide a nice and clean way to do this task?

a) We are trying to found a compromise.
b) No, we don't bother.
c) We might change it so application will need a Tougher - Hack v2.
d) There is a way to, and it's probably what they use, but you need an authorization of some sort to get access to it.
e) No more information or post will be answered on that topic, since everything official has been said.

My guess will be answer E...

Have a nice day,
Yann

YHamiaux at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Vista Pro-Audio Application Development...
# 4

There are ways to do this if you own the driver but it causes devices to be invalidated. e.g. if you are playing something and you change the speaker config, the playback will error out and need to be restarted. Are you seeing something like that?

Mitch

MitchRundle at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Vista Pro-Audio Application Development...
# 5

Ok, in our case we do own the driver. However, I don't see how my control panel can switch the speaker configuration. At least, I didn't see any function on the Core Audio API. And talking with the driver developper, we need to set it to a higher level (a windows API).

You are saying that there is more than one way to do so. How can my control panel switch the speaker configuration of an audio device? Is it a private property of an interface?

YHamiaux at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Vista Pro-Audio Application Development...
# 6


Sorry I did edit my reply after sending it and I believe that the notification work only base on reply (not on edit).

My question is How to change the speaker configuration, if the DirectSound SetSpeakerConfig is a no-op and I don't see any calls in the Core Audio to set this setting!?

Regards,
Yann

YHamiaux at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Vista Pro-Audio Application Development...
# 7


Hi Mitch,

Okay, I found a way to set the speaker configuration. However, it's not that clean... Here is the step required...

1. Found the right DeviceTopology which corresponds to our wave device which contain the IAudioChannelConfig node.
2. Do a SetChannelConfig()

At this point, the driver did get the Set to change the speaker configuration.

3. Enumerate the keys under: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Render
and test if it's corresponds to our device base on the information in the subkey "\Properties".
4. Write a DWORD value which corresponds to the Channel Config send at #2 in "{1da5d803-d492-4edd-8c23-e0c0ffee7f0e},3" and "{1da5d803-d492-4edd-8c23-e0c0ffee7f0e},6".
5. Change the binary values for "{f19f064d-082c-4e27-bc73-6882a1bb8e4c},0" which seem to contain a WAVEFORMATEXTENSIBLE binary data for 16-bit audio.
6. Change the binary values for "{e4870e26-3cc5-4cd2-ba46-ca0a9a70ed04},0" which seem to be for 32-bit audio.

Now, by doing so... the Vista Sound Control Panel is reflecting the change that we did by calling SetChannelConfig(). Otherwise, with only step 1 and 2, the sound card could be in stereo while the Vista CPL will show 4 channels and the audio test will be playing only on the first 2 channels.

What we seen at the driver level is the Vista CPL does seem to query the speaker configuration and the driver did response 2 channels, but if the step 3 to 6 is not done, it will still show a false information to the user. This is with Vista Build 6000.

So, here is my question...

Is it the best way to set the speaker configuration in Vista if we want our change beeing reflected in Vista Sound CPL?


Best Regards,
Yann

YHamiaux at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Vista Pro-Audio Application Development...
# 8

Although I have always appreciated the Windows operating system and the involved developers, I think that the audio development team for the Vista operating system should be simply banned from any other development inside the Microsoft Corp.

Broking the compatibility with the past, without giving a way to wrap older functionalities into new ones or at least giving a decent documentation about the new audio architecture (the MSDN documentation about the new audio architecture is simply inadequate and sometimes with typo errors), should be avoided by any professional developer: they probably don't know, but many companies are actually loosing money for this kind of choices, the same companies that allowed Microsoft to grow.

Without regards

Severino

severino at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Vista Pro-Audio Application Development...
# 9
In windows SDK 6000 release at 2006-11, I find some properties in Core Audio API, such as
PKEY_AudioEndpoint_FormFactor, PKEY_AudioEndpoint_PhysicalSpeakers and other two properties and using IPropertyStore->GetValue(), and only PKEY_AudioEndpoint_FormFactor returns exact result VT_U14 with value Speakers, SPDIF, but other three return VT_EMPTY.
I am so confused about it.
MyWendell at 2007-9-5 > top of Msdn Tech,Software Development for Windows Vista,Vista Pro-Audio Application Development...

Software Development for Windows Vista

Site Classified