surge icon indicating copy to clipboard operation
surge copied to clipboard

App fails to start when USB misconfigured

Open MilesParker opened this issue 2 years ago • 2 comments

Bug Description: After connecting to and selecting a (somewhat flakey) external usb device then quitting, removing that connection and restarting, got a hard crash (even after plugging external speakers back in.

Surge XT Version 1.1.0.012f6ce

  • Version:
  • Plugin Type: [VST2, VST3, AU]
  • Bitness: [32-bit or 64-bit]

Reproduction Steps: Will be hard to reproduce probably, but this was my path:

  1. Selected a (somewhat flakey) external usb device in options.
  2. Quit.
  3. Unplugged from external audio jack (not device itself) -- perhaps this is what created bad state?
  4. On launch, hard crash. Removing that connection and restarting and changing sound options in system prferences did not fix.

Workaround

I was able to fix by going into /Users/{username}/Library/Application\ Support/Surge\ XT.settings and just deleting the VALUE audioSetup::DEVICESETUP (but most users wouldn't know to do this).

Computer Information (please complete the following!):

  • OS: Mac 12.6
  • Host: Stand alone

Additional Information:

Relevant trace:

Thread 5 Crashed:: USB Audio 0 Surge XT 0x10a3ee417 SurgeSynthProcessor::processBlock(juce::AudioBuffer&, juce::MidiBuffer&) + 1223 1 Surge XT 0x10a756685 juce::AudioProcessorPlayer::audioDeviceIOCallback(float const**, int, float**, int, int) + 1733 2 Surge XT 0x10a3e3046 juce::StandalonePluginHolder::CallbackMaxSizeEnforcer::audioDeviceIOCallback(float const**, int, float**, int, int) + 134 3 Surge XT 0x10a9c151c juce::AudioDeviceManager::audioDeviceIOCallbackInt(float const**, int, float**, int, int) + 492 4 Surge XT 0x10a9cc243 juce::CoreAudioClasses::AudioIODeviceCombiner::run() + 1395 5 Surge XT 0x10a6d114a juce::Thread::threadEntryPoint() + 282 6 Surge XT 0x10a7044da juce::threadEntryProc(void*) + 26 7 libsystem_pthread.dylib 0x7ff80279f4e1 _pthread_start + 125 8 libsystem_pthread.dylib 0x7ff80279af6b thread_start + 15

Thread 5 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x00007000004aea98 rcx: 0x0000000000000000 rdx: 0x00007ff6d3900000 rdi: 0x0000000000000000 rsi: 0x00007000004ae5f0 rbp: 0x00007000004aead0 rsp: 0x00007000004ae5d0 r8: 0x0000000000000002 r9: 0x0000000000000003 r10: 0x0000000000000000 r11: 0x0000000000000000 r12: 0x00007ff725038a80 r13: 0x0000000000000000 r14: 0x00007ff7280c8000 r15: 0x00000000ffffffff rip: 0x000000010a3ee417 rfl: 0x0000000000010246 cr2: 0x0000000000000000

MilesParker avatar Sep 15 '22 19:09 MilesParker

Thanks

My bet is the juce audio manager interacts with the flaky system to give us a bus we don't expect but we aren't defensive about a null output bus properly in processBlock and blammo. Probably just a defensive if there.

baconpaul avatar Sep 15 '22 19:09 baconpaul

Yeah not familiar with low level audio handling here, but that seems right to me. BTW, I note that when I change audio settings, they often don't reflect until I restart.

MilesParker avatar Sep 15 '22 19:09 MilesParker

@MilesParker Can you try to reproduce this issue with the latest Surge XT nightly? Thanks!

mkruselj avatar Apr 05 '23 19:04 mkruselj

Yeah I bet this is 4dcd62c / #6885 exactky

baconpaul avatar Apr 05 '23 19:04 baconpaul

Yup my thoughts exactly!

mkruselj avatar Apr 05 '23 23:04 mkruselj

Yes that sounds exactly like the sequence that was happening for me -- I will verify but won't be able to get to it until tmrw or Friday. Apologies!

MilesParker avatar Apr 05 '23 23:04 MilesParker

Just FYI I have not seen this with any new builds.

MilesParker avatar Jun 07 '23 17:06 MilesParker

Excellent let me close this then. Thanks for getting back to us!

baconpaul avatar Jun 07 '23 20:06 baconpaul