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

No matching function for call to plugin_holder_t(,) #21

Closed
Lucki opened this issue May 22, 2020 · 8 comments
Closed

No matching function for call to plugin_holder_t(,) #21

Lucki opened this issue May 22, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@Lucki
Copy link

Lucki commented May 22, 2020

I'm having problems building the ladspa variant of this plugin and the vst sdk is now at version 3 and missing necessary files for building that part.
I'm building on an up-to-date Arch Linux in a clean build environment but the build is also failing on my main machine.

Let me know if there's something more you need to figure out what is going on.

The failing log for the ladspa plugin
$ LC_ALL=C make
[ 50%] Built target RnNoise
[ 64%] Built target RnNoisePluginCommon
[ 85%] Built target rnnoise_lv2
[ 92%] Building CXX object src/ladspa_plugin/CMakeFiles/rnnoise_ladspa.dir/RnNoiseLadspaPlugin.cpp.o
In file included from /home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/RnNoiseLadspaPlugin.h:3,
                 from /home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/RnNoiseLadspaPlugin.cpp:1:
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:148:20: error: 'int32_t' does not name a type
  148 |             static int32_t sfinae( decltype( U( any( ) ) ) * );
      |                    ^~~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:150:20: error: 'int8_t' does not name a type
  150 |             static int8_t sfinae( ... );
      |                    ^~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:154:29: error: 'sfinae' was not declared in this scope
  154 |                     sizeof( sfinae<T>( nullptr ) ) == sizeof( int32_t );
      |                             ^~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:154:37: error: expected primary-expression before '>' token
  154 |                     sizeof( sfinae<T>( nullptr ) ) == sizeof( int32_t );
      |                                     ^
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:154:63: error: 'int32_t' was not declared in this scope
  154 |                     sizeof( sfinae<T>( nullptr ) ) == sizeof( int32_t );
      |                                                               ^~~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:175:30: error: 'size_t' does not name a type
  175 |             static constexpr size_t value = -1;
      |                              ^~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:26:1: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
   25 | #include "ladspa.h"
  +++ |+#include <cstddef>
   26 | 
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:181:30: error: 'size_t' does not name a type
  181 |             static constexpr size_t value = 0;
      |                              ^~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:181:30: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:187:30: error: 'size_t' does not name a type
  187 |             static constexpr size_t value
      |                              ^~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:187:30: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h: In instantiation of 'static void* ladspa::builder<Plugin>::_instantiate(const _LADSPA_Descriptor*, ladspa::sample_rate_t) [with _Plugin = RnNoiseMono; Plugin = RnNoiseMono; LADSPA_Handle = void*; ladspa::sample_rate_t = long unsigned int]':
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:924:44:   required from 'constexpr const LADSPA_Descriptor ladspa::builder<RnNoiseMono>::descriptor_for_ladspa'
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:948:18:   required from 'static const LADSPA_Descriptor& ladspa::builder<Plugin>::get_ladspa_descriptor() [with Plugin = RnNoiseMono; LADSPA_Descriptor = _LADSPA_Descriptor]'
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:994:38:   required from 'static constexpr std::array<ladspa::collection<Args>::caller, sizeof... (Args)> ladspa::collection<Args>::init_callers() [with Args = {RnNoiseMono, RnNoiseStereo}]'
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:998:31:   required from 'constexpr const std::array<ladspa::collection<RnNoiseMono, RnNoiseStereo>::caller, 2> ladspa::collection<RnNoiseMono, RnNoiseStereo>::callers'
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:1007:23:   required from 'static const LADSPA_Descriptor* ladspa::collection<Args>::get_ladspa_descriptor(ladspa::plugin_index_t) [with Args = {RnNoiseMono, RnNoiseStereo}; LADSPA_Descriptor = _LADSPA_Descriptor; ladspa::plugin_index_t = long unsigned int]'
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/RnNoiseLadspaPlugin.h:144:52:   required from here
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:877:20: error: no matching function for call to 'ladspa::plugin_holder_t<RnNoiseMono>::plugin_holder_t(ladspa::helpers::identity<RnNoiseMono>, ladspa::sample_rate_t&)'
  877 |             return new _plugin_holder_t(helpers::identity<Plugin>(), s);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:819:9: note: candidate: 'template<class _Plugin, ladspa::helpers::en_if_doesnt_have<_Plugin, ladspa::helpers::has_ctor_1_args>* <anonymous> > ladspa::plugin_holder_t<Plugin>::plugin_holder_t(ladspa::helpers::identity<_Plugin>, ladspa::sample_rate_t) [with _Plugin = _Plugin; ladspa::helpers::en_if_doesnt_have<_Plugin, ladspa::helpers::has_ctor_1_args>* <anonymous> = <anonymous>; Plugin = RnNoiseMono]'
  819 |         plugin_holder_t(helpers::identity<_Plugin>,
      |         ^~~~~~~~~~~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:819:9: note:   template argument deduction/substitution failed:
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:813:9: note: candidate: 'template<class _Plugin, ladspa::helpers::en_if_has<_Plugin, ladspa::helpers::has_ctor_1_args>* <anonymous> > ladspa::plugin_holder_t<Plugin>::plugin_holder_t(ladspa::helpers::identity<_Plugin>, ladspa::sample_rate_t) [with _Plugin = _Plugin; ladspa::helpers::en_if_has<_Plugin, ladspa::helpers::has_ctor_1_args>* <anonymous> = <anonymous>; Plugin = RnNoiseMono]'
  813 |         plugin_holder_t(helpers::identity<_Plugin>,
      |         ^~~~~~~~~~~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:813:9: note:   template argument deduction/substitution failed:
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:802:11: note: candidate: 'ladspa::plugin_holder_t<RnNoiseMono>::plugin_holder_t(const ladspa::plugin_holder_t<RnNoiseMono>&)'
  802 |     class plugin_holder_t
      |           ^~~~~~~~~~~~~~~
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:802:11: note:   candidate expects 1 argument, 2 provided
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:802:11: note: candidate: 'ladspa::plugin_holder_t<RnNoiseMono>::plugin_holder_t(ladspa::plugin_holder_t<RnNoiseMono>&&)'
/home/lucki/git_clones/noise-suppression-for-voice/src/ladspa_plugin/ladspa++.h:802:11: note:   candidate expects 1 argument, 2 provided
make[2]: *** [src/ladspa_plugin/CMakeFiles/rnnoise_ladspa.dir/build.make:83: src/ladspa_plugin/CMakeFiles/rnnoise_ladspa.dir/RnNoiseLadspaPlugin.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:260: src/ladspa_plugin/CMakeFiles/rnnoise_ladspa.dir/all] Error 2
make: *** [Makefile:150: all] Error 2
@werman
Copy link
Owner

werman commented May 22, 2020

Interesting, since you have latest Arch Linux, maybe something changed in gcc 10... Thank you for reporting, I'll check later today. However, I I'm not really surprised, because MSVC even crashes on these fancy templates.

@werman werman added the bug Something isn't working label May 22, 2020
@werman werman closed this as completed in 49c0ae1 May 22, 2020
@werman
Copy link
Owner

werman commented May 22, 2020

Was much easier than from the first glance at the error.

@Lucki
Copy link
Author

Lucki commented May 22, 2020

Thanks! Here's a pkgbuild in exchange:

PKGBUILD
# Contributor: Lucki <https://aur.archlinux.org/account/Lucki>
# shellcheck disable=SC2034,2154,2148

pkgbase="noise-suppression-for-voice"
pkgname=('noise-suppression-for-voice-ladspa' 'noise-suppression-for-voice-lv2' 'noise-suppression-for-voice-vst')
pkgver=0.9
pkgrel=1
pkgdesc="A real-time noise suppression plugin for voice based on Xiph's RNNoise."
arch=('i686' 'x86_64')
url="https://github.com/werman/noise-suppression-for-voice"
license=('GPL3')
depends=('gcc-libs')
makedepends=('cmake' 'ninja')
_commit="c79e7a1787e64f073683c2aa7bd1fd312d421d1c"
source=("$pkgbase-$pkgver.src.tar.gz::https://github.com/werman/$pkgbase/archive/$_commit.tar.gz"
        # temporary build at commit to fix build errors
        #"$pkgbase-$pkgver.src.tar.gz::https://github.com/werman/$pkgbase/archive/v$pkgver.tar.gz"
        "$pkgbase.vstsdk2_4.zip::https://archive.org/download/VST2SDK/vstsdk2_4.zip"
        "$pkgbase-VAD-treshold.patch")
sha512sums=('f11257a35cbe32a6e6cfe4b65f584839e16d0b84601280ad0dddf6a1dd58881c82de5aff4fb3aa8d1b9afdbc57e2b2a3760f02b86c1a9fcd97eb1efda9c6c335'
            '48a56d10a6b5c5dbf6e3087b17e22073dfcf766b3b014c8913ac95a1c6f9dfa3d947734f066799d1979ccae779f5961c88b557bfc3fe1eb579cc52f922b4689a'
            'c0c35dabc488d12f31fd4706c0131d7ee167eeaec8cbf244fce81dfd58019ec17470a03be4bd1dd227f2621a39cca082c8e72254bf74e5ac70b664873d02dbca')

prepare() {
    # temporary build at commit to fix build errors
    mv "$pkgbase-$_commit" "$pkgbase-$pkgver"

    cd "$pkgbase-$pkgver" || exit

    # Set voice activation detection treshold to 0.95 for LV2 until it's adjustable
    patch --forward --strip=1 --input="$srcdir/$pkgbase-VAD-treshold.patch"

    # Move vst sdk files in place
    cp -dpr --no-preserve=ownership "$srcdir/vstsdk2.4/public.sdk/source/vst2.x/." "src/vst_plugin/vst2.x/"
    cp -dpr --no-preserve=ownership "$srcdir/vstsdk2.4/pluginterfaces/vst2.x/." "src/vst_plugin/pluginterfaces/vst2.x/"
}

build() {
    # https://wiki.archlinux.org/index.php/CMake_package_guidelines#Fixing_the_CPPFLAGS_problem
    export CFLAGS+=" ${CPPFLAGS}"
    export CXXFLAGS+=" ${CPPFLAGS}"
    cmake \
        -B "$pkgbase-$pkgver/build" \
        -S "$pkgbase-$pkgver" \
        -DCMAKE_BUILD_TYPE="None" \
        -DCMAKE_INSTALL_PREFIX="/usr" \
        -G "Ninja" \
        -Wno-dev
    cmake --build "$pkgbase-$pkgver/build"
}

package_noise-suppression-for-voice-ladspa() {
    pkgdesc="A real-time noise suppression plugin for voice based on Xiph's RNNoise. (LADSPA)"

    DESTDIR="$pkgdir/" cmake --install "$pkgbase-$pkgver/build"

    # rename to package name
    mv "$pkgdir/usr/lib/ladspa/librnnoise_ladspa.so" "$pkgdir/usr/lib/ladspa/${pkgname[0]}.so"

    # remove other plugin variants
    rm -rf "$pkgdir/usr/lib/lv2"
}

package_noise-suppression-for-voice-lv2() {
    pkgdesc="A real-time noise suppression plugin for voice based on Xiph's RNNoise. (LV2)"

    # the install target is missing some files
    # DESTDIR="$pkgdir/" cmake --install "$pkgbase-$pkgver/build"
    mkdir -p "$pkgdir/usr/lib/lv2/${pkgname[1]}"
    cp -dpr --no-preserve=ownership "$pkgbase-$pkgver/build/bin/rnnoise.lv2/." "$pkgdir/usr/lib/lv2/${pkgname[1]}/"
}

package_noise-suppression-for-voice-vst() {
    pkgdesc="A real-time noise suppression plugin for voice based on Xiph's RNNoise. (VST)"

    # there's no install target for this variant
    # DESTDIR="$pkgdir/" cmake --install "$pkgbase-$pkgver/build"
    install -Dm644 "$pkgbase-$pkgver/build/bin/vst/librnnoise_vst.so" "$pkgdir/usr/lib/lxvst/${pkgname[2]}.so"
}
noise-suppression-for-voice-VAD-treshold.patch
diff --git a/src/lv2_plugin/RnNoiseLv2Plugin.cpp b/src/lv2_plugin/RnNoiseLv2Plugin.cpp
index 05e8934..4a9f6ce 100644
--- a/src/lv2_plugin/RnNoiseLv2Plugin.cpp
+++ b/src/lv2_plugin/RnNoiseLv2Plugin.cpp
@@ -39,7 +39,7 @@ void RnNoiseLv2Plugin::run(uint32_t sample_count) {
     PluginBase::run(sample_count);

     if (m_inPort != nullptr && m_outPort != nullptr) {
-        m_rnNoisePlugin->process(m_inPort, m_outPort, sample_count, 0);
+        m_rnNoisePlugin->process(m_inPort, m_outPort, sample_count, 0.95);
     }
 }

@werman
Copy link
Owner

werman commented May 22, 2020

Thanks! I've been thinking about adding it to aur since I'm also using arch. I thought about generating some default pulse audio config, but I'm not sure.

Also VAD threshold is configurable.

@Lucki
Copy link
Author

Lucki commented May 22, 2020

Also VAD threshold is configurable.

Hm, jalv wants a control variable but wasn't listening to control, how can I modify the VAD treshold?
-c SYM=VAL Set control value (e.g. "vol=1.4")

I thought about generating some default pulse audio config, but I'm not sure.

I've set up jack years ago because these things are really cumbersome in pulse. So I can't really help you there. I'm using the lv2 variant with jack, setting that up was much easier.

@werman
Copy link
Owner

werman commented May 22, 2020

Hm, jalv wants a control variable but wasn't listening to control, how can I modify the VAD treshold?

Ah, sorry, I didn't see that it is lv2.

I've set up jack years ago because these things are really cumbersome in pulse. So I can't really help you there. I'm using the lv2 variant with jack, setting that up was much easier.

I should try to set it up one day...

Does jack continue to pass data to lv2 plugin when there is no app using the output? (Like pulseaudio does)

@Lucki
Copy link
Author

Lucki commented May 22, 2020

I'm by no means an expert in these things but here's what I figured out by getting this plugin working :)

  • jack itself can't load plugins
  • the lv2 plugin can be loaded by programs which expose input and output connectors to jack
  • these programs can be as complex as you want, some allow multiple plugins at a time so you can get a full equalizer (eg. ardour)
  • these programs can expose inputs to set control values of the plugins, I think they can even have multiple control values
  • I've chosen jalv since this is the only plugin I use and want something simple. (TeamSpeaks voice recognition is awful)

Does jack continue to pass data to lv2 plugin when there is no app using the output?

I think this is a yes? Jack doesn't know if there's something connected to output of the plugin handling program. doing meaningful things with the input. The program itself however could be smart enough to not do anything if that's the case. Don't know if jalv is.

I guess you're referring to #15 where your screenshot shows 10% cpu usage while idle? Right now while in use it's using 1% cpu for the lv2 plugin (jalv) here.

grafik

@werman
Copy link
Owner

werman commented May 22, 2020

Ok, thanks!

micsthepick pushed a commit to micsthepick/noise-supression-for-voice-test that referenced this issue Apr 6, 2023
micsthepick pushed a commit to micsthepick/noise-supression-for-voice-test that referenced this issue Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants