Automation issues after switching presets in aaxwrapper

SDK for VST 3 audio plug-in and host development.
ray
Posts: 81
Joined: Fri Sep 02, 2016 9:37 am

Automation issues after switching presets in aaxwrapper

Postby ray » Fri Jun 22, 2018 10:11 am

There apparently is an automation issue which happens after selecting presets using the aaxwrapper in SDK v3.6.9. It can easily be reproduced using again_aax:

1. In Pro Tools instanciate again_aax.
2. Create and save 2 or more presets with different gain settings using Pro Tools' preset browser.
3. Add gain parameter to automation list.
4. Switch to e.g. write automation mode.
5. Start playback and switch between the presets created in 2.
6. Stop playback and reset to initial timeline cursor.
7. Switch to read mode.
8. Restart playback.

Expected result: Automation follows the gain parameter settings according to presets selected while writing the automation.
Actual result: Gain parameter doesn't change. It seems as if the automation values aren't reported to the host properly.

Switching presets per se works fine, it's just that the according parameter changes aren't transferred back to the host. It may have to do something with the fact that Vst2Wrapper::setChunk() is scheduled for a later call in onTimer(), which happens if AAXWrapper_Parameters::SetChunk() isn't called from the main thread.'
My assumption is that either the automation value reported back to ProTools reflects the parameter's old state or there isn't any reporting going on at all. I'd need to investigate further in order to confirm that. I also assume there weren't any changes regarding that in 3.6.10 given that the wrapper has been refactored? At least it doesn't have to do with the fixes suggested in my recent PRs.

Best,
Ray
Last edited by ray on Fri Jun 22, 2018 2:01 pm, edited 1 time in total.

ray
Posts: 81
Joined: Fri Sep 02, 2016 9:37 am

Re: Automation issues after switching presets in aaxwrapper

Postby ray » Fri Jun 22, 2018 11:02 am

Here's one potential fix outlined in the v3.6.9 SDK codebase. I'm sure there's corresponding code in v3.6.10

1. Add a bool called "presetChanged" to AAXWrapper
2. Intercerpt and signal the AAX_eNotificationEvent_PresetOpened message in AAXWrapper_Parameters::NotificationReceived, like so

Code: Select all

   ...
   switch (iNotificationType)
   {
      case AAX_eNotificationEvent_PresetOpened:
         mWrapper->presetChanged = true;
         break;
         ...
   }


3. React to preset changes in AAXWrapper::onTimer() and push the new parameter values to the host after the underlying component has updated its state

Below the following section

Code: Select all

      FGuard guard (msgQueueLock);
      Vst2Wrapper::setChunk (mChunk.getData (), mChunk.getSize (), false);
      wantsSetChunk = false;

add

Code: Select all

      if (presetChanged)
      {
         int32_t numParams;
         if (aaxParams->GetNumberOfParameters (&numParams) == AAX_SUCCESS)
         {
            for(auto i=0; i<numParams; i++)
            {
               double value;
               AAX_CString id;

               if (aaxParams->GetParameterIDFromIndex (i, &id) == AAX_SUCCESS)
               {
                  if (aaxParams->GetParameterNormalizedValue (id.CString(), &value) == AAX_SUCCESS)
                  {
                     aaxParams->SetParameterNormalizedValue (id.CString(), value);
                  }
               }
            }
         }
         presetChanged = false;
      }


I'm sure there are more elegant ways to iterate and set all aaxParams, but I think you get the point. This mechanism allows to distinguish between normal chunk updates that the host is aware of e.g. when restoring a session and internal changes imposed by preset switches currently not transferred back to Pro Tools.

ray
Posts: 81
Joined: Fri Sep 02, 2016 9:37 am

Re: Automation issues after switching presets in aaxwrapper

Postby ray » Sun Oct 28, 2018 8:07 am

Any feedback on this one? Do you want me to create a PR?

Thanks!

ygrabit
Posts: 107
Joined: Fri Jun 17, 2016 7:52 am
Location: Hamburg

Re: Automation issues after switching presets in aaxwrapper

Postby ygrabit » Tue Oct 30, 2018 8:07 am

Hi

Did you check the last SDK 3.6.11? maybe this issue is already fixed...
Cheers
YVan Grabit

ray
Posts: 81
Joined: Fri Sep 02, 2016 9:37 am

Re: Automation issues after switching presets in aaxwrapper

Postby ray » Tue Oct 30, 2018 8:49 am

ygrabit wrote:Hi

Did you check the last SDK 3.6.11? maybe this issue is already fixed...
Cheers


Hi Yvan,

I did and unfortunately, no this one is not fixed in the latest SDK.

Best,
Ray

ygrabit
Posts: 107
Joined: Fri Jun 17, 2016 7:52 am
Location: Hamburg

Re: Automation issues after switching presets in aaxwrapper

Postby ygrabit » Tue Oct 30, 2018 2:41 pm

ok... did you try your proposed fix ?
if it works i will commit it for the next update..
YVan Grabit

ray
Posts: 81
Joined: Fri Sep 02, 2016 9:37 am

Re: Automation issues after switching presets in aaxwrapper

Postby ray » Tue Oct 30, 2018 3:22 pm

ygrabit wrote:ok... did you try your proposed fix ?
if it works i will commit it for the next update..


Yes I did, and it works well, although it will obviously need some adaptations now that the AAXWrapper isn't based on the VST2Wrapper anymore.

Best,
Ray


Return to “VST 3 SDK”

Who is online

Users browsing this forum: No registered users and 3 guests