I’m not seeing this on the latest develop. I’m testing on an M1 Pro running macOS 12.4.
I built and ran the AudioPluginHost as a universal binary. I also built the DSPModulePluginDemo, and ensured it had only an x86_64 segment using lipo
. I’m able to load the plugin without problems. I also tried installing Analog Lab 4 and testing with that. file
confirms that the bundle is x86_64-only. The AudioPluginHost is able to open the plugin correctly, and is able to load a saved project containing only an instance of Analog Lab 4 AU.
Edit: by adding a breakpoint on the AudioUnitInitialize
call, I’m able to trigger the deadlock. The stacks look like this:
Main thread --------------------------------------------------------------------
__psynch_mutexwait 0x000000019843d738
_pthread_mutex_firstfit_lock_wait 0x0000000198475384
_pthread_mutex_firstfit_lock_slow 0x0000000198472cf8
halb lock ->HALB_Mutex::Lock() 0x000000019a40c898
HALC_ProxyIOContext::GetPropertyData(AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int, unsigned int&, void*) const 0x000000019a014ef4
HALC_ShellObject::GetPropertyData(unsigned int, AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int, unsigned int&, void*) const 0x000000019a13d638
HAL_HardwarePlugIn_ObjectGetPropertyData(AudioHardwarePlugInInterface**, unsigned int, AudioObjectPropertyAddress const*, unsigned int, void const*, unsigned int*, void*) 0x0000000199fe1acc
HALPlugIn::ObjectGetPropertyData(HALObject const&, AudioObjectPropertyAddress const&, unsigned int, void const*, unsigned int&, void*) const 0x000000019a0fa500
AudioObjectGetPropertyData 0x0000000199e57704
std::__1::__function::__func<auoop::WorkgroupManager_macOS::setHALDeviceList(std::__1::vector<unsigned int, std::__1::allocator<unsigned int> > const&)::$_7, std::__1::allocator<auoop::WorkgroupManager_macOS::setHALDeviceList(std::__1::vector<unsigned int, std::__1::allocator<unsigned int> > const&)::$_7>, bool (auoop::WorkgroupManager_Base::State&)>::operator()(auoop::WorkgroupManager_Base::State&) 0x0000000199b8f604
auoop::WorkgroupManager_Base::mutateWorkgroups(std::__1::function<bool (auoop::WorkgroupManager_Base::State&)>&&) 0x0000000199b8e4f8
auoop::WorkgroupManager_macOS::handleHALDeviceListChange() 0x0000000199b8e0e8
auoop::gWorkgroupManager() 0x0000000199b8de10
auoop::RenderPipePool::registerUser(AUOOPRenderClientUser const&, auoop::RenderPipeConfig const&) 0x0000000199a49e38
-[AUAudioUnit_XPC allocateRenderResourcesAndReturnError:] 0x0000000199aa7d00
int caulk::function_ref<int ()>::functor_invoker<AUv3InstanceBase::Initialize()::'lambda'()>(caulk::details::erased_callable<int ()> const&) 0x0000000199a9bf7c
AUv3InstanceBase::NSExceptionBarrier(caulk::function_ref<int ()>) 0x0000000199a936a8
AUv3InstanceBase::Initialize() 0x0000000199a9bf24
AUIB_Initialize(void*) 0x0000000199bca298
AudioUnitInitialize 0x0000000199bdd1dc
juce::AudioUnitPluginInstance::prepareToPlay(double, int) juce_AudioUnitPluginFormat.mm:1342
juce::AudioProcessorGraph::Node::prepare(double, int, juce::AudioProcessorGraph *, juce::AudioProcessor::ProcessingPrecision) juce_AudioProcessorGraph.cpp:875
callback lock ->juce::AudioProcessorGraph::buildRenderingSequence() juce_AudioProcessorGraph.cpp:1296
juce::AudioProcessorGraph::handleAsyncUpdate() juce_AudioProcessorGraph.cpp:1307
juce::updateOnMessageThread(juce::AsyncUpdater &) juce_AudioProcessorGraph.cpp:32
juce::AudioProcessorGraph::topologyChanged() juce_AudioProcessorGraph.cpp:959
juce::AudioProcessorGraph::addNode(std::unique_ptr<…>, juce::AudioProcessorGraph::NodeID) juce_AudioProcessorGraph.cpp:1015
PluginGraph::createNodeFromXml(const juce::XmlElement &) PluginGraph.cpp:457
PluginGraph::restoreFromXml(const juce::XmlElement &) PluginGraph.cpp:520
PluginGraph::loadDocument(const juce::File &) PluginGraph.cpp:231
auto juce::FileBasedDocument::Pimpl::loadFrom(juce::File const&, bool, bool)::'lambda'(juce::File const&, auto const&)::operator()<void juce::FileBasedDocument::Pimpl::loadFromImpl<'lambda'(juce::File const&, auto const&)>(juce::FileBasedDocument::Pimpl::SafeParentPointer, juce::File const&, bool, bool, auto&&, std::__1::function<void (juce::Result)>)::'lambda0'(juce::Result)>(juce::File const&, auto const&) const juce_FileBasedDocument.cpp:104
juce::FileBasedDocument::Pimpl::loadFromImpl<…>(juce::FileBasedDocument::Pimpl::SafeParentPointer, const juce::File &, bool, bool, auto &&, std::function<…>) juce_FileBasedDocument.cpp:377
juce::FileBasedDocument::Pimpl::loadFrom(const juce::File &, bool, bool) juce_FileBasedDocument.cpp:100
juce::FileBasedDocument::loadFrom(const juce::File &, bool, bool) juce_FileBasedDocument.cpp:989
PluginHostApp::handleAsyncUpdate() HostStartup.cpp:214
juce::AsyncUpdater::AsyncUpdaterMessage::messageCallback() juce_AsyncUpdater.cpp:34
juce::MessageQueue::deliverNextMessage() juce_osx_MessageQueue.h:81
juce::MessageQueue::runLoopCallback() juce_osx_MessageQueue.h:92
juce::MessageQueue::runLoopSourceCallback(void *) juce_osx_MessageQueue.h:100
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ 0x0000000198545034
__CFRunLoopDoSource0 0x0000000198544f80
__CFRunLoopDoSources0 0x0000000198544c80
__CFRunLoopRun 0x0000000198543600
CFRunLoopRunSpecific 0x0000000198542b24
RunCurrentEventLoopInMode 0x00000001a117b338
ReceiveNextEventCommon 0x00000001a117b0b4
_BlockUntilNextEventMatchingListInModeWithFilter 0x00000001a117ae68
_DPSNextEvent 0x000000019b0a978c
-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] 0x000000019b0a8084
-[NSApplication run] 0x000000019b09a250
juce::MessageManager::runDispatchLoop() juce_mac_MessageManager.mm:359
juce::JUCEApplicationBase::main() juce_ApplicationBase.cpp:262
juce::JUCEApplicationBase::main(int, const char **) juce_ApplicationBase.cpp:240
main HostStartup.cpp:393
start 0x0000000108c1908c
Audio thread -------------------------------------------------------------------
__psynch_mutexwait 0x000000019843d738
_pthread_mutex_firstfit_lock_wait 0x0000000198475384
_pthread_mutex_firstfit_lock_slow 0x0000000198472cf8
juce::CriticalSection::enter() const juce_posix_SharedCode.h:39
juce::GenericScopedLock::GenericScopedLock(const juce::CriticalSection &) juce_ScopedLock.h:67
callback lock ->juce::GenericScopedLock::GenericScopedLock(const juce::CriticalSection &) juce_ScopedLock.h:67
juce::AudioProcessorPlayer::audioDeviceIOCallbackWithContext(const float **, int, float **, int, int, const juce::AudioIODeviceCallbackContext &) juce_AudioProcessorPlayer.cpp:270
juce::AudioDeviceManager::audioDeviceIOCallbackInt(const float **, int, float **, int, int, const juce::AudioIODeviceCallbackContext &) juce_AudioDeviceManager.cpp:921
juce::AudioDeviceManager::CallbackHandler::audioDeviceIOCallbackWithContext(const float **, int, float **, int, int, const juce::AudioIODeviceCallbackContext &) juce_AudioDeviceManager.cpp:79
halb lock? ->juce::CoreAudioClasses::CoreAudioInternal::audioCallback(const AudioTimeStamp *, const AudioBufferList *, AudioBufferList *) juce_mac_CoreAudio.cpp:786
juce::CoreAudioClasses::CoreAudioInternal::audioIOProc(unsigned int, const AudioTimeStamp *, const AudioBufferList *, const AudioTimeStamp *, AudioBufferList *, const AudioTimeStamp *, void *) juce_mac_CoreAudio.cpp:893
HALC_ProxyIOContext::IOWorkLoop() 0x000000019a017db4
invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) 0x000000019a015efc
HALB_IOThread::Entry(void*) 0x000000019a1e2304
_pthread_start 0x000000019847826c
I’ll try to find a solution.