Ableton Live AU crash on duplicate

Yeah that’s not quite right, yet, thanks! Shouldn’t matter however for just testing if this fix works or not.

Works fine with this patch !

What kind of sorcery is this ?

What kind of sorcery is this ?

Ha, if I’d only know!

I think this fundamentally must be down to an Ableton Bug. Ableton has listeners attached to the bus names and doesn’t like it if the 17th bus name changes during a setStateInformation. However, the bus name isn’t even changing, so Apple’s AU SDK code shouldn’t be firing listeners in the first place. Fixing this also keeps Ableton happy.

I ended up with the following patch now. I hope there are no more silly mistakes. The patch will go through the usual code-review and end up on develop in a couple of days. I’ll update this post when that has happened.

diff --git a/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AUScopeElement.cpp b/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AUScopeElement.cpp
index 571a24a75..6ff526394 100644
--- a/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AUScopeElement.cpp
+++ b/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AUScopeElement.cpp
@@ -386,8 +386,12 @@ std::vector<AudioUnitElement> AUScope::RestoreElementNames(CFDictionaryRef inNam
                        if ((elName != nullptr) && (CFGetTypeID(elName) == CFStringGetTypeID())) {
                                AUElement* const element = GetElement(intKey);
                                if (element != nullptr) {
-                                       element->SetName(elName);
-                                       restoredElements.push_back(intKey);
+                                       auto* const currentName = element->GetName().get();
+
+                                       if (currentName == nullptr || CFStringCompare(elName, currentName, 0) != kCFCompareEqualTo) {
+                                               element->SetName(elName);
+                                               restoredElements.push_back(intKey);
+                                       }
                                }
                        }
                }
1 Like

FWIW, Ableton do not allow to have 17 outputs and trim to 16 so this is maybe why

Ahh ok. Then this makes sense. The code that you shared uses 17 busses. I can see Ableton (somewhat desperately) trying to change the bus count back to 16 busses, but as canRemoveBus returns false, it cannot do that.

Does the real product you are working on also have 17 busses?

Yes :slight_smile:
One main and 16 aux

1 Like

This is my exact use case too…

This is now fixed with commit 3705a5c on the develop branch.

3 Likes