Hi Christian,

I come bearing diff patches :)

I've done a bunch of debugging of this and I'm fairly certain my
installation is fine. The latest SVN versions of libgig, linuxsampler and
gigedit are the only ones I have on my PC right now.

If I type each of the following LSCP commands into the LSCP shell directly,
the instrument editor opens fine. Same happens if I open the editor on a
loaded instrument through the JSampler GUI. This does not work if netcat
(or socat) is used to send the commands to Linuxsampler.

For whatever reason,
InstrumentEditorFactory::AvailableEditorsAsString().c_str()
returns empty in InstrumentResourceManager::LaunchInstrumentEditor when
netcat is used and I don't understand why. I understand that when an 'EDIT
CHANNEL INSTRUMENT <num>' command is sent, there'll be a check of the
datatype and dataversion the instrument reports against the output of
matchingeditors(), but it appears it's hit or miss.

*LSCP commands: *
RESET

SET VOLUME 1.0

CREATE MIDI_INPUT_DEVICE JACK
SET MIDI_INPUT_DEVICE_PARAMETER 0 PORTS=1

SET VOLUME 1.0
CREATE AUDIO_OUTPUT_DEVICE JACK ACTIVE=TRUE CHANNELS=2 SAMPLERATE=48000
SET AUDIO_OUTPUT_CHANNEL_PARAMETER 0 0 NAME='Left'
SET AUDIO_OUTPUT_CHANNEL_PARAMETER 0 1 NAME='Right'

SET STREAMS 90
REMOVE MIDI_INSTRUMENT_MAP ALL
ADD CHANNEL
ADD CHANNEL MIDI_INPUT 0 0 0
SET CHANNEL MIDI_INPUT_CHANNEL 0 0
LOAD ENGINE GIG 0
SET CHANNEL VOLUME 0 1.0
SET CHANNEL AUDIO_OUTPUT_DEVICE 0 0
LOAD INSTRUMENT '/home/andrew/Desktop/Samples/Booms/trailerhits.gig' 0 0

SET STREAMS 90
SET VOICES 90

EDIT CHANNEL INSTRUMENT 0

*Sampler output from doing "linuxsampler && cat lscpcommands.lscp | netcat
localhost 8888"*

LinuxSampler 2.2.0.svn9
Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck
Copyright (C) 2005-2021 Christian Schoenebeck
Binary built: Dec 24 2021
Detected features: MMX SSE SSE2
Automatic Stacktrace: Off
Creating Sampler...OK
Registered sampler engines: 'GIG','SF2','SFZ'
Registered MIDI input drivers: ALSA,JACK
Registered audio output drivers: ALSA,JACK
Loading instrument editor plugins...OK
*Registered instrument editors: 'gigedit' *
Registered internal effect systems: LADSPA
no more csLADSPA plugins
failed to load DLL: '/usr/lib/ladspa/autotalent.so', cause:
/usr/lib/ladspa/autotalent.so: undefined symbol: __exp_finite
Registered internal effects: 354
Starting LSCP network server (0.0.0.0:8888)...OK
LinuxSampler initialization completed. :-)

LSCPServer: Client connection established on socket:4.
Unloading instrument editor plugins...OK
libjackBufferSizeCallback(1024)
jack_port_set_name: deprecated
jack_port_set_name: deprecated
Starting disk thread...OK
EQ support: no
Loading gig file '/home/andrew/Desktop/Samples/Booms/trailerhits.gig'...OK
Loading gig instrument
('/home/andrew/Desktop/Samples/Booms/trailerhits.gig',0)...OK

Caching initial samples...OK
Stopping disk thread...OK
Starting disk thread...OK
EQ support: no
Data type is libgig and data version is 4.3.0.svn34Loading instrument
editor plugins...OK

*Instrument plugin is *

*ERROR: There is not any instrument editor registered to the sampler!
[Cause: Make sure an instrument editor is installed to the sampler's plugin
dir ('/usr/local/lib/linuxsampler/*

*plugins')] We found and registered plugins in
'/usr/local/lib/linuxsampler/plugins' at startup, but currently available
plugins are:  netcat seems to cause issues.*


*Diff patch for debugging/illustration purposes:*

Index: LS-DEBUG/src/engines/gig/InstrumentResourceManager.cpp
===================================================================
--- LS-DEBUG/src/engines/gig/InstrumentResourceManager.cpp      (revision
4010)
+++ LS-DEBUG/src/engines/gig/InstrumentResourceManager.cpp      (working
copy)
@@ -216,6 +216,8 @@
    InstrumentEditor*
InstrumentResourceManager::LaunchInstrumentEditor(LinuxSampler::EngineChannel*
pEngineChannel, instrument_id_t ID,
void* pUserData) throw (InstrumentManagerException) {
        const String sDataType    = GetInstrumentDataStructureName(ID);
        const String sDataVersion = GetInstrumentDataStructureVersion(ID);
+       fprintf (stderr, "Data type is %s and data version is %s\n",
sDataType.c_str(), sDataVersion.c_str());
+       fprintf (stderr, "Instrument plugin is %s\n",
InstrumentEditorFactory::AvailableEditorsAsString().c_str());
        // find instrument editors capable to handle given instrument
        std::vector<String> vEditors =
            InstrumentEditorFactory::MatchingEditors(sDataType,
sDataVersion);
@@ -224,10 +226,16 @@
                fprintf(stderr,
                    "ERROR: There is not any instrument editor registered
to the sampler!\n"
                    "[Cause: Make sure an instrument editor is installed to
the sampler's plugin dir (%s)]\n",
-                    InstrumentEditorFactory::PluginDirsAsString().c_str()
-                );
+
                   InstrumentEditorFactory::PluginDirsAsString().c_str());
+               if (InstrumentEditorFactory::FoundPlugins) {
+                 fprintf (stderr,
+                   "We found and registered plugins in %s at startup, but
currently available plugins are:%s \n",
+                    InstrumentEditorFactory::PluginDirsAsString().c_str(),
+
                  InstrumentEditorFactory::AvailableEditorsAsString().c_str()

+                  );
+                };
                throw InstrumentManagerException(
-                    "There is not any instrument editor installed and
registered to the sampler"
+                    "netcat seems to cause issues."
                );
            }
            fprintf(stderr,
Index: LS-DEBUG/src/plugins/InstrumentEditorFactory.cpp
===================================================================
--- LS-DEBUG/src/plugins/InstrumentEditorFactory.cpp    (revision 4010)
+++ LS-DEBUG/src/plugins/InstrumentEditorFactory.cpp    (working copy)
@@ -44,6 +44,7 @@
    std::map<String, InstrumentEditorFactory::InnerFactory*>
InstrumentEditorFactory::InnerFactories;

    bool InstrumentEditorFactory::bPluginsLoaded = false;
+    bool InstrumentEditorFactory::FoundPlugins = false;

    std::list<void*> InstrumentEditorFactory::LoadedDLLs;

@@ -287,6 +288,7 @@
        }
        closedir(hDir);
        #endif
+       InstrumentEditorFactory::FoundPlugins = true;
        return true;
    }

Index: LS-DEBUG/src/plugins/InstrumentEditorFactory.h
===================================================================
--- LS-DEBUG/src/plugins/InstrumentEditorFactory.h      (revision 4010)
+++ LS-DEBUG/src/plugins/InstrumentEditorFactory.h      (working copy)
@@ -98,6 +98,7 @@
        static String              PluginDirsAsString();
        static std::vector<String> AvailableEditors();
        static String              AvailableEditorsAsString();
+       static bool                FoundPlugins;
        static std::vector<String> MatchingEditors(String sTypeName, String
sTypeVersion);
        static void                LoadPlugins();
        static void                ClosePlugins();
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel

Reply via email to