free-audio / clap-host

Reference Host
MIT License
58 stars 15 forks source link

clap-host does not load clap plugins #15

Open symdeb opened 2 years ago

symdeb commented 2 years ago

How to reproduce

  1. Build clap-host locally or using actions on github
  2. Build Dexed or clap-plugins (clap-plugins.clap) from github locally or on github with github actions
  3. Run clap-host
  4. Select File => Load Native Plugin Preset
  5. Select Dexed.clap or clap-plugins.clap
  6. After clicking OPEN nothing happens

Environment

Ubuntu 22.04 with Pipewire

Screenshot from 2022-06-19 00-21-01

Screenshot from 2022-06-19 00-22-28

gdb output

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7ffff681b640 (LWP 79650)] [New Thread 0x7ffff6006640 (LWP 79651)] [New Thread 0x7ffff5805640 (LWP 79652)] [New Thread 0x7ffff5004640 (LWP 79653)] [New Thread 0x7ffff4803640 (LWP 79654)] Failed to load plugin ' "" ': "The shared library was not found." [New Thread 0x7fffdd5ff640 (LWP 79656)] Case insensitive sorting unsupported in the posix collation implementation Numeric mode unsupported in the posix collation implementation

Questions

why does WebMIDI API show up but not the ALSA or Jack MIDI API ? does this mean a plugin can only communicate to broswer based MIDI ports and how would that work ?

Schmitty2005 commented 2 years ago

Same problem here....Failed to load plugin ' "" ': "The shared library was not found." Ubuntu 22.04 LTS. I was able to pick ALSA or JACK audio server.

symdeb commented 2 years ago

@Schmitty2005. Thanks! I wonder you can see those because my use case is with PW . Though even with that ALSA and JACK API's are still available. Pipewire emulates Jack and PW runs on top of ALSA, Not clear how it accesses the Browser WebMIDI API.

Tried the u-he beta plugins and don't load. (https://u-he.com/community/clap/) Build the clap-plugins locally and don't load.

Debugging this, this is the code in main-window.cc. The code does get the filename but executing it results in nothing. _application.engine()->pluginHost().loadNativePluginPreset(file.toStdString());

There is absolutely zero comments in the code, so need the plumb a bit further to find where it goes wrong it's all Qt and new to me.

So: the reason is this:

bool PluginHost::loadNativePluginPreset(const std::string &path) { checkForMainThread(); if (!_pluginPresetLoad) return false;

This fails and return with an error but w/o any dialog, or console output. pluginPresetLoad is a global object defined default as nullptr in plugin-host.cc initPluginExtensions() seem to initialize pluginPresetLoad but this function it is not called before loadNativePluginPreset. No idea where it should be called, so furher plumping need support from more knowledgable folks. Would assume the developers have a working skeleton of a host to test plugins. Maybe that's not this one. Since CLAP is C code, just I hope the devs can provide a simple C host and plugin for reference, perhaps using Gtk4 as the GUI.

abique commented 2 years ago

Try to launch from command line and pass -p path-to-plugin.clap.

Serdnad commented 1 month ago

-p path-to-plugin.clap worked for me where the long form --plugin path-to-plugin.clap wouldn't