Page 1 of 2
Building SWH Plugins on OSX
Posted: Sat May 03, 2014 2:57 pm
by tresf
Edit:
THIS ISSUE IS CLOSED.
THESE HAVE BEEN SUCCESSFULLY BUILT WITH A FEW MINOR CHANGES.
PLEASE FIND THE CHANGES UPSTREAM HERE:
Hi!
This question is a reach-out to the Audacity community for some building advice...
I see Audacity supports the SWH plugins on OSX, which the LMMS project is trying to support as well.
First question: Do you use a custom build of the SWH plugins that fixes the compiler strictness on OS X?
Second question: Even after building them for LMMS, I'm having a hard time getting them to load. Any platform specific code to get them to load properly?
I'll cross-link our bug report:
https://github.com/LMMS/lmms/issues/663
Thanks for reading and I hope this message is well received!
-Tres
Re: Building SWH Plugins on OSX
Posted: Sun May 04, 2014 4:13 pm
by Gale Andrews
Unfortunately we can't really help you.
We never built the swh plug-ins for OS X, rather we use Ardour's build of them.
Ardour stopped distributing the swh plug-ins for OS X because they found them unstable in their application. They told me:
many of swh's plugins are unsafe for use on OS X and have been for many years. swh did not use __attribute__((destructor|constructor)) and instead used the much older unix convention of declaring "init" and "fini" methods. These are not executed on OS X, and so various global variables are not initialized (and many not even be valid for use)."
However after extensive testing we found the plug-ins stable in Audacity so continue to distribute them.
Gale
Re: Building SWH Plugins on OSX
Posted: Tue May 06, 2014 2:04 am
by tresf
Gale Andrews wrote:Unfortunately we can't really help you.
We never built the swh plug-ins for OS X, rather we use Ardour's build of them.
Ardour stopped distributing the swh plug-ins for OS X because they found them unstable in their application. They told me:
many of swh's plugins are unsafe for use on OS X and have been for many years. swh did not use __attribute__((destructor|constructor)) and instead used the much older unix convention of declaring "init" and "fini" methods. These are not executed on OS X, and so various global variables are not initialized (and many not even be valid for use)."
However after extensive testing we found the plug-ins stable in Audacity so continue to distribute them.
Gale
Gale,
Thank you for the valuable information. We just ran into something like this with Calf plugins here (looks identical really... could it be that simple?): (LMMS Issue
#668)
I've spent the last week using trial and error to
patch the SWH code to *at least compile* with Clang (just small syntax fixes to get Clang to proceed). It is quite ironic that these SWH plugins work so well for the Audacity application but not Ardour. I tried the ones from the downloads section and they did not work when dropping them into LMMSs LADSPA directory. This did (and still does) leave me a bit hopeful as to getting them to "plug-in" to our software.
I contacted Steve Harris (the author of SWH) and he has created a GitHub repo for them and says he will accept upstream fixes if anyone offers them but has no plans to continue maintaining them.
So... Since Ardour, Audacity and LMMS could benefit from keeping them around, I'd like to make this happen.

Wishful thinking...
Well, I'll run with the information you've so generously provided and post back if I get any progress. I invite the Audacity OSX build maintainer to use our fork (mine until merged into stable)
https://github.com/tresf/lmms/tree/stab ... Effect/swh
-Tres
Re: Building SWH Plugins on OSX
Posted: Tue May 06, 2014 3:07 am
by tresf
Confirmed, this seems to do it.
https://github.com/LMMS/lmms/issues/663 ... t-42263961
Who is your contact at Ardour? Can you link them this thread?
Re: Building SWH Plugins on OSX
Posted: Tue May 06, 2014 12:57 pm
by tresf
Re: Building SWH Plugins on OSX
Posted: Tue May 06, 2014 8:05 pm
by Gale Andrews
Hi Tres,
Thanks.
I let Paul Davis at Ardour know and gave him this topic URL.
So presumably you still have to commit the necessary changes to all the plug-in c files in your fork before we could try building them?
Gale
Re: Building SWH Plugins on OSX
Posted: Wed May 14, 2014 8:20 pm
by tresf
Gale Andrews wrote:tresf wrote:Presumably you still have to commit the necessary changes to all the plug-in c files in your fork before we could try building them?
Here you are:
https://github.com/tresf/ladspa/compare ... r...master
I've been in regular contact with Steve Harris (aka "swh") so these changes aren't unexpected.
Editing the original source code was much easier as it uses a "makestub.pl" script to generate the C source code from XML files, however I had to first issue "autoreconf -i" to get it to properly generate "./configure" script.
I've updated the README to illustrate this, assuming its accepted.
-Tres
Re: Building SWH Plugins on OSX
Posted: Thu May 15, 2014 4:18 pm
by tresf
FYI, these have been accepted upstream.
https://github.com/swh/ladspa/pull/4
Re: Building SWH Plugins on OSX
Posted: Thu May 15, 2014 5:14 pm
by steve
tresf wrote:FYI, these have been accepted upstream.
Excellent

Congratulations on your success.
Re: Building SWH Plugins on OSX
Posted: Thu May 15, 2014 8:10 pm
by Gale Andrews
Thanks, Tres.
It would be good though if you could encourage Steve Harris to update
http://plugin.org.uk/ with that information.
Gale