[wdmaudiodev] Re: Retrieving WAVEFORMATEX from IAudioSessionControl

  • From: Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Wed, 17 Dec 2014 18:08:03 +0000

It’s too late to do any kind of stream-intelligent upmixing in a render GFX, 
MFX or EFX. Everything’s already been channel-converted and mixed together by 
the time it gets to you. If you want to do intelligent channel matrixing per 
stream, you need an SFX.

Render SFXes (and only render SFXes) can support multiple input formats, even 
with differing channel counts. So on a 5.1 output you can do:

1.       2.0 => 5.1 (upmix)

2.       5.1 => 5.1

And on a 2.0 output, you can do:

1.       2.0 => 2.0

2.       5.1 => 2.0 (downmix)

From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Dadi
Sent: Tuesday, December 16, 2014 6:02 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: Retrieving WAVEFORMATEX from IAudioSessionControl

Hi Matthew,
Our global APO needs that information for its processing logic.

E.g. for doing surround upmix we need to know the channel count of all open 
sessions. That way we can find if an app opened a stereo channel to play audio 
(and so the APO should do upmix) or if an app is playing full surround and 
intentionally only two channels are active (e.g. can happen while a movie is 
played) and in this case we should NOT do any upmix in the APO.
Because there can be many audio sessions simultaneous then we will take the 
minimum or maximum values for reference.
The above is only one example and there are other cases in which our APO needs 
to know the original format.
Windows API allows us to enumerate all the active audio sessions (we can filter 
it per endpoint) and get IAudioSessionControl for each session but we need to 
use it to get the active WAVESFORMATEX.

Note - we do not have any SFX APOs, only global.
Is there any way to resolve this?
Thank you,
Dadi



2014-12-15 18:58 GMT+02:00 Matthew van Eerde 
<Matthew.van.Eerde@xxxxxxxxxxxxx<mailto:Matthew.van.Eerde@xxxxxxxxxxxxx>>:
Conceptually, an audio session (IAudioSessionControl) is an (app, endpoint) 
pair.

An app can have zero or more active streams (IAudioClient) on a given endpoint 
at any given time.

The stream has an associated WAVEFORMATEX (what was passed to 
IAudioClient::Initialize) but there’s no way to retrieve it from the 
IAudioClient.

There is also no way to get the list of active IAudioClients from an 
IAudioSessionControl.

What is the larger problem you’re trying to solve?

From: wdmaudiodev-bounce@xxxxxxxxxxxxx<mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx> 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx<mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx>]
 On Behalf Of Dadi
Sent: Sunday, December 14, 2014 11:21 AM
To: wdmaudiodev@xxxxxxxxxxxxx<mailto:wdmaudiodev@xxxxxxxxxxxxx>
Subject: [wdmaudiodev] Retrieving WAVEFORMATEX from IAudioSessionControl

Hi,
Is it possible to retrieve the audio session format (WAVEFORMATEX) from a given 
pointer to an active IAudioSessionControl?
Thank you,
Dadi

Other related posts: