LSP Project

Discuss anything new and newsworthy! See http://planet.linuxaudio.org and https://libreav.org/news for more Linux Audio News!

Announcements of proprietary software may fit better in the Marketplace.


Moderators: raboof, MattKingUSA, khz

User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

falkTX wrote:No more errors found in the ttl files. Good work.
FIXED. Reloaded binaries.

Happy new year!
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

falkTX wrote:@sadko4u: where's the best place to report bugs and send patches etc?
You may leave all stuff here.
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

Currently what I've met with Carla.
After instantiating widget, I set parent-set signal:

Code: Select all

g_signal_connect (G_OBJECT (pWidget), "parent-set", G_CALLBACK (gtk_window_set_parent), this);
Then, in the set_parent handler I connect map and unmap signals:

Code: Select all

    void Gtk2Window::gtk_window_set_parent(GtkWidget *widget, GtkObject *prev, gpointer p_this) // static
    {
        Gtk2Window *_this = reinterpret_cast<Gtk2Window *>(p_this);
        lsp_trace("_this=%p, _this->pWidget=%p, _this->bMapped=%d, _this->Function=%x", _this, _this->pWidget, _this->bMapped ? 1 : 0, int(_this->hFunction));
        if (_this != NULL)
            _this->set_parent(widget);
    }

    void Gtk2Window::set_parent(GtkWidget *parent)
    {
        // Change size
        GtkWidget *toplevel = gtk_widget_get_toplevel(pWidget);
        if (gtk_widget_is_toplevel (toplevel) && (GTK_IS_WINDOW(toplevel)))
        {
            pToplevel   = toplevel;

            // ...
            // Due to having artifacts with some cairo elements on expose() we have to periodically redraw the entire window
            hMapHandler     = g_signal_connect(pToplevel, "map", G_CALLBACK(map_window), gpointer(this));
            lsp_trace("Added map handler %x", int(hMapHandler));
            hUnmapHandler   = g_signal_connect(pToplevel, "unmap", G_CALLBACK(unmap_window), gpointer(this));
            lsp_trace("Added unmap handler %x", int(hUnmapHandler));
        }
    }
In the map and unmap events I'm starting/stoping redraw timer:

Code: Select all

    void Gtk2Window::map_window(GtkWidget *widget, gpointer ptr) // static
    {
        Gtk2Window *_this   = reinterpret_cast<Gtk2Window *>(ptr);
        lsp_trace("_this=%p, _this->pWidget=%p, _this->bMapped=%d, _this->Function=%x", _this, _this->pWidget, _this->bMapped ? 1 : 0, int(_this->hFunction));
        if ((_this != NULL) && (!_this->bMapped))
        {
            _this->hFunction    = g_timeout_add (500, redraw_window, _this); // Schedule at 2 hz rate
            _this->bMapped      = true;
        }
    }

    void Gtk2Window::unmap_window(GtkWidget *widget, gpointer ptr) // static
    {
        Gtk2Window *_this   = reinterpret_cast<Gtk2Window *>(ptr);
        lsp_trace("_this=%p, _this->pWidget=%p, _this->bMapped=%d, _this->Function=%x", _this, _this->pWidget, _this->bMapped ? 1 : 0, int(_this->hFunction));
        if ((_this != NULL) && (_this->bMapped))
        {
            if (_this->hFunction)
                g_source_remove(_this->hFunction);
            _this->bMapped      = false;
            _this->hFunction    = 0;
        }
    }
And here is the code of redraw:

Code: Select all

    gboolean Gtk2Window::redraw_window(gpointer ptr) // static
    {
        Gtk2Window *_this = reinterpret_cast<Gtk2Window *>(ptr);
        lsp_trace("_this=%p, _this->pWidget=%p, _this->bMapped=%d, _this->Function=%x", _this, _this->pWidget, _this->bMapped ? 1 : 0, int(_this->hFunction));
        if ((_this != NULL) && (_this->pWidget != NULL) && (_this->bMapped))
            gtk_widget_queue_draw(_this->pWidget);
        return TRUE;
    }
So, what's done from Carla. Here is the backlog:
[Gtk2Window.cpp: 182] gtk_window_set_parent: _this=0x171e7c0, _this->pWidget=0x16eee40, _this->bMapped=0, _this->Function=0
[Gtk2Window.cpp: 173] set_parent: Added map handler b
[Gtk2Window.cpp: 175] set_parent: Added unmap handler c
[Gtk2Window.cpp: 199] map_window: _this=0x171e7c0, _this->pWidget=0x16eee40, _this->bMapped=0, _this->Function=0
[Gtk2Window.cpp: 190] redraw_window: _this=0x171e7c0, _this->pWidget=0x16eee40, _this->bMapped=1, _this->Function=4
[Gtk2Window.cpp: 190] redraw_window: _this=0x171e7c0, _this->pWidget=0x16eee40, _this->bMapped=1, _this->Function=4
When closing window, there is no unmap event handler called that I set on parent-set signal handler.
Also there is no cleanup called for LV2 UI instance that could remove map, unmap and timer signal handlers.
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

The following messages mean that due to some currently unknown reasons Carla doesn't like custom GTK2+ widgets.
Because class descriptors are global variables in the library, I guess that dlclose or something else happens before correct UI window finalization.
(carla-bridge-lv2-gtk2:29175): GLib-GObject-WARNING **: invalid uninstantiatable type '<invalid>' in cast to 'Gtk2CustomWidget-v0'
(carla-bridge-lv2-gtk2:29175): GLib-GObject-WARNING **: invalid uninstantiatable type '(null)' in cast to 'Gtk2CustomWidget-v0'
(carla-bridge-lv2-gtk2:29175): GLib-GObject-WARNING **: invalid uninstantiatable type '(null)' in cast to 'CustomGtkFrame-v0'
(carla-bridge-lv2-gtk2:29175): GLib-GObject-WARNING **: invalid uninstantiatable type '(null)' in cast to 'Gtk2CustomWidget-v0'
(carla-bridge-lv2-gtk2:29175): GLib-GObject-WARNING **: invalid uninstantiatable type '(null)' in cast to 'Gtk2CustomWidget-v0'
(carla-bridge-lv2-gtk2:29175): GLib-GObject-WARNING **: invalid uninstantiatable type '(null)' in cast to 'Gtk2CustomWidget-v0'
(carla-bridge-lv2-gtk2:29175): GLib-GObject-WARNING **: invalid uninstantiatable type '(null)' in cast to 'CustomGtkFrame-v0'
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

I'm working now on porting sources to VST.

I've built Carla from GIT under openSUSE. Works stable.
But don't know how to enable VST support in Ardour. It seems like Ardour doesn't even try to discover VST plugins in the system.
I've tried to manually set up LXVST_PATH environment variable in the start script of Ardour but it still didn't matter.
Do I need to build Ardour manually for VST support?

Still Carla doesn't support UTF-8 umlauts on LV2 but displays them well for VSTs.

The previously mentioned GTK issues were fixed but still binaries are not published until generic VST support will be done.
LSP (Linux Studio Plugins) Developer and Maintainer.
asbak
Established Member
Posts: 897
Joined: Thu Sep 11, 2014 3:04 pm
Has thanked: 71 times
Been thanked: 64 times

Re: LSP Project

Post by asbak »

I think it needs some special method for installing Windows VST support, Linux VST should work fine.

Look at Edit/Preferences/Plugins
Some Focal / 20.04 audio packages and resources https://midistudio.groups.io/g/linuxaudio
User avatar
GMaq
Established Member
Posts: 2774
Joined: Fri Sep 25, 2009 1:42 pm
Has thanked: 520 times
Been thanked: 555 times

Re: LSP Project

Post by GMaq »

sadko4u wrote:I'm working now on porting sources to VST.

I've built Carla from GIT under openSUSE. Works stable.
But don't know how to enable VST support in Ardour. It seems like Ardour doesn't even try to discover VST plugins in the system.
I've tried to manually set up LXVST_PATH environment variable in the start script of Ardour but it still didn't matter.
Do I need to build Ardour manually for VST support?

Still Carla doesn't support UTF-8 umlauts on LV2 but displays them well for VSTs.

The previously mentioned GTK issues were fixed but still binaries are not published until generic VST support will be done.
Ardour need to explicitly scan for LXVST in Edit-->Preferences-->Plugins, if your LinuxVST's are not in a standard location (usr/lib/vst, usr/local/lib/vst) then you additionally will need to define the path in Edit-->Preferences-->Plugins
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

GMaq wrote:Ardour need to explicitly scan for LXVST in Edit-->Preferences-->Plugins, if your LinuxVST's are not in a standard location (usr/lib/vst, usr/local/lib/vst) then you additionally will need to define the path in Edit-->Preferences-->Plugins
Thanks. asbak gave complete solution. I just turned on VST scan on startup and it worked.

The porting to linuxVST (currently without UI) is complete. After some tests will release the binaries.
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

The version 1.0.1 was released! The most significant changes:
  • Fixed bugs in SSE assembly code discovered at 44100 Hz sample rate.
  • Optimized SSE DSP processor: now it doesn't need to be an instance of the class.
  • Fixed assertion issues with GTK+ support on UI close and destroy for LV2.
  • Implemented generic LinuxVST support for plugins. Currently UI is not supported.
  • Updated plugin metadata to become more compatible with VST.
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

falkTX wrote:@sadko4u: Can you make the lv2 plugins have the units defined properly?
Instead of having like "Time (ms)" in the parameter name, remove the "(ms)" and add a units:ms for example.
The official lv2 spec for units is here http://lv2plug.in/ns/extensions/units/.
You can use the already provided units or make your own.
Yes, I know about units and think to implement them in the nearest future for LV2 version of plugin.
The only confusing thing are decibels that I (maybe) have to convert into linear gain and vice verse (not checked).
But after implementing VST front-end it isn't so hard.

Some wishes to Carla's interface.
I've noticed that Carla currently does not display parameter's labels.
For example, parameters in Carla are looking much generic:
Image
And in Ardour their names are less generic:
Image
But Ardour has it's own problems with values and labels for VST.
That's the strings returned in effGetParameterProperties and effGetProductString.
If the plugin supports these callbacks and returns non-empty strings, it would be good to display them in UI.
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

falkTX wrote:FYI I fixed the garbled names in Carla.
Some weird lilvmm bug.
Nice! Thank you! Works fine for me:
Image
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

falkTX wrote:As for the parameter names, carla uses effGetParamName.
How are you describing the names?
I'm using these from VST SDK:

Code: Select all

struct VstParameterProperties
{
    // ...
	char label[kVstMaxLabelLen];///< parameter label
    // ...
	char shortLabel[kVstMaxShortLabelLen];	///< short label, recommended: 6 + delimiter
    // ...
};
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

falkTX wrote:Have you tried other hosts to see if they support those?
(ie, renoise, bitwig, tracktion)

why not returning the full name during effGetParamName ?
Here is the description from official SDK:

Code: Select all

	effGetParamLabel,	///< [ptr]: char buffer for parameter label, limited to #kVstMaxParamStrLen  @see AudioEffect::getParameterLabel
	effGetParamDisplay,	///< [ptr]: char buffer for parameter display, limited to #kVstMaxParamStrLen  @see AudioEffect::getParameterDisplay
	effGetParamName,	///< [ptr]: char buffer for parameter name, limited to #kVstMaxParamStrLen  @see AudioEffect::getParameterName
effGetParamName and effGetParamLabel are limited to kVstMaxParamStrLen which value is 8 in the official SDK, so these strings are totally bullshit, and I had to refactor symbolic parameter names to fully match the limit.

These constants are too greedy.

Code: Select all

enum VstStringConstants
{
//-------------------------------------------------------------------------------------------------------
	kVstMaxProgNameLen   = 24,	///< used for #effGetProgramName, #effSetProgramName, #effGetProgramNameIndexed
	kVstMaxParamStrLen   = 8,	///< used for #effGetParamLabel, #effGetParamDisplay, #effGetParamName
	kVstMaxVendorStrLen  = 64,	///< used for #effGetVendorString, #audioMasterGetVendorString
	kVstMaxProductStrLen = 64,	///< used for #effGetProductString, #audioMasterGetProductString
	kVstMaxEffectNameLen = 32	///< used for #effGetEffectName
//-------------------------------------------------------------------------------------------------------
};
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

falkTX wrote:yeah, that restriction is very stupid.
that's why no host follows it :lol:
for example, just plugins use 16 instead of 8.
That's bad :). The following comment in the link you mentioned describes this:
// length should technically be kVstMaxParamStrLen, which is 8, but hosts will normally allow a bit more.
I think that for that purposes Steinberg added parameter label in VstParameterProperties.
LSP (Linux Studio Plugins) Developer and Maintainer.
User avatar
sadko4u
Established Member
Posts: 986
Joined: Mon Sep 28, 2015 9:03 pm
Has thanked: 2 times
Been thanked: 359 times

Re: LSP Project

Post by sadko4u »

falkTX wrote:Anyway, I can certainly add this feature to carla.
This could be very nice!
LSP (Linux Studio Plugins) Developer and Maintainer.
Post Reply