[wdmaudiodev] Re: SFX APO and Windows Media Player

  • From: Michael Johansen <johansen.mic@xxxxxxxxx>
  • To: Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>
  • Date: Wed, 4 May 2016 19:18:20 +0200

We tried both suggesting a new format and rejecting the asked format. Same
thing happens.

Michael

2016-05-04 18:56 GMT+02:00 Matthew van Eerde <
Matthew.van.Eerde@xxxxxxxxxxxxx>:

OK, that’s a good reason to be an SFX. Note that only some apps (including
Windows Media Player) will bother to query IAudioClient::IsFormatSupported
with the source format; other apps (like MPC, apparently) just go straight
for the mix format.



FWIW, further poking around in the implementation of
CBaseAudioProcessing::IsInputFormatSupported seems to suggest that the
audio engine is expecting the APO to return S_FALSE, with an output
“closest supported” format that has a subformat of
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT.



*From: *Michael Johansen <johansen.mic@xxxxxxxxx>
*Sent: *Wednesday, May 4, 2016 9:50 AM
*To: *Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>
*Cc: *wdmaudiodev@xxxxxxxxxxxxx
*Subject: *Re: [wdmaudiodev] SFX APO and Windows Media Player


Hi Matthew,

Yes the reason for the SFX is to handle surround channels.

Michael

2016-05-04 17:18 GMT+02:00 Matthew van Eerde <
Matthew.van.Eerde@xxxxxxxxxxxxx>:

I’ll take another stab at it.



I took a closer look at the sample APO to see how it handles this.




https://github.com/Microsoft/Windows-driver-samples/blob/master/audio/sysvad/SwapAPO/APO/



The sample APO inherits from CBaseAudioProcessingObject, which is
implemented in a .lib that ships with the SDK. It does not override
IsInputFormatSupported or IsOutputFormatSupported.



The implementation is opaque. But I work on Windows, so I have the source.



CBaseAudioProcessingObject::IsInputFormatSupported and
CBaseAudioProcessingObject::IsOutputFormatSupported are thin wrappers
around CBaseAudioProcessingObject::IsFormatTypeSupported. This can also be
overridden by derived classes. But the sample doesn’t override it either.



CBaseAudioProcessingObject::IsFormatTypeSupported in turn calls into
CBaseAudioProcessingObject::ValidateDefaultAPOFormat. This can also be
overridden by derived classes. But the sample doesn’t override it either.



CBaseAudioProcessingObject::IsFormatTypeSupported also consults the APO
registration properties, e.g. whether APO_FLAG_SAMPLESPERFRAME_MUST_MATCH
is set.



Is there a reason you want to be in the SFX slot rather than in the MFX
slot? For example, do you want to do some processing that requires changing
the channel count, e.g. headphone virtualization? If you need to change the
channel count, that requires more sophisticated format negotiation than
otherwise.



*From: *Michael Johansen <johansen.mic@xxxxxxxxx>
*Sent: *Wednesday, May 4, 2016 6:36 AM
*To: *wdmaudiodev@xxxxxxxxxxxxx
*Subject: *[wdmaudiodev] SFX APO and Windows Media Player


Hi,

(This is a repost as I have had a difficult time finding someone who
could point in the right direction).

I am helping a customer upgrade an existing GFX APO to the new SFX, MFX,
EFX design.
The customer wants to use an SFX for certain effects. It installs fine.
But when using an MP3 file with Windows Media Player IsInputFormatSupported
is called with format tag WAVE_FORMAT_MPEGLAYER3 to which the APO returns 
APOERR_FORMAT_NOT_SUPPORTED.
Then the APO is called again with other float32 supported formats that the
APO responds S_OK to. But WMP then stop with a failure saying it does not
support the format. If I install the MFX or EFX all is fine.
Also if I use another player such as MPC it starts with asking for the
float32 format and plays nicely with the SFX.

What would be the solution to handle this situation with WMP?

- Michael




Other related posts: