COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 02-26-2012, 01:18 PM   #1
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default fix for a crash with studio one (au)

https://github.com/olilarkin/wdl-ol/...55005d7e84e8bc

actually bah, not that easy, it messes up the validation
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook

Last edited by olilarkin; 02-26-2012 at 01:32 PM.
olilarkin is offline   Reply With Quote
Old 02-26-2012, 01:50 PM   #2
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

ok, fixed it now and noticed that there was a mistake in my hosts.cpp detecting studio one

https://github.com/olilarkin/wdl-ol/...354b5898262793

oli
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 02-29-2012, 05:00 AM   #3
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Thanks for the fixes.

Quote:
Originally Posted by olilarkin View Post
actually bah, not that easy, it messes up the validation
Exactly what validation does it mess up? I have tried "if (!pParam) return noErr;" (thus witout "GetHost() == kHostStudioOne"), and it seems to pass AU validation here, even with MallocStackLogging=1 and leaks.
Tale is offline   Reply With Quote
Old 02-29-2012, 01:07 PM   #4
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

something must have gone weird. I put it back to if (!pParam) and it's validating fine now. thanks
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 03-01-2012, 02:50 PM   #5
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

I have had another look at this, and wouldn't it be better to return an error code instead of noErr? After all we haven't completed filling the AudioUnitParameterInfo yet. Perhaps something like this:

Code:
    case kAudioUnitProperty_ParameterInfo: {             // 4,  listenable
      ASSERT_SCOPE(kAudioUnitScope_Global);
      *pDataSize = sizeof(AudioUnitParameterInfo);
      if (pData) {
        IParam* pParam = GetParam(element);
        if (!pParam) {
          return kAudioUnitErr_InvalidProperty; // Or kAudioUnitErr_InvalidElement, or kAudioUnitErr_InvalidParameter? 
        }
        AudioUnitParameterInfo* pInfo = (AudioUnitParameterInfo*) pData;
        memset(pInfo, 0, sizeof(AudioUnitParameterInfo));
        ...
BTW, why would Studio One ask a plug-in about a non-existing parameter in the first place? It's a Studio One bug, isn't it?
Tale is offline   Reply With Quote
Old 03-04-2012, 07:19 AM   #6
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

yeah i think you're right, but S1 doesn't seem to crash other aus when you bypass them.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 03-06-2012, 06:07 AM   #7
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Well, it could still be a bug in IPlug. But I don't think so, because I have traced events when clicking the standby button, and it would seem that Studio One actually calls IPlugAUEntry with kAudioUnitGetPropertySelect > kAudioUnitProperty_ParameterInfo and a parameter index of 1115241610. I have sent Presonus a bug report, so lets see what they can find (if anything).

Meanwhile I have applied a rewritten version of your fix (commit 8e09765e6a in my repository), as it does no harm, and I guess it is good practice to validate the parameter index range anyway.
Tale is offline   Reply With Quote
Old 03-09-2012, 11:17 AM   #8
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by Tale View Post
I have sent Presonus a bug report, so lets see what they can find (if anything).
They have indeed found something, it should be fixed in the next Studio One update.
Tale is offline   Reply With Quote
Old 04-22-2012, 03:34 AM   #9
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default Fix in Studio One v2.0.5

I have just downloaded Studio One v2.0.5, and the issue now also seems to be fixed at their end.
Tale is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.