Cabbage Logo
Back to Cabbage Site

VST makes OBS crash on startup

Running Cabbage 2.8.0 + OBS 27.2.4 on Windows 10. Seems to happen with any exported VST, including the examples.

  1. Export as VST
  2. Copy the necessary files to one of obs-vst’s accepted folders:
    • %ProgramFiles%\Steinberg\VstPlugins\
    • %ProgramFiles%\Common Files\Steinberg\Shared Components\
    • %ProgramFiles%\Common Files\VST2\
    • %ProgramFiles%\Common Files\VSTPlugins\
    • %ProgramFiles%\VSTPlugins\
  3. Start OBS
  4. On “Audio Mixer”, click the gear icon for any output and then “Filter”
  5. Select the “+” icon below and then “VST 2.x Plugin”
  6. On the dropdown menu, select the exported VST
  7. Close everything (including OBS) and try to run it again - it’ll instantly crash

This was already recorded to happen with another VST, and as I’ve checked with Process Explorer the underlying cause is the same: somehow, the VST changes the working directory of the host to its own.
Afterwards, OBS tries to load some other files, gets lost, crashes and burns.

What could be the cause behind this?

huff, puff, huff

After some backtracking on the DLL, courtesy of Ghidra, I managed to find the two functions there which call Windows for modifying the working directory - both on CsoundPluginProcessor: setupAndCompileCsound and initAllCsoundChannels.

Both of them call csdFilePath.setAsCurrentWorkingDirectory(), which does exactly as described… on the host itself, even, it seems.

Hi @ElSaico, welcome the the forum.

This is done so that the Csound/Cabbage can find/load all the assets relative to the csd directory. This has caused no issues in any other hosts but it’s probably bad practice. Leave it with me. I’m sure I can find a workaround. :+1:

1 Like

FWIW, this is now fixed and Cabbage no longer changes the current working directory.