[wdmaudiodev] Re: Stream Switching in Windows 7 breaks applications that output audio to multiple soundcards using the Windows Media Player SDK.

  • From: Larry Osterman <Larry.Osterman@xxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Thu, 29 Jan 2009 14:19:31 -0800

Btw, this was a feature that was generated by feedback from forums like this 
one and the MSDN forums - when we asked people why they needed to modify the 
default output device, changing the output device for the WMP control was very 
high on their list, so we made sure that it was possible in Windows 7.


Larry


From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Larry Osterman
Sent: Thursday, January 29, 2009 2:08 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: Stream Switching in Windows 7 breaks applications 
that output audio to multiple soundcards using the Windows Media Player SDK.

Why don't you use the new mechanism added in Windows 7 to allow an application 
to chose which audio output device is used by the WMP control?   We added this 
functionality explicitly to support applications like yours that need the 
ability to change the output device for the windows media player application.


That should allow you to finally remove all those hacks once and for all.

Look for the IWMPAudioRenderConfig::put_audioOutputDevice in the Windows 7 SDK 
for more information.



From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of John Rennemeyer
Sent: Tuesday, January 27, 2009 10:47 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Stream Switching in Windows 7 breaks applications that 
output audio to multiple soundcards using the Windows Media Player SDK.

Stream Switching in Windows 7 breaks applications that output audio to
multiple soundcards using the Windows Media Player SDK.

Because of Stream Switching, a new feature in Windows 7, developers that use
 the Windows Media Player SDK on Windows 7 and output
audio to multiple soundcards need support from the WMP SDK to explicitly set
the output device for each instance of the SDK otherwise a lot of
applications that use the WMP SDK will break. I'm posting this here to make
sure it gets seen by the right people before it is too late and Windows 7
makes to RTM with this issue still intact.

Pulled from:
https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=399755&SiteID=647

Sample application can be found at above address.

------------------------

"Description
Setting of the default playback device forces all audio from all Windows
Media Player SDK instances to play audio out the newly selected default
device other than the device that was originally set when playback was
started. We have developed a software application for computers that contain
multiple soundcards that allows the computers to output different audio
tracks to the different soundcards where the speakers attached to each
soundcard are located in different locations or are combined in a single room
to create a unique experience (other offices, meeting rooms, etc.).

In Windows XP, we were able to use the Windows Media Player 9-11 SDK to play
the sound and whatever soundcard device was set as the default playback
device (through a registry key) when the application was loaded was the audio
device that the sound came out of. In this case, we had a master application
where the users would set the files to be played on each soundcard and then
it would change the audio device, open a child application, change the audio
device to the next in the list, open another child window, etc., until all
child applications were each tied to specific soundcards and then playback
for all applications would begin.

In Windows Vista, the registry key method to set the default audio device
was removed. We developed a new method that would set the default audio
device before a file was played in the Windows Media Player 11 SDK instance.
This would force this audio file to play on the device that was set as the
default when it started playing even if the audio device was changed later.
We could then change the default audio device whenever a new track on a
different soundcard and different WMP 11 SDK instance was set to play.
Changing the default audio device would never reroute the currently playing
tracks on other audio devices to that newly set default audio device. They
stayed playing on the soundcard on which they initially played on.

In Windows 7 Beta, the Windows Vista method no longer works. We can still
set the default audio device but all the currently playing audio from all of
the Windows Media Player SDK instances are forced to the last set default
audio device even though they were playing on other audio devices
(soundcards). This means our program(s) no longer function. Our requirement
is to be able to use a single computer to output multiple audio tracks
through multiple soundcards to multiple speaker setups.

We were expecting to have all audio files being played on different
souncards, to stay on their respective soundcard even when the default audio
device is changed.

Since our program is deeply integrated with the use of the Windows Media
Player SDK, we currently see two possible solutions:

1. Revert back to the old method used by Windows Vista/Windows Media Player
11, where audio on other playback devices is not rerouted to the currently
selected default device but instead, stays on the audio device it was
initiated to play on.

2. Give us the ability in the Windows Media Player SDK to specify the output
device for the currently playing Windows Media Player instance. This way we
could specify each WMP SDK instance to output to a different audio device, we
wouldn't have to mess with setting the audio device using our old cumbersome
method, and our program would work with minimal modification.

--------------------
For solution #1, we found the Channel 9 video with Larry Osterman
(http://channel9.msdn.com/posts/Charles/Inside-Windows-7-Larry-Osterman-on-new-audio-capabilities/)
describing a new feature called "StreamSwitching". We assume this is what is
forcing the audio from all soundcards to be played out of the last set
default audio device. If this is the case, our assumption is that it will
break a lot of software that depends on being able to set the audio device in
the way that we do. He mentions in the video that they won't switch the audio
from the current audio device if the "player" specifies a specific audio
device. This brings us to Solution #2 which would be the ultimate solution.
We could set each instance to the specified device the user wants it to play
to and the "StreamSwitching" would still work in other cases where the audio
device is not specified.

From http://msdn.microsoft.com/en-us/library/aa385268(VS.85).aspx, it states
the following about the Windows Media Player ActiveX control on Windows
Vista: "By default, the Player control uses the audio device designated as
eMultimedia. The audio output device cannot be changed programmatically." Our
desperate need is for it to say: "By default, the Player control uses the
audio device designated as eMultimedia. The audio output device can be
changed programmatically to the required audio device."
Comments
1 comment | post a comment to Microsoft
I noticed the status was changed to "Resolved (External)". I'm unclear of
what this means. Does this mean that this has been passed to the appropriate
team (WMP or Audio or some other team) and that it will still be looked into?
Any additional information about how I can track the status of this issue
would be appreciated.

Thank you,

John
Posted by johnren on 1/18/2009 at 9:27 AM
Repro Steps
We were running our custom software application for a large number of
clients that was developed using the Windows Media Player SDK. It outputs
multiple audio files to specified soundcards when the users systems have more
than once soundcard (haunted houses are one of the major users). It works on
Windows Vista but on Windows 7, when changing the audio device to force the
audio file to play to (setting the device before actually playing the audio
file forces the audio to stay on that audio device even if the default audio
device is changed while it an audio file was playing on a different
soundcard), it outputs all audio for all Windows Media Player SDK instances
to the last set default audio device. This makes our program unusable on
Windows 7. We have created a simple sample application that shows this issue
which we will be attaching to our feedback report.

To reproduce the issue with the attached MultipleAudioDevicesSample.zip
file, please do the following on both Windows Vista and Windows 7.

You will need at least 2 soundcards and 2 speaker setups to be able to
reproduce this.

1. Extract the zip file to a temporary folder.
2. Run the MultipleAudioDeviceSample.exe file in the extracted folder.
3. There will be two instance of the Windows Media Player in this sample
application.
4. Click "Choose Audio File" on each instance and choose a different audio
file for each.
5. Select a different soundcard for each instance.
6. Hit Play/Pause on the first instance. Once you see it start playing, Hit
Play/Pause on the second instance.
7. On Vista, each soundcard should output the different track to the audio
device/speakers you selected for each instance.
8. On Windows 7, only the speaker/audio device selected in the last instance
will have audio playing and it will be the audio of both files played by both
instances of the WMP SDK."

------------------------

Any help on getting this resolved either through the WDM Audio team or the 
Windows Media Player SDK team would be appreciated.

Thank you,

John
________________________________
Hotmail(r) goes where you go. On a PC, on the Web, on your phone. See 
how.<http://www.windowslive-hotmail.com/learnmore/versatility.aspx#mobile?ocid=TXT_TAGHM_WL_HM_versatility_121208>

Other related posts: