Chowdhury-DSP / BYOD

Build-your-own guitar distortion!
GNU General Public License v3.0
440 stars 24 forks source link

[BUG] LV2 version of BYOD can't be instantiated by Ardour6.9 #194

Open doojonio opened 2 years ago

doojonio commented 2 years ago

Describe the bug LV2 version of BYOD can't be instantiated by Ardour6.9 but VST3 could (with bug #193)

To Reproduce Steps to reproduce the behavior:

  1. In Ardour6.9 apply BYOD LV2 on audio track
  2. Get an error The plugin "BYOD" could not be loaded. See the Log window for more details (maybe)

Expected behavior BYOD plugin applies on track and interface of BYOD appears

Screenshots Ardour6.9 error image

Desktop (please complete the following information):

Additional context In Ardour6.9 logs the following message appears:

2022-09-17T11:55:20 [ERROR]: LV2: Failed to instantiate plugin https://github.com/Chowdhury-DSP/BYOD

Standalone and VST3 versions successfully start. LV2 version doesn't create any log files. VST3 version create log file with the following content:

**********************************************************
This log file is currently being written to...
Log started: 17 Sep 2022 12:05:04pm

Version: BYOD 1.0.2
Commit: c5e9ec7 on main with JUCE version JUCE v7.0.1
Build: 26 Aug 2022 16:39 on SPB-8CC74614BY.kontur with GNU-12.1.1
System:  with Linux (64-bit) on 12 Core, AMD Ryzen 5 3600 6-Core Processor
Plugin Info: VST3 running in Ardour running at sample rate 0.0 kHz with block size 0

Loading preset: Default
Adding connection from Input, port #0 to Output port #0
Checking OpenGL availability...
OpenGL is available on this system: FALSE
Checking OpenGL availability...
OpenGL is available on this system: FALSE
Checking OpenGL availability...
OpenGL is available on this system: FALSE
Checking OpenGL availability...
OpenGL is available on this system: FALSE
Checking OpenGL availability...
OpenGL is available on this system: FALSE
Loading preset: Instant Metal
Removing connection from Input, port #0 to Output port #0
Creating processor: Metal Face
Creating processor: Amp IRs
Adding connection from Input, port #0 to Metal Face port #0
Adding connection from Amp IRs, port #0 to Output port #0
Adding connection from Metal Face, port #0 to Amp IRs port #0
Exiting gracefully...
jatinchowdhury18 commented 2 years ago

Thanks for reporting this!

A few weeks ago, I updated the plugin to build from JUCE version 7 which has built-in LV2 support (previously the plugin was using a fork of JUCE). It seems that in the JUCE LV2 wrapper, there's some interop issue with Ardour.

Since we're still a ways away from the next official release of BYOD, I decided to upgrade to JUCE7 (since there were other features/fixes I wanted to use) and hope that the relevant parties can figure out a solution before then. In the meantime, if you or anyone else needs to be able to run the plugin in Ardour as an LV2, I would suggest going back to the last stable release (v1.0.1).

doojonio commented 2 years ago

I've compiled Ardour7 pre-release version and in this version plugin can be successfully instantiated. File explorer also works. Now I'm about to compile Ardour6.9 with debug symbols to find out what's wrong with BYOD or with Ardour

doojonio commented 2 years ago

I have debugged BYOD on Ardour6.9. Fail happens because LV2 descriptor returns NULL in instanitate method here. Ardour compiled with 0.24.12 version of lilv library.

The arguments passing in instanitate method are:

76            result->lv2_handle     = ld->instantiate(
(gdb) print ld->URI
$24 = 0x7ffefb6d8998 "https://github.com/Chowdhury-DSP/BYOD"
(gdb) print sample_rate
$25 = 48000
(gdb) print bundle_path
$26 = 0x1aa0130 "/usr/local/lib64/lv2/BYOD.lv2/"
(gdb) print features
$27 = <optimized out>

For unknown reasons I can't step in instantiate method and find out what's wrong

doojonio commented 2 years ago

If I instantiate ardour's stock compressor I can step in instantiate function. Maybe I need to compile BYOD with some debugging options.

Thread 1 "ArdourGUI" hit Breakpoint 8, lilv_plugin_instantiate (plugin=0x23c53e0, sample_rate=48000, features=<optimized out>) at ../src/instance.c:75
75            result->lv2_descriptor = ld;
(gdb) print ld->URI
$28 = 0x7fffe00080f3 "urn:ardour:a-comp#stereo"
(gdb) step
76            result->lv2_handle     = ld->instantiate(
(gdb) step
instantiate (descriptor=0x7fffe0009d80 <descriptor_stereo>, rate=48000, bundle_path=0x4784eb0 "/home/person/Documents/building/ardour/ardour/build/libs/LV2/a-comp.lv2/", features=0x175f300) at ../libs/plugins/a-comp.lv2/a-comp.c:132
132     {
(gdb) next
133             AComp* acomp = (AComp*)calloc(1, sizeof(AComp));
jatinchowdhury18 commented 2 years ago

Yeah, I would guess that some of the methods in both the plugin and host are being optimized away. If you're able to do a debug build for both that would probably make it a bit easier to step through everything.

That's great news that everything is working in Ardour version 7!

38github commented 2 years ago

With the nightly build I managed to at least use the lv2 version with Ardour 7 (I know, not 6.9).

KottV commented 2 years ago

@doojonio try to apply this patch to Ardour 6.9 https://build.opensuse.org/package/view_file/multimedia:proaudio/ardour/LV2-announce-bufz-boundedBlockLength-feature.patch?expand=1