Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some LADSPA Plugins do not load properly (Apple) #663

Closed
tresf opened this issue Apr 30, 2014 · 9 comments
Closed

Some LADSPA Plugins do not load properly (Apple) #663

tresf opened this issue Apr 30, 2014 · 9 comments

Comments

@tresf
Copy link
Member

@tresf tresf commented Apr 30, 2014

Opening a sample project which uses certain LADSPA plugins throws multiple errors on Apple (i.e. unfa-Spoken.mmpz)
image

This is most likely due to the LADSPA PLUGIN PATHS being set incorrect on Apple:
Currently set to:

../lib/ladspa/   (or /Applications/LMMS.app/Contents/MacOS/../lib/ladspa/)

should be

 ../lib/lmms/ladspa/   (or /Applications/LMMS.app/Contents/MacOS/../lib/lmms/ladspa/)

image

Will patch src/core/config_mgr.cpp with Apple IFDEF.

@tresf
Copy link
Member Author

@tresf tresf commented Apr 30, 2014

So I've made these changes and confirmed all 117 plugins are in the LADSPA PLUGINS PATH, but the SWH stuff still won't list in the Add effect screen. This tells me there is some platform specific issues keeping them from loading.

If there any platform specific code I should look for? Any recommendations are appreciated.

What I see for swh compile time options are:

    IF(LMMS_BUILD_WIN32)
        ADD_CUSTOM_COMMAND(TARGET "${_plugin}" POST_BUILD COMMAND "${STRIP}" "\"${CMAKE_CURRENT_BINARY_DIR}/${_plugin}.dll\"")
    ELSE(LMMS_BUILD_WIN32)
        SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC -DPIC")
    ENDIF(LMMS_BUILD_WIN32)
    IF(LMMS_BUILD_APPLE)
        SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES LINK_FLAGS "${LINK_FLAGS} -Bsymbolic -lm")
    ELSE(LMMS_BUILD_APPLE)
        SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined -Wl,-Bsymbolic -lm")
    ENDIF(LMMS_BUILD_APPLE)
    IF(LMMS_BUILD_LINUX)
        SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES LINK_FLAGS "${LINK_FLAGS} -nostartfiles")
    ENDIF(LMMS_BUILD_LINUX)

Update, I tried a few more options (comparing them to working plugins) to no avail. Seems most CPP plugins work however the SWH C plugins just don't show up.

@tresf
Copy link
Member Author

@tresf tresf commented May 1, 2014

So I'm going to step back a bit here and reopen the swh compatibility conversation...

The ONLY swh plugins that are incompatible with Clang are gong_1424.c, imp_1199.c, sifter_1210.c This means if we blacklist those on OSX until they are patched, we have SWH plugins built with the latest version of clang. (that's 92 of 95 functional plugins!). My test was to rename those three plugins from .c to .bak, which allows the swh plugins to build properly.

Unfortunately, even the Clang built SWH plugins still don't list in the available plugins. There must be a platform specific setting I'm missing... any idea @tobydox? @softrabbit?

List of .SO Files
image

OS X versus Windows 8
image

-Tres

@tresf
Copy link
Member Author

@tresf tresf commented May 2, 2014

Fixed the dredged waveguide error per commit: tresf@e2c3e65

ERROR LINKING gong_1424.o
Undefined symbols for architecture x86_64:
"_waveguide_nl_process", referenced from:
_runGong in gong_1424.o
_runAddingGong in gong_1424.o

One down, two to go. :)

@tresf
Copy link
Member Author

@tresf tresf commented May 2, 2014

Next error is:

ERROR LINKING imp_1199.o
Undefined symbols for architecture x86_64:
   "_mk_imps", referenced from:
      _instantiateImp in imp_1199.o
ld: symbol(s) not found for architecture x86_64

When commenting out all of the MK_IMP lines in all.h, it compiles, suggesting the guitar header files are poor syntax (defining constant globals using header files).

@tresf tresf changed the title LADSPA Plugins do not load properly (Apple) Some LADSPA Plugins do not load properly (Apple) May 3, 2014
@tresf
Copy link
Member Author

@tresf tresf commented May 6, 2014

I've reached out to the Audacity team (they still use SWH on Apple) and they claim to be using an Ardour build. Ironically Ardour has dropped support for SWH on Apple, this is what Ardour said:

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)."

Isn't this a duplicate of #668?

@tresf
Copy link
Member Author

@tresf tresf commented May 6, 2014

Turns out the ((destructor|constructor)) was preventing SWH plugins from loading on Apple.

I haven't tested the audio, but after applying the __init() fix from #668 to LadspaEffect/swh/butterworth_1902.c, the plugin show up in LMMS.

Edit: Tested and working. :) http://youtu.be/djAvhrE2ZrE

screen shot 2014-05-05 at 10 48 15 pm

@tresf
Copy link
Member Author

@tresf tresf commented May 13, 2014

Closed per pull request #685 and commit 9049660.

@tresf tresf closed this May 13, 2014
@tresf
Copy link
Member Author

@tresf tresf commented May 14, 2014

FYI, pushed upstream:
swh/ladspa#4

@tresf
Copy link
Member Author

@tresf tresf commented May 15, 2014

FYI, accepted upstream:
swh/ladspa#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant