V2: on MAC a deadlock loading default patch with an active audio device at launch

let’s say that 1 out of 3 times loading the default patch stops after these 3 lines

[34m[8.334 info ../RackV2/src/rtaudio.cpp:119 openStream] e[0mOpening RtAudio CoreAudio device 1: USB Audio CODEC  (0 in, 2 out, 48000 sample rate, 256 block size)
e[34m[8.340 info ../RackV2/src/rtaudio.cpp:131 openStream] e[0mStarting RtAudio CoreAudio device 1
e[34m[8.460 info ../RackV2/src/rtaudio.cpp:141 openStream] e[0mOpened RtAudio CoreAudio device 1

the main thread is sstopped in a WriteLock precisely here

void Engine::addCable(Cable* cable) {
	WriteLock lock(internal->mutex);

and the APPLE.IOThread is blocked here:

Module* Engine::getModule(int64_t moduleId) {
	ReadLock lock(internal->mutex);

the full stack for the Main Thread is this

the stack for the IOThread is this one

I’ve been noticing the same thing on Windows lately as well (using head of v2 branch as I type this), hangning in RtAudio on startup once every 3 or 4 launches of Rack. I don’t think this was happening with the early v2’s, so perhaps something has changed in that library.

1 Like

Same here on Rack2 posted beta on Win10. Reloading patch after restart always works.