Suggestion from the dev:
Ø Update the APO code to call base class from IsInputFormatSupported(), return
failure if base class fails, and then do any APO-specific checks on the
original input format if base class returned S_OK or on the proposed format if
base class returned S_FALSE.
The expected end outcome is that if you’re queried with an MP3 format you
should return S_FALSE with the closest supported uncompressed floating-point
format.
From: Matthew van Eerde<mailto:Matthew.van.Eerde@xxxxxxxxxxxxx>
Sent: Monday, May 9, 2016 8:31 AM
To: Michael Johansen<mailto:johansen.mic@xxxxxxxxx>
Cc: wdmaudiodev@xxxxxxxxxxxxx<mailto:wdmaudiodev@xxxxxxxxxxxxx>
Subject: [wdmaudiodev] Re: SFX APO and Windows Media Player
Great!
Can you file feedback as follows and send me a direct link? I will promote it
to a bug on my end.
1. Get a Windows 10 machine
2. Go to the Windows Feedback or Feedback Hub app (depending on whether
you have an insider build)
3. File a new “problem” report in the “Hardware, Devices, and Drivers |
Audio, sound, and volume” category
4. Use the “reproduce” button or the “begin monitoring” link to grab
traces
5. Reproduce the problem
6. Stop the traces
7. Attach additional files (in this case, the source for the APO would be
helpful)
8. Once filed, used the “copy link” to grab a Windows-Feedback:?... or
Feedback-Hub:?... URL which points directly to the feedback.
From: Michael Johansen<mailto:johansen.mic@xxxxxxxxx>
Sent: Monday, May 9, 2016 12:53 AM
To: Matthew van Eerde<mailto:Matthew.van.Eerde@xxxxxxxxxxxxx>
Cc: wdmaudiodev@xxxxxxxxxxxxx<mailto:wdmaudiodev@xxxxxxxxxxxxx>
Subject: Re: [wdmaudiodev] SFX APO and Windows Media Player
Hi Matthew,
Sorry, we just had a few extra public hollidays here in DK.
Yes I have a win 10 machine. (the bug is also seen on win 8).
Michael
2016-05-04 19:22 GMT+02:00 Matthew van Eerde
<Matthew.van.Eerde@xxxxxxxxxxxxx<mailto:Matthew.van.Eerde@xxxxxxxxxxxxx>>:
Okeydokey, let’s get a bug filed.
Do you have a Windows 10 machine handy?
From: Michael Johansen<mailto:johansen.mic@xxxxxxxxx>
Sent: Wednesday, May 4, 2016 10:18 AM
To: Matthew van Eerde<mailto:Matthew.van.Eerde@xxxxxxxxxxxxx>
Cc: wdmaudiodev@xxxxxxxxxxxxx<mailto:wdmaudiodev@xxxxxxxxxxxxx>
Subject: Re: [wdmaudiodev] SFX APO and Windows Media Player
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<mailto: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<mailto:johansen.mic@xxxxxxxxx>
Sent: Wednesday, May 4, 2016 9:50 AM
To: Matthew van Eerde<mailto:Matthew.van.Eerde@xxxxxxxxxxxxx>
Cc: wdmaudiodev@xxxxxxxxxxxxx<mailto: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<mailto: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<mailto:johansen.mic@xxxxxxxxx>
Sent: Wednesday, May 4, 2016 6:36 AM
To: wdmaudiodev@xxxxxxxxxxxxx<mailto: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