I tried to update Projucer version to v4.3.0 and I found very strange issues.
AudioUnit Standalone is working fine, but AUv3 extension crashes when I try to load it by using GarageBand or Plugin Host of your example.
It crashes in deliverNextMessage function of “juce_osx_MessageQueue”.
I tried to find what the reason is but couldn’t.
It worked fine with Projucer v.4.1.0.
So finally I downgrade Projucer version to 4.2.4 and it worked also fine.
And one more thing, I can find Juce library v4.1.0 on GitHub, but I can’t find Projucer executable binary file from anywhere. When I want to get the previous version of Projucer, how can I do that?
You seem to be trying this on osx? Garageband does not support AUv3 on OS X so I don’t know how you are testing this. Maybe you are loading the AUv2 version.
The plugin host does support AUv3 on OS X and works fine for the AUv3Synth example in the JUCE/examples folder. What Plug-in are you trying to get working?
No…We are using GarageBand for iOS. When we compile AUv3 using Juce 4.3.0 We get audio extension errors. When we downgrade to 4.2.4 Everything seems to work fine.
Can you re-produce this with the JUCE example plug-ins (JUCE/examples/audio demo plugin/, JUCE/examples/AUv3Synth, JUCE/examples/PluginSamples)? That would help me re-produce this.
Those examples work fine. But my plugin not. Do I have to change some logic with message threading with new Juce? I am also running GarageBand on iOS with iPad 4 device. Plugin Host also shows error as well. Really strange…
Just a head’s up: if your plug-in was using Projucer’s channel configuration field, then a commit that I just pushed to develop may have fixed a bug in the AUv3 wrapper.
I’ve also stumbled into this one. I get a crash when closing the project and then re-open it again. It seems like GB destroys the processor instance and keeps the editor instance alive for some reason (I access the processor from the editor in a timer callback to synchronise parameters). This behaviour is new since iOS 10 though.
I tried a quite dirty workaround setting a flag in the processor destructor (and checking it from the timer callback in the editor) and that makes the crashing less frequent, but still happens now and then though since the deletion probably happens on a different thread. Haven’t tried any locks etc yet…
Edit: Just tried by adding a lock on the timer and in the processor destructor and it seem to work perfect.
The editor gets destroyed right after the processor (probably from some other thread). Here’s how my test-fix looks like. It could certainly be better implemented, just haven’t had the time to do so…
if (exitLock_m) { exitLock_m->enter(); }
if (editorIsPresent_m) { ((TinesAudioProcessorEditor*)editor_m)->processorIsDeleted(); }
if (exitLock_m) { exitLock_m->exit(); }
I assume we can’t force deletion of the editor from the processor destructor; haven’t seen anything for that in the API. It’s a pity that iOS 10 is not doing it in the right order.
Have you considered calling a custom editor method like disable() in the processor constructor (of course, only if getActiveEditor() is not null) that would set a kind of disabled flag that would stop any interaction with the processor? Would that work?
Ah, didn’t know about getActiveEditor(), should be used instead of my juggling with editor_m.
No, the editor gets deleted by the host. It’s just Garageband on iOS 10 that deletes the processor first, most likely from some other thread. But if the locks are in place, and the processor tells the editor that it got deleted it’ll work. I’ve tested my plugins in AUM, Cubasis and Garageband with my fix, and haven’t had any issues yet…
I have tried using getActiveEditor() to avoid keeping a separate reference to the editor, but I still get the problem. Don’t know how GB handles this but it seems to mess up the underlying stuff.
So finally I have done as you suggested and it works perfectly. Thanks a lot.
It’s really weird… when debugging this and setting a breakpoint in the editor destructor, it never gets called. Still, no leaks… must be magic. I can confirm that getActiveEditor() doesn’t do the trick, you need to keep the pointer from when the editor is being created.
This thing also occurs on AUM on iOS 10.x and an upcoming AUv3 (significant) host that I’m not sure I can tell about right now… I’ve talked a bit with the AUM dev, and it looks like this is something that’s happening inside CoreAudio. I’ve got no details around it, but I guess most AUv3-builds using Juce will be affected. At least if the editor is accessing the processor instance in any way.
To reproduce in AUM: Add the AUv3-plugin, remove it and add it again. If there’s s timer callback in the editor accessing the processor instance there will be a crash (the processor gets deleted before the editor).