[wdmaudiodev] Re: Vista sAPO GFX -- configuring for encoded formats

  • From: "William R. Huttel" <whuttel@xxxxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Tue, 13 Feb 2007 21:26:46 -0600

It appears that it was a conflict between the format validation routines and the static APO flags. I had tried removing the flags and setting to APO_NONE earlier in my experimentation, but had problems (e.g. "Advanced tab" not showing up), but I think the IsInputFormatSupported() was not correct for cases when it received unsupported formats.

If I leave the APO flags as

APO_FLAG_FRAMESPERSECOND_MUST_MATCH | APO_FLAG_INPLACE

and require (48K, 2 channels, 5.1 channel mask) for input and (48k, 2 channels) for output (and return S_FALSE if these conditions are not met), then I get a successful negotiation and instantiation using the AC3 format type. (I wasn't sure if APO_FLAG_INPLACE is appropriate to the GFX, as I can't find info on it, but it seems to work with it in).

Many thanks,

Bill




On Feb 13, 2007, at 6:44 PM, Jeffrey Hoekman wrote:

<x-tad-bigger>Please confirm you’re on an RTM build ? there were changes late in the RTM cycle which completed the GFX-encoding scenario. If you’re on RC1 or an early RTM build GFX-encoding will not work.</x-tad-bigger>
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger>Bill said, “</x-tad-bigger>
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger>></x-tad-bigger> While I'm here, though somewhat unrelated, I've noticed a couple of things in the samples that might be typos, perhaps others have encountered these and can comment:
if (inFormat.fFramesPerSecond != inFormat.fFramesPerSecond)
{
MyLog( "fps mismatch");
inFormat.fFramesPerSEcond = inFormat.fFramesPerSecond;
hrInput = S_FALSE;
}

Is this meant to be a comparison and set to the output if not a match? ”

<x-tad-bigger>That looks like a typo or bug in the example. Clearly inFormat.fFramesPerSecond will always be equal to itself. In the conditional one of these variables should be outFormat.fFramesPerSecond, and depending the API should have inFormat on left (for IsInputFormatSupported) or outFormat on left (for IsOutputFormatSupported.) This means the APO is suggesting a better input or output (the requested format) so that the APO does no SRC or other transforms. </x-tad-bigger>
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger>></x-tad-bigger> My logs show that IsOutputFormat() is succeeding having been called with the 0x00000092 format type. I see two calls to GetRegistrationProperties(), then the GFX object is destroyed (destructor called). LockForProcess() is not called.
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger>If LockForProcess is not being called either format resolution is failing (during calls to IsIn{Out}putFormatSupported,) or another failure is occurring when setting up connection buffers around the APOs. If the GFX responds S_OK to format-pairs which conflict with the registration flags there will likely be problems when allocating connection-buffers. </x-tad-bigger>
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger>The sm_RegProperties are used for integrity-checks against the ‘format-supported’ APIs, and also to gain info about the APO without instantiating it. If you have, for example, APO_FLAG_SAMPLESPERFRAME_MUST_MATCH set in your flags the audio engine will not allow matrixing (up/down channel conversions.) This flag should be omitted for encoding GFXes which accept 5.1 channel data and encode to 2ch spdif. It should also almost always be omitted for the LFX which needs to do speaker-fill or down-mixing. Keep in mind these flags are reflected not only in the registry, but also in the APO when instantiated.</x-tad-bigger>
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger>Your problem most likely stems from incorrect IsIn{Out}putFormatSupported API implementations, or inconsistent registration property flags. Please double-check these, and we will try and narrow down a solution. If you have AudioSrv logging turned on please provide the evm files and exact build#. We can usually glean more info from those as well.</x-tad-bigger>
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger> </x-tad-bigger>
<x-tad-bigger>From:</x-tad-bigger><x-tad-bigger> wdmaudiodev-bounce@xxxxxxxxxxxxx [mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] </x-tad-bigger><x-tad-bigger>On Behalf Of </x-tad-bigger><x-tad-bigger>William R. Huttel</x-tad-bigger>
<x-tad-bigger>Sent:</x-tad-bigger><x-tad-bigger> Tuesday, February 13, 2007 2:17 PM</x-tad-bigger>
<x-tad-bigger>To:</x-tad-bigger><x-tad-bigger> wdmaudiodev@xxxxxxxxxxxxx</x-tad-bigger>
<x-tad-bigger>Subject:</x-tad-bigger><x-tad-bigger> [wdmaudiodev] Re: Vista sAPO GFX -- configuring for encoded formats</x-tad-bigger>

I have implemented GetFormatRepresentation(). wFormatTag is always "WAVE_FORMAT_EXTENSIBLE" as in the sample code. For "SubFormat", I've tried the KSDATAFORMAT_SUBTYPE_AC3 as in the sample (the GUID it uses corresponds to MEDIASUBTYPE_DOLBY_AC3_SPDIF given in UUIDS.h). I've also tried KSDATAFORMAT_SUBTYPE_AC3_AUDIO and KSDATAFORMAT_SUBTYPE_DTS_AUDIO.

I have managed to get the first value (0x00000092 ... MEDIASUBTYPE_DOLBY_AC3_SPDIF) to appear in the "Advanced" list, and, with proper handling of the IsInput and IsOutput calls, it can be selected (any attempt to use the other formats results in a "format not supported" message). However, if I try to start an audio stream with e.g. MP I get a general failure message.

My logs show that IsOutputFormat() is succeeding having been called with the 0x00000092 format type. I see two calls to GetRegistrationProperties(), then the GFX object is destroyed (destructor called). LockForProcess() is not called.

The data in sm_RegProperties seems fairly stock (this is returned on the GetRegistrationProperties() call). I don't know what is causing it not to get to the LockForProcess() call.

Bill


On Feb 12, 2007, at 7:11 PM, tachunir@xxxxxxxxxxxxxxxx wrote:

I don't see you mention GetFormatRepresentation(). Did you do that? What's the value of "wFormatTag" and "SubFormat" you're using? If you do those correctly, you should be able to see the name of your custom formats (returned by GetFormatRepresentation() function call) in the Default Format drop down list of the Advanced page of the audio properties panel.

_T

在 2007/2/12 的?信中,"William R. Huttel" 提及:

>Thanks for the response. I have added the IAudioSystemEffectCustomFormats interface to my GFX. I do get calls to GetFormatCount() and GetFormat() at APO startup. I still get no calls to IsOutputFormatSupported() with anything other than float32 PCM, no matter what encoded format I return from GetFormat(). I've tried returning a PCM format (16 bit, 48K) just to see if I could write integral PCM samples out to the SPDIF device. I want to implement asymmetric formats in the GFX: float32 PCM in, and encoded SPDIF formats out. I thus want to make certain the float32-int16 converter mentioned in the "Data Formats" section of sysfx.doc is not attached to the output of the GFX by the graph builder, as it must be bit-exact to the device. The rest of "Data Formats" goes on to say that the IsInputFormatSupported() should return a float format which matches the sample rate and speaker config of the "decoded" format (I'm guessing the returned format should be a float32 pcm variant of the output side, which is the "encoded" format to me, but should otherwise match the output format in sample rate and speaker mask (e.g. 48K and 5.1)). I've found nothing more on IAudioSystemEffectCustomFormats except what is in the swap code example, and the documentation in audioenginebaseapo.idl (in the DDK). If this interface is the key to getting encoded formats supported as output from the GFX, what more needs to be done other than returning the supported formats via GetFormat(), and watching for them on IsOutputFormatSupported()? Cheers, Bill On Feb 11, 2007, at 9:42 PM, tachunir@xxxxxxxxxxxxxxxx wrote: > I believe you should first implement the GetFormatCount(), GetFormat() > and GetFormatRepresentation() functions in GFX. The audio engine will > use these to determine what custom format your GFX supports, and use > that in the IsOutputFormatSupported() calls. > > _T > > 在 2007/2/11 的?信中,"William R. Huttel" 提及: > > >Hi, I need some help on getting encoded formats (such as AC3) > supported by a Vista GFX. From the guidelines in sysfx.doc, I have > removed CBaseAudioProecessingObject as a base from my GFX class, and > instead added the 3 required interfaces, and implemented my own > versions of their methods. Under "Data Formats" (in sysfx.doc) it says > that a GFX may support "encoded" formats, though it must support > float32 PCM on the audio engine-facing side of the GFX. Regarding > "IsInputFormatSupported", the doc says that the GFX should return a > float format that has the sample rate and speaker configuration of the > "decoded" format (I'm presuming from context that this is returned on > the IsInputFormatSupported() call and not the IsOutput...). No matter > what I try I'm unable to get an IsOutputFormatSupported call which has > anything other than a float32 PCM data format. I can suggest, AC3, > PCM, etc. to no avail. I have modified the swap example INF to install > a postmix effect (GFX) on the SPDIF device, and add a custom UI; the > installation appears successful. I have noticed that the "configure" > button (which allows setting the speaker configuration) is inactive > for the device -- are there presumed speaker configurations for SPDIF? > is this expected behaviour ("configure" is not allowed on the SPDIF > device, unlike "Speakers" and "Headphones")? In the swap example, the > GFX exposes the interface: "IAudioSystemEffectsCustomFormats". I've > tried exposing this from my GFX, but the routines it adds are never > called. (There is an AC3 format in it, so this looked promising.) Are > there any further sources which would help me in adding an encoded > format as output for a GFX? While I'm here, though somewhat unrelated, > I've noticed a couple of things in the samples that might be typos, > perhaps others have encountered these and can comment: spkrfill > example (obtained from sysfxreuse.exe): SpkrFillAPO.cpp, line 512: if > (inFormat.fFramesPerSecond != inFormat.fFramesPerSecond) { MyLog( "fps > mismatch"); inFormat.fFramesPerSEcond = inFormat.fFramesPerSecond; > hrInput = S_FALSE; } Is this meant to be a comparison and set to the > output if not a match? From sysfx.inf (in the 6000 DDK audio samples), > line 82: [HdAudModel.PrimaryLineOutTopo.AddReg] should this be > [HdAudio.SysFx.PrimaryLineOutTopo.AddReg] to be referenced by the > preceding stanza? Bill ****************** WDMAUDIODEV addresses: Post > message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: > mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe > Unsubscribe: > mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe > Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to > WDMAUDIODEV page: http://www.wdmaudiodev.com/ > ****************** WDMAUDIODEV addresses: Post message: > mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: > mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe > Unsubscribe: > mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe > Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to > WDMAUDIODEV page: http://www.wdmaudiodev.com/
****************** WDMAUDIODEV addresses: Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx Subscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe Unsubscribe: mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe Moderator: mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx URL to WDMAUDIODEV page: http://www.wdmaudiodev.com/

Other related posts: