Page 1 of 1

[Solved] Cadence VST plugin path export crashes xsession

Posted: Tue Aug 11, 2015 3:04 pm
by Gwyndaf
I was playing around installing some software under Wine (Akai MPC Essentials), and put the bundled VSTs in ~/.wine/drive_c/Program Files/Common Files/vstplugins and ~/.wine/drive_c/Program Files (x86)/Common Files/vstplugins

Thinking I might try using these in Linux, I added them to the Cadence VST plugins list on the Tweaks panel. Tried refreshing and finding the plugins in Carla, to no success, but not a huge worry as this was just exploratory and the first time I've explored using Windows VST plugins in Linux audio.

This morning I tried to start up the computer and got a session manager message that "Your session only lasted less than 10 seconds..." and .xsession-errors contained a message along the lines of:
export: Files/Common bad variable name
After a lot of searching I discovered that this was (I think) to do with Cadence exporting the environment variable VST_PATH. Deleting the additional Wine VST paths finally got me logged in, so I'm guessing this might be to do with the spaces in ~/.wine/drive_c/Program Files/Common Files/vstplugins being somehow unacceptable as an environment variable (VST_PATH I think).

Now that I know the cause, it's easy enough to work around, just by putting the VSTs in directories without spaces. But just flagging this so others know, or in case there's an easy fix to Cadence so the spaces don't cause problems (if that is indeed the cause)

One strange niggle remains. Although I've removed the offending paths from both Cadence and Carla, in the Carla configuration for plugin paths, the 'reset' button on the VST3 list seems to bring back those bad Wine paths from somewhere, but I can't find where. So, where does the Carla 'reset' information come from (so I can remove the dodgy paths)?
Edit: found the answer to this in carla_shared.py and seems wholly unrelated

Huge thanks as ever.

Re: Cadence VST path export crashes xsession

Posted: Thu Aug 20, 2015 11:01 am
by Gwyndaf
Some progress: it looks like the environment variables for Cadence plugin paths get set for the X session by the following lines in
/etc/X11/Xsession.d/21cadence-session-inject

Code: Select all

export LADSPA_PATH=`$INSTALL_PREFIX/bin/cadence-session-start --printLADSPA_PATH`
export DSSI_PATH=`$INSTALL_PREFIX/bin/cadence-session-start --printDSSI_PATH`
export LV2_PATH=`$INSTALL_PREFIX/bin/cadence-session-start --printLV2_PATH`
export VST_PATH=`$INSTALL_PREFIX/bin/cadence-session-start --printVST_PATH`
From my little Linux knowledge, I know the ` ` back-ticks will expand that command, so will effectively run cadence-session-start to get the relevant plugin paths from Cadence (standard and user-added) and export this result into the relevant environment variable.

This works fine for exporting from the command line. But, for some reason, when it's run automatically as part of the X session startup it truncates when it reaches a space in a path name. For a single path with a space in, it's relatively benign and just truncates to the first non-space characters (so the plugin path won't work, but has no wider system impact). But, for a second path with a space, seems to prevent the whole session starting, which is what I was experiencing.

A solution/workaround seems to be: wrap in double quotation marks the export lines in 21cadence-session-inject, so the whole cadence-session-start output is exported as a string, including spaces. So the above lines become:

Code: Select all

export LADSPA_PATH="`$INSTALL_PREFIX/bin/cadence-session-start --printLADSPA_PATH`"
export DSSI_PATH="`$INSTALL_PREFIX/bin/cadence-session-start --printDSSI_PATH`"
export LV2_PATH="`$INSTALL_PREFIX/bin/cadence-session-start --printLV2_PATH`"
export VST_PATH="`$INSTALL_PREFIX/bin/cadence-session-start --printVST_PATH`"
Although my original problem was with VST_PATH pointing to multiple Wine directories with spacey Windows pathnames, I guess if this helps and has no negative impact, it's safe to apply to other plugin paths as well.

I've tested this on a couple of machines and it seems to work ok right now. I'll keep this tweak running for a while to ensure it doesn't throw up anything nasty. But might this be a useful change to the 21cadence-session-inject file in the Cadence files?

Re: [Solved] Cadence VST plugin path export crashes xsession

Posted: Thu Aug 20, 2015 4:11 pm
by Gwyndaf
Excellent. Just came through in the update. Thanks!