|
From: Andrew C <cou...@gm...> - 2021-12-21 14:46:38
|
Hi, I'm hacking together a quick-and-dirty bash script for controlling/setting up audio/midi interfaces in Linuxsampler by sending LSCP commands. Sending the commands seems absolutely fine, but using the 'GET' commands to recieve data from Linuxsampler, for example info about a sampler channel, don't appear to return data consistently or "in time"? Command I'm using: echo "GET CHANNEL INFO 1" | nc -q 1 -t localhost 8888 Sometimes it'll return the channel info immediately, other times Linuxsampler returns nothing at all, though the connection is established and terminated. Thanks, Andrew. |
|
From: Christian S. <sch...@li...> - 2021-12-21 16:31:23
|
On Dienstag, 21. Dezember 2021 15:46:17 CET Andrew C wrote: > Hi, > > I'm hacking together a quick-and-dirty bash script for controlling/setting > up audio/midi interfaces in Linuxsampler by sending LSCP commands. > > Sending the commands seems absolutely fine, but using the 'GET' commands to > recieve data from Linuxsampler, for example info about a sampler channel, > don't appear to return data consistently or "in time"? > > Command I'm using: > echo "GET CHANNEL INFO 1" | nc -q 1 -t localhost 8888 > > Sometimes it'll return the channel info immediately, other times > Linuxsampler returns nothing at all, though the connection is established > and terminated. I guess you were sending another LSCP command in parallel while that happened, e.g. loading an instrument in foreground. The LSCP server is currently single-threaded: http://svn.linuxsampler.org/cgi-bin/viewvc.cgi/linuxsampler/trunk/src/network/lscpserver.h?revision=2534&view=markup So the LSCP server only executes one command at a time, which explains why your "GET CHANNEL INFO" sometimes takes a moment before completing. So far this was not an issue for anybody, at least nobody complained FWIW in all these years. In the meantime you might just load your instruments in the background for not blocking the LSCP server for too long. BTW we also have a dedicated command line utility that might be a bit more convenient to play around with LSCP: http://doc.linuxsampler.org/Release_Notes/LinuxSampler_2_0_0/#lscp_shell > Thanks, > > Andrew. |
|
From: Andrew C <cou...@gm...> - 2021-12-21 16:42:47
|
Hi Christian, Unfortunately no, I wasn't running a command in parallel to the GET command, all my instruments had already loaded by the time I tried the GET command. The LSCP shell/CLI utility works absolutely fine every time I send such a GET command, so perhaps it's my netcatting that's the issue here for some reason. Not sure if there would be more scriptable methods of reliably getting the data from Linuxsampler. Also, on the note of using the lscp CLI/netcat commands to Linuxsampler for the instrument editor, it seems it doesn't work on my end: lscp=# EDIT CHANNEL INSTRUMENT 1 ERR:0:There is no instrument editor capable to handle this instrument lscp=# EDIT CHANNEL INSTRUMENT 0 ERR:0:There is no instrument editor capable to handle this instrument Both files were loaded using the GIG engine and gigedit/Linuxsampler are installed in /usr/local.. Perhaps my PATH or ldconfig needs updating? Many thanks, Andrew. On Tue, Dec 21, 2021 at 4:31 PM Christian Schoenebeck < sch...@li...> wrote: > On Dienstag, 21. Dezember 2021 15:46:17 CET Andrew C wrote: > > Hi, > > > > I'm hacking together a quick-and-dirty bash script for > controlling/setting > > up audio/midi interfaces in Linuxsampler by sending LSCP commands. > > > > Sending the commands seems absolutely fine, but using the 'GET' commands > to > > recieve data from Linuxsampler, for example info about a sampler channel, > > don't appear to return data consistently or "in time"? > > > > Command I'm using: > > echo "GET CHANNEL INFO 1" | nc -q 1 -t localhost 8888 > > > > Sometimes it'll return the channel info immediately, other times > > Linuxsampler returns nothing at all, though the connection is established > > and terminated. > > I guess you were sending another LSCP command in parallel while that > happened, > e.g. loading an instrument in foreground. > > The LSCP server is currently single-threaded: > > http://svn.linuxsampler.org/cgi-bin/viewvc.cgi/linuxsampler/trunk/src/network/lscpserver.h?revision=2534&view=markup > > So the LSCP server only executes one command at a time, which explains why > your "GET CHANNEL INFO" sometimes takes a moment before completing. So far > this was not an issue for anybody, at least nobody complained FWIW in all > these years. > > In the meantime you might just load your instruments in the background for > not > blocking the LSCP server for too long. > > BTW we also have a dedicated command line utility that might be a bit more > convenient to play around with LSCP: > http://doc.linuxsampler.org/Release_Notes/LinuxSampler_2_0_0/#lscp_shell > > > Thanks, > > > > Andrew. > > > > > > > _______________________________________________ > Linuxsampler-devel mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel > |
|
From: Christian S. <sch...@li...> - 2021-12-21 17:12:55
|
On Dienstag, 21. Dezember 2021 17:42:29 CET Andrew C wrote:
> Hi Christian,
>
> Unfortunately no, I wasn't running a command in parallel to the GET
> command, all my instruments had already loaded by the time I tried the GET
> command.
> The LSCP shell/CLI utility works absolutely fine every time I send such a
> GET command, so perhaps it's my netcatting that's the issue here for some
> reason. Not sure if there would be more scriptable methods of reliably
> getting the data from Linuxsampler.
Ok, then you might just try some of the numerous other netcat derivates.
Altough it sounds a bit strange that you got a much different latency with the
LSCP shell than with nc.
As this is really a simple text based network protocol, there are endless of
other possibilities, like writing a simple Python script or whatever.
> Also, on the note of using the lscp CLI/netcat commands to Linuxsampler for
> the instrument editor, it seems it doesn't work on my end:
> lscp=# EDIT CHANNEL INSTRUMENT 1
> ERR:0:There is no instrument editor capable to handle this instrument
> lscp=# EDIT CHANNEL INSTRUMENT 0
> ERR:0:There is no instrument editor capable to handle this instrument
>
> Both files were loaded using the GIG engine and gigedit/Linuxsampler are
> installed in /usr/local.. Perhaps my PATH or ldconfig needs updating?
When linuxsampler is launched, you see a bunch of information, which also
includes the following line:
Registered instrument editors: 'gigedit'
If "gigedit" is missing in that line, then because the sampler did not find
gigedit's plugin in the sampler's plugin directory. You can change the
sampler's default plugin path at compile time:
./configure --enable-plugin-dir=/some/where
As well as overriding it by environment variable before launching
linuxsampler. From "man linuxsampler":
ENVIRONMENT VARIABLES
LINUXSAMPLER_PLUGIN_DIR
Allows to override the directory where LinuxSampler shall look
for instrument editor plugins.
Note, there is also --exec-after-init BTW.
CU
Christian
|
|
From: Andrew C <cou...@gm...> - 2021-12-21 18:19:02
|
Thanks for that, Christian, I'll give some other netcat variants a go and
see what I can get back.
My Instrument Editor plugins are definitely being picked up by LInuxsampler
on start:
andrew@andrewlaptop:~/LSBuild$ linuxsampler
LinuxSampler 2.2.0.svn7
Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck
Copyright (C) 2005-2021 Christian Schoenebeck
Binary built: Dec 20 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/a
utotalent.so: undefined symbol: __exp_finite
Registered internal effects: 354
Starting LSCP network server (0.0.0.0:8888)...OK
LinuxSampler initialization completed. :-)
and if I use a previously saved lscp commands from jsampler and simply
netcat it into linuxsampler, the engine cannot find a compatible instrument
editor for a gig file (I also tried to see what would happen if I edited
the nonexistant sampler channel 1).
and also, it will hang on attempting to control-C out of the server itself:
libjackBufferSizeCallback(1024)
jack_port_set_name: deprecated
libjackBufferSizeCallback(1024)
jack_port_set_name: deprecated
Jack: Cannot connect port 'AO-Strings:0' to port 'NONE'
jack_port_set_name: deprecated
Jack: Cannot connect port 'AO-Strings:1' to port 'NONE'
Starting disk thread...OK
EQ support: no
Scheduling '/home/andrew/Desktop/Samples/String_ensemble.gig' (Index=1) to
be
loaded in background (if not loaded yet).
Loading gig file '/home/andrew/Desktop/Samples/String_ensemble.gig'...OK
Loading gig instrument
('/home/andrew/Desktop/Samples/String_ensemble.gig',1)
...OK
Caching initial samples...OK
LSCPServer: Client connection established on socket:26.
Loading instrument editor plugins...OK
There is no instrument editor capable to handle this instrument
Invalid sampler channel number 1
LSCPServer: Client connection terminated on socket:4.
LSCPServer: Client connection terminated on socket:26.
^CFreeing gig file '/home/andrew/Desktop/Samples/String_ensemble.gig' from
me
mory ...OK
Stopping disk thread...OK
Unloading instrument editor plugins...OK
^C^C
JSampler, for example, doesn't exhibit this behaviour with the instrument
editor, strangely enough.
I fear I may be opening up a vast debugging can of worms here!!
On Tue, Dec 21, 2021 at 5:13 PM Christian Schoenebeck <
sch...@li...> wrote:
> On Dienstag, 21. Dezember 2021 17:42:29 CET Andrew C wrote:
> > Hi Christian,
> >
> > Unfortunately no, I wasn't running a command in parallel to the GET
> > command, all my instruments had already loaded by the time I tried the
> GET
> > command.
> > The LSCP shell/CLI utility works absolutely fine every time I send such a
> > GET command, so perhaps it's my netcatting that's the issue here for some
> > reason. Not sure if there would be more scriptable methods of reliably
> > getting the data from Linuxsampler.
>
> Ok, then you might just try some of the numerous other netcat derivates.
> Altough it sounds a bit strange that you got a much different latency with
> the
> LSCP shell than with nc.
>
> As this is really a simple text based network protocol, there are endless
> of
> other possibilities, like writing a simple Python script or whatever.
>
> > Also, on the note of using the lscp CLI/netcat commands to Linuxsampler
> for
> > the instrument editor, it seems it doesn't work on my end:
> > lscp=# EDIT CHANNEL INSTRUMENT 1
> > ERR:0:There is no instrument editor capable to handle this instrument
> > lscp=# EDIT CHANNEL INSTRUMENT 0
> > ERR:0:There is no instrument editor capable to handle this instrument
> >
> > Both files were loaded using the GIG engine and gigedit/Linuxsampler are
> > installed in /usr/local.. Perhaps my PATH or ldconfig needs updating?
>
> When linuxsampler is launched, you see a bunch of information, which also
> includes the following line:
>
> Registered instrument editors: 'gigedit'
>
> If "gigedit" is missing in that line, then because the sampler did not
> find
> gigedit's plugin in the sampler's plugin directory. You can change the
> sampler's default plugin path at compile time:
>
> ./configure --enable-plugin-dir=/some/where
>
> As well as overriding it by environment variable before launching
> linuxsampler. From "man linuxsampler":
>
> ENVIRONMENT VARIABLES
> LINUXSAMPLER_PLUGIN_DIR
> Allows to override the directory where LinuxSampler shall
> look
> for instrument editor plugins.
>
> Note, there is also --exec-after-init BTW.
>
> CU
> Christian
>
>
>
>
> _______________________________________________
> Linuxsampler-devel mailing list
> Lin...@li...
> https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
>
|
|
From: Christian S. <sch...@li...> - 2021-12-22 13:15:28
|
On Dienstag, 21. Dezember 2021 19:18:44 CET Andrew C wrote:
> Thanks for that, Christian, I'll give some other netcat variants a go and
> see what I can get back.
>
> My Instrument Editor plugins are definitely being picked up by LInuxsampler
> on start:
>
> andrew@andrewlaptop:~/LSBuild$ linuxsampler
> LinuxSampler 2.2.0.svn7
> Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck
> Copyright (C) 2005-2021 Christian Schoenebeck
> Binary built: Dec 20 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/a
> utotalent.so: undefined symbol: __exp_finite
> Registered internal effects: 354
> Starting LSCP network server (0.0.0.0:8888)...OK
> LinuxSampler initialization completed. :-)
>
> and if I use a previously saved lscp commands from jsampler and simply
> netcat it into linuxsampler, the engine cannot find a compatible instrument
> editor for a gig file (I also tried to see what would happen if I edited
> the nonexistant sampler channel 1).
> and also, it will hang on attempting to control-C out of the server itself:
> libjackBufferSizeCallback(1024)
> jack_port_set_name: deprecated
> libjackBufferSizeCallback(1024)
> jack_port_set_name: deprecated
> Jack: Cannot connect port 'AO-Strings:0' to port 'NONE'
> jack_port_set_name: deprecated
> Jack: Cannot connect port 'AO-Strings:1' to port 'NONE'
> Starting disk thread...OK
> EQ support: no
> Scheduling '/home/andrew/Desktop/Samples/String_ensemble.gig' (Index=1) to
> be
> loaded in background (if not loaded yet).
> Loading gig file '/home/andrew/Desktop/Samples/String_ensemble.gig'...OK
> Loading gig instrument
> ('/home/andrew/Desktop/Samples/String_ensemble.gig',1)
> ...OK
> Caching initial samples...OK
> LSCPServer: Client connection established on socket:26.
> Loading instrument editor plugins...OK
> There is no instrument editor capable to handle this instrument
Most likely reason for this: you compiled LS, but are using a third-party
compiled gigedit version. For live-editing support with gigedit all involved
components need to be binary compatible, because in live-editing mode they
share the same process and in memory data.
I recommend you recompile
1. libgig
2. linuxsampler
3. gigedit
in this order. And make sure that you have actually installed the respective
component (in the same order) before compiling the next one, because in that
sequence they will access the header files of the former during compilation.
CU
Christian
|
|
From: Andrew C <cou...@gm...> - 2021-12-22 13:46:21
|
Hi Christian,
Can confirm that is the order I compiled and installed the 3 pieces on this
new Linux installation.
JSampler opens the editor in real-time mode, as does the LSCP commandline
**but** only when JSampler has previously connected to LinuxSampler. In a
standalone mode with simply netcatting the same lscp commands JSampler uses
to set up the midi, audio and sampler channels, using the LSCP commandline
"EDIT INSTRUMENT CHANNEL 0" produces the error about no suitable instrument
editor being found.
Thanks,
Andrew.
On Wed, Dec 22, 2021 at 1:15 PM Christian Schoenebeck <
sch...@li...> wrote:
> On Dienstag, 21. Dezember 2021 19:18:44 CET Andrew C wrote:
> > Thanks for that, Christian, I'll give some other netcat variants a go and
> > see what I can get back.
> >
> > My Instrument Editor plugins are definitely being picked up by
> LInuxsampler
> > on start:
> >
> > andrew@andrewlaptop:~/LSBuild$ linuxsampler
> > LinuxSampler 2.2.0.svn7
> > Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck
> > Copyright (C) 2005-2021 Christian Schoenebeck
> > Binary built: Dec 20 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/a
> > utotalent.so: undefined symbol: __exp_finite
> > Registered internal effects: 354
> > Starting LSCP network server (0.0.0.0:8888)...OK
> > LinuxSampler initialization completed. :-)
> >
> > and if I use a previously saved lscp commands from jsampler and simply
> > netcat it into linuxsampler, the engine cannot find a compatible
> instrument
> > editor for a gig file (I also tried to see what would happen if I edited
> > the nonexistant sampler channel 1).
> > and also, it will hang on attempting to control-C out of the server
> itself:
> > libjackBufferSizeCallback(1024)
> > jack_port_set_name: deprecated
> > libjackBufferSizeCallback(1024)
> > jack_port_set_name: deprecated
> > Jack: Cannot connect port 'AO-Strings:0' to port 'NONE'
> > jack_port_set_name: deprecated
> > Jack: Cannot connect port 'AO-Strings:1' to port 'NONE'
> > Starting disk thread...OK
> > EQ support: no
> > Scheduling '/home/andrew/Desktop/Samples/String_ensemble.gig' (Index=1)
> to
> > be
> > loaded in background (if not loaded yet).
> > Loading gig file '/home/andrew/Desktop/Samples/String_ensemble.gig'...OK
> > Loading gig instrument
> > ('/home/andrew/Desktop/Samples/String_ensemble.gig',1)
> > ...OK
> > Caching initial samples...OK
> > LSCPServer: Client connection established on socket:26.
> > Loading instrument editor plugins...OK
> > There is no instrument editor capable to handle this instrument
>
> Most likely reason for this: you compiled LS, but are using a third-party
> compiled gigedit version. For live-editing support with gigedit all
> involved
> components need to be binary compatible, because in live-editing mode they
> share the same process and in memory data.
>
> I recommend you recompile
>
> 1. libgig
> 2. linuxsampler
> 3. gigedit
>
> in this order. And make sure that you have actually installed the
> respective
> component (in the same order) before compiling the next one, because in
> that
> sequence they will access the header files of the former during
> compilation.
>
> CU
> Christian
>
>
>
>
> _______________________________________________
> Linuxsampler-devel mailing list
> Lin...@li...
> https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
>
|
|
From: Christian S. <sch...@li...> - 2021-12-22 14:05:30
|
On Mittwoch, 22. Dezember 2021 14:45:59 CET Andrew C wrote: > Hi Christian, > > Can confirm that is the order I compiled and installed the 3 pieces on this > new Linux installation. > > JSampler opens the editor in real-time mode, as does the LSCP commandline > **but** only when JSampler has previously connected to LinuxSampler. In a > standalone mode with simply netcatting the same lscp commands JSampler uses > to set up the midi, audio and sampler channels, using the LSCP commandline > "EDIT INSTRUMENT CHANNEL 0" produces the error about no suitable instrument > editor being found. And that in turn sounds like you have two different LS versions somewhere (e.g. /usr/bin vs. /usr/local/bin/, etc.). Both QSampler and JSampler are able to launch linuxsampler automatically if needed. If the sampler is not running yet, they will try to start linuxsampler by their configurable linuxsampler binary path, e.g. "/usr/bin/linuxsampler". If the sampler is already running (i.e. if they can connect to TCP port 8888), then the will not start linuxsampler and just use the already running sampler instance. Which is handy, because you can quickly play around with a developer version of LS for instance without needing to install it anywhere. I am using that a lot. CU Christian |
|
From: Christian S. <sch...@li...> - 2021-12-22 15:05:40
|
On Mittwoch, 22. Dezember 2021 14:15:20 CET Christian Schoenebeck wrote: > On Dienstag, 21. Dezember 2021 19:18:44 CET Andrew C wrote: > > Thanks for that, Christian, I'll give some other netcat variants a go and > > see what I can get back. > > > > My Instrument Editor plugins are definitely being picked up by > > LInuxsampler > > on start: > > > > andrew@andrewlaptop:~/LSBuild$ linuxsampler > > LinuxSampler 2.2.0.svn7 > > Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck > > Copyright (C) 2005-2021 Christian Schoenebeck > > Binary built: Dec 20 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' [...] > > Loading instrument editor plugins...OK > > There is no instrument editor capable to handle this instrument > > Most likely reason for this: you compiled LS, but are using a third-party > compiled gigedit version. For live-editing support with gigedit all involved > components need to be binary compatible, because in live-editing mode they > share the same process and in memory data. > > I recommend you recompile > > 1. libgig > 2. linuxsampler > 3. gigedit > > in this order. And make sure that you have actually installed the respective > component (in the same order) before compiling the next one, because in > that sequence they will access the header files of the former during > compilation. I just made this more clear by showing more detailed error messages on terminal, both on gigedit side: http://svn.linuxsampler.org/cgi-bin/viewvc.cgi?view=revision&revision=4008 and on linuxsampler side: http://svn.linuxsampler.org/cgi-bin/viewvc.cgi?view=revision&revision=4009 CU Christian |
|
From: Andrew C <cou...@gm...> - 2021-12-22 16:04:32
|
Hi Christian,
Thanks for the increased verbose output with that patch. I recompiled all
three of them again and I'm getting this in the console output of
Linuxsampler now:
ERROR: Did not find a matching editor for instrument
('/home/andrew/Desktop/S
amples/Booms/trailerhits.gig', 0) having data structure
('libgig','4.3.0.svn3
4')
There is no instrument editor capable to handle this instrument
Andrew.
On Wed, Dec 22, 2021 at 3:06 PM Christian Schoenebeck <
sch...@li...> wrote:
> On Mittwoch, 22. Dezember 2021 14:15:20 CET Christian Schoenebeck wrote:
> > On Dienstag, 21. Dezember 2021 19:18:44 CET Andrew C wrote:
> > > Thanks for that, Christian, I'll give some other netcat variants a go
> and
> > > see what I can get back.
> > >
> > > My Instrument Editor plugins are definitely being picked up by
> > > LInuxsampler
> > > on start:
> > >
> > > andrew@andrewlaptop:~/LSBuild$ linuxsampler
> > > LinuxSampler 2.2.0.svn7
> > > Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck
> > > Copyright (C) 2005-2021 Christian Schoenebeck
> > > Binary built: Dec 20 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'
> [...]
> > > Loading instrument editor plugins...OK
> > > There is no instrument editor capable to handle this instrument
> >
> > Most likely reason for this: you compiled LS, but are using a third-party
> > compiled gigedit version. For live-editing support with gigedit all
> involved
> > components need to be binary compatible, because in live-editing mode
> they
> > share the same process and in memory data.
> >
> > I recommend you recompile
> >
> > 1. libgig
> > 2. linuxsampler
> > 3. gigedit
> >
> > in this order. And make sure that you have actually installed the
> respective
> > component (in the same order) before compiling the next one, because in
> > that sequence they will access the header files of the former during
> > compilation.
>
> I just made this more clear by showing more detailed error messages on
> terminal, both on gigedit side:
> http://svn.linuxsampler.org/cgi-bin/viewvc.cgi?view=revision&revision=4008
>
> and on linuxsampler side:
> http://svn.linuxsampler.org/cgi-bin/viewvc.cgi?view=revision&revision=4009
>
> CU
> Christian
>
>
>
>
> _______________________________________________
> Linuxsampler-devel mailing list
> Lin...@li...
> https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
>
|
|
From: Christian S. <sch...@li...> - 2021-12-22 17:34:49
|
On Mittwoch, 22. Dezember 2021 17:04:14 CET Andrew C wrote:
> Hi Christian,
>
> Thanks for the increased verbose output with that patch. I recompiled all
> three of them again and I'm getting this in the console output of
> Linuxsampler now:
>
> ERROR: Did not find a matching editor for instrument
> ('/home/andrew/Desktop/S
> amples/Booms/trailerhits.gig', 0) having data structure
> ('libgig','4.3.0.svn3
> 4')
> There is no instrument editor capable to handle this instrument
Yep, which proofs that you are using a mixed installation of an old gigedit
version in combination with a new LS version. Otherwise gigedit would have
barked as well now, which it didn't, right?
Please read my other emails that I already sent on this topic. This is very
unlikely a bug in LS, but simply a messy installation there. I know it's
inconvenient, but that's how it is.
To avoid confusion, I would start by getting rid of the other LS version that
you obviously have installed somewhere in parallel on your system, otherwise
you would not get two different behaviours when requesting to launch an
instrument editor with JSampler when LS was already running vs. not running.
QSampler and JSampler really just send a "EDIT CHANNEL INSTRUMENT <number>"
command as ASCII text line to the sampler. There is absolutely no magic about
it. The only thing that you could do wrong with netcat here was to supply a
wrong channel number, which you can also very easily verify by sending "LIST
CHANNELS" to get the current valid channel IDs.
After you got rid of the other LS installation, make sure that the LS plugin
path of gigedit and LS match. By default they do, but if you are fiddling with
installation pathes then they might not:
$ cd YOUR_GIGEDIT_SOURCEDIR
$ grep LINUXSAMPLER_PLUGIN_DIR config.log
LINUXSAMPLER_PLUGIN_DIR='${libdir}/linuxsampler/plugins
$ grep '^libdir=' config.log
libdir='${exec_prefix}/lib'
$ grep '^exec_prefix=' config.log
exec_prefix='${prefix}'
$ grep '^prefix=' config.log
prefix='/usr'
$ cd YOUR_LS_SOURCEDIR
$ grep config_plugin_dir config.log
config_plugin_dir='/usr/lib/linuxsampler/plugins'
$ ls -l /usr/lib/linuxsampler/plugins
-rw-r--r-- 1 root root 1877636 May 9 2021 libgigeditlinuxsamplerplugin.a
-rw-r--r-- 1 root root 1538 May 9 2021 libgigeditlinuxsamplerplugin.la
-rw-r--r-- 1 root root 1004320 May 9 2021 libgigeditlinuxsamplerplugin.so
CU
Christian
|
|
From: Andrew C <cou...@gm...> - 2021-12-22 20:10:01
|
Hi Christian,
Not trying to be intentionally obtuse here. :)
I started completely from scratch again. Totally cleaned out /usr/local/
(fresh ubuntu distro, so only Linuxsampler and co was living there from the
last install attempt), deleted the LS SVN directories and redownloaded
them.
Still getting the same error from Linuxsampler regarding no matching editor
for a gig instrument. The plugin paths do appear to match too:
andrew@andrewlaptop:~/LSBuild$ cd gigedit/
andrew@andrewlaptop:~/LSBuild/gigedit$ grep LINUXSAMPLER_PLUGIN_DIR
config.lo
g
LINUXSAMPLER_PLUGIN_DIR='${libdir}/linuxsampler/plugins'
andrew@andrewlaptop:~/LSBuild/gigedit$ grep '^libdir=' config.log
libdir='${exec_prefix}/lib'
andrew@andrewlaptop:~/LSBuild/gigedit$ grep '^exec_prefix=' config.log
exec_prefix='${prefix}'
andrew@andrewlaptop:~/LSBuild/gigedit$ grep '^prefix=' config.log
prefix='/usr/local'
andrew@andrewlaptop:~/LSBuild/gigedit$ cd ../linuxsampler/
andrew@andrewlaptop:~/LSBuild/linuxsampler$ grep config_plugin_dir
config.log
config_plugin_dir='/usr/local/lib/linuxsampler/plugins'
andrew@andrewlaptop:~/LSBuild/linuxsampler$ ls -l
/usr/local/lib/linuxsample
r/plugins
total 2480
-rw-r--r-- 1 root root 1610998 Dec 22 19:28 libgigeditlinuxsamplerplugin.a
-rwxr-xr-x 1 root root 1561 Dec 22 19:28 libgigeditlinuxsamplerplugin.la
-rwxr-xr-x 1 root root 920904 Dec 22 19:28 libgigeditlinuxsamplerplugin.so
andrew@andrewlaptop:~/LSBuild/linuxsampler$
Many thanks!
Andrew.
On Wed, Dec 22, 2021 at 5:35 PM Christian Schoenebeck <
sch...@li...> wrote:
> On Mittwoch, 22. Dezember 2021 17:04:14 CET Andrew C wrote:
> > Hi Christian,
> >
> > Thanks for the increased verbose output with that patch. I recompiled all
> > three of them again and I'm getting this in the console output of
> > Linuxsampler now:
> >
> > ERROR: Did not find a matching editor for instrument
> > ('/home/andrew/Desktop/S
> > amples/Booms/trailerhits.gig', 0) having data structure
> > ('libgig','4.3.0.svn3
> > 4')
> > There is no instrument editor capable to handle this instrument
>
> Yep, which proofs that you are using a mixed installation of an old
> gigedit
> version in combination with a new LS version. Otherwise gigedit would have
> barked as well now, which it didn't, right?
>
> Please read my other emails that I already sent on this topic. This is
> very
> unlikely a bug in LS, but simply a messy installation there. I know it's
> inconvenient, but that's how it is.
>
> To avoid confusion, I would start by getting rid of the other LS version
> that
> you obviously have installed somewhere in parallel on your system,
> otherwise
> you would not get two different behaviours when requesting to launch an
> instrument editor with JSampler when LS was already running vs. not
> running.
>
> QSampler and JSampler really just send a "EDIT CHANNEL INSTRUMENT
> <number>"
> command as ASCII text line to the sampler. There is absolutely no magic
> about
> it. The only thing that you could do wrong with netcat here was to supply
> a
> wrong channel number, which you can also very easily verify by sending
> "LIST
> CHANNELS" to get the current valid channel IDs.
>
> After you got rid of the other LS installation, make sure that the LS
> plugin
> path of gigedit and LS match. By default they do, but if you are fiddling
> with
> installation pathes then they might not:
>
> $ cd YOUR_GIGEDIT_SOURCEDIR
> $ grep LINUXSAMPLER_PLUGIN_DIR config.log
> LINUXSAMPLER_PLUGIN_DIR='${libdir}/linuxsampler/plugins
> $ grep '^libdir=' config.log
> libdir='${exec_prefix}/lib'
> $ grep '^exec_prefix=' config.log
> exec_prefix='${prefix}'
> $ grep '^prefix=' config.log
> prefix='/usr'
>
> $ cd YOUR_LS_SOURCEDIR
> $ grep config_plugin_dir config.log
> config_plugin_dir='/usr/lib/linuxsampler/plugins'
> $ ls -l /usr/lib/linuxsampler/plugins
> -rw-r--r-- 1 root root 1877636 May 9 2021
> libgigeditlinuxsamplerplugin.a
> -rw-r--r-- 1 root root 1538 May 9 2021
> libgigeditlinuxsamplerplugin.la
> -rw-r--r-- 1 root root 1004320 May 9 2021
> libgigeditlinuxsamplerplugin.so
>
> CU
> Christian
>
>
>
>
> _______________________________________________
> Linuxsampler-devel mailing list
> Lin...@li...
> https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
>
|
|
From: Christian S. <sch...@li...> - 2021-12-23 15:37:44
|
On Mittwoch, 22. Dezember 2021 21:09:39 CET Andrew C wrote: > Hi Christian, > > Not trying to be intentionally obtuse here. :) > > I started completely from scratch again. Totally cleaned out /usr/local/ > (fresh ubuntu distro, so only Linuxsampler and co was living there from the > last install attempt), deleted the LS SVN directories and redownloaded > them. > > Still getting the same error from Linuxsampler regarding no matching editor > for a gig instrument. The plugin paths do appear to match too: I just committed additional, more verbose error messages: http://svn.linuxsampler.org/cgi-bin/viewvc.cgi?view=revision&revision=4010 There is now a clear distinguishment between whether there are any instrument editor plugins installed at all, or whether there are some but are binary incompatible, and also what to do about. The sampler also prints you the exact expected directory for the instrument editor plugins. You should now have all the tools you need to resolve this installation issue. If you still cannot, then you have to debug it. I provided you all the code locations involved on both sides (LS and Gigedit). Good luck! CU Christian |
|
From: Andrew C <cou...@gm...> - 2021-12-26 20:57:35
|
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();
|
|
From: Christian S. <sch...@li...> - 2021-12-27 14:40:11
|
On Sonntag, 26. Dezember 2021 21:57:12 CET Andrew C wrote:
> *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::EngineChanne
> l* 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());
The output of this was an empty string there, which means the sampler did not
load *any* plugin DLL at all.
> // 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."
> );
Has nothing to do with netcat.
> }
> 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;
> }
Wrong assumption. At this point it just *tried* to load plugins. It does not
mean it was able to actually load any plugin successfully.
You should rather debug what happens in the loop above.
for (dirent* pEntry = readdir(hDir); pEntry; pEntry = readdir(hDir)) {
...
}
That loops iterares over all files found in the plugin dir and then tries to
load every file that is actually a DLL file (i.e. filename ending with ".so").
> 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();
|
|
From: Andrew C <cou...@gm...> - 2021-12-28 10:21:48
|
Hi Christian,
Thanks a bunch for setting me on the right track with this. I can now see
that the engine is indeed successfully loading the instrument plugin, both
at startup and when an instrument editor is requested:
// load the DLL (the plugins should register themselfes automatically)
void* pDLL = dlopen(sPath.c_str(), RTLD_NOW);
if (pDLL) {
LoadedDLLs.push_back(pDLL);
fprintf (stderr, "Successfully loaded: %s\n", sPath.c_str()
);
}
else {
std::cerr << "Failed to load instrument editor plugin: '"
<< sPath << "', cause: " << dlerror() <<
std::endl;
}
}
closedir(hDir);
This is the fprintf'ed bit of code + a force reload of the plugins for
testing I'm using in AvailableEditors to track what's happening:
std::vector<String> InstrumentEditorFactory::AvailableEditors() {
// make sure plugins were loaded already
bPluginsLoaded = false; //force reload them
fprintf (stderr, "Trying to find an available editor.\n");
LoadPlugins();
// render result
std::vector<String> result;
std::map<String, InnerFactory*>::iterator iter =
InnerFactories.begin();
fprintf (stderr, "iterate InnerFactories.begin.\n");
for (; iter != InnerFactories.end(); iter++) {
fprintf(stderr, "Iterating through editors..\n ");
result.push_back(iter->first);
}
fprintf (stderr, "Returning available editors result.\n");
return result;
}
Registered sampler engines: 'GIG','SF2','SFZ'
Registered MIDI input drivers: ALSA,JACK
Registered audio output drivers: ALSA,JACK
Trying to find an available editor.
Loading instrument editor plugins...Successfully loaded:
/usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
OK
Iterating through editors..
Returning available editors result.
Registered instrument editors: 'gigedit'
This is the output when the instrument editor is successfully loaded
("interactively" using "EDIT CHANNEL INSTRUMENT 0" the LSCP shell):
Data type is libgig and data version is 4.3.0.svn34
Trying to find an available editor.
Loading instrument editor plugins...Successfully loaded:
/usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
OK
InnerFactories.begin.
Iterating through editors..
Returning available editors result.
Instrument plugin is 'gigedit'
Searching for matching editors now...
Trying to find an editor that can support: libgig and 4.3.0.svn34
Found a matching editor. :)
Trying to find an available editor.
Loading instrument editor plugins...Successfully loaded:
/usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
OK
InnerFactories.begin.
Iterating through editors..
Returning available editors result.
Registered instrument editors again: 'gigedit'
Searched finished for matching editors...
Found matching editor 'gigedit' for instrument
('/home/andrew/Desktop/Samples/1 Woodwinds/Dan Dean Solo Woodwinds/Dan Dean
Cl
arinet 5.1.gig', 0) having data structure ('libgig','4.3.0.svn34')
InstrumentEditor::Launch(instr=0x7f41b042b9d0,type=libgig,version=4.3.0.svn34)
This is the output when I, shall we say, non-interactively (i.e netcat)
send a command to Linuxsampler:
Data type is libgig and data version is 4.3.0.svn34
Trying to find an available editor.
Loading instrument editor plugins...Successfully loaded:
/usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
OK
InnerFactories.begin.
Returning available editors result.
Instrument plugin is
Searching for matching editors now...
Trying to find an editor that can support: libgig and 4.3.0.svn34
Trying to find an available editor.
Loading instrument editor plugins...Successfully loaded:
/usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
OK
InnerFactories.begin.
Returning available editors result.
Registered instrument editors again:
Searched finished for matching editors...
vEditors looks empty. What about available editors string?Trying to find an
available editor.
Loading instrument editor plugins...Successfully loaded:
/usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
OK
InnerFactories.begin.
Returning available editors result.
ERROR: There is not any instrument editor registered to the sampler!
It looks like the iterating through the previously registered editors gets
"forgotten" or otherwise the 'InnerFactories.begin()' loop is empty in the
'non-interactive' example..
Phew.. That's enough wall of text then!
Cheers,
Andrew.
On Mon, Dec 27, 2021 at 2:41 PM Christian Schoenebeck <
sch...@li...> wrote:
> On Sonntag, 26. Dezember 2021 21:57:12 CET Andrew C wrote:
> > *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::EngineChanne
> > l* 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());
>
> The output of this was an empty string there, which means the sampler did
> not
> load *any* plugin DLL at all.
>
> > // 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."
> > );
>
> Has nothing to do with netcat.
>
> > }
> > 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;
> > }
>
> Wrong assumption. At this point it just *tried* to load plugins. It does
> not
> mean it was able to actually load any plugin successfully.
>
> You should rather debug what happens in the loop above.
>
> for (dirent* pEntry = readdir(hDir); pEntry; pEntry = readdir(hDir)) {
> ...
> }
>
> That loops iterares over all files found in the plugin dir and then tries
> to
> load every file that is actually a DLL file (i.e. filename ending with
> ".so").
>
> > 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
> Lin...@li...
> https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
>
|
|
From: Christian S. <sch...@li...> - 2021-12-30 18:02:46
|
On Dienstag, 28. Dezember 2021 11:21:28 CET Andrew C wrote:
> This is the output when I, shall we say, non-interactively (i.e netcat)
> send a command to Linuxsampler:
>
> Data type is libgig and data version is 4.3.0.svn34
> Trying to find an available editor.
> Loading instrument editor plugins...Successfully loaded:
> /usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
> OK
> InnerFactories.begin.
> Returning available editors result.
> Instrument plugin is
> Searching for matching editors now...
> Trying to find an editor that can support: libgig and 4.3.0.svn34
> Trying to find an available editor.
> Loading instrument editor plugins...Successfully loaded:
> /usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
> OK
> InnerFactories.begin.
> Returning available editors result.
> Registered instrument editors again:
> Searched finished for matching editors...
> vEditors looks empty. What about available editors string?Trying to find an
> available editor.
> Loading instrument editor plugins...Successfully loaded:
> /usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
> OK
> InnerFactories.begin.
> Returning available editors result.
> ERROR: There is not any instrument editor registered to the sampler!
>
>
> It looks like the iterating through the previously registered editors gets
> "forgotten" or otherwise the 'InnerFactories.begin()' loop is empty in the
> 'non-interactive' example..
> Phew.. That's enough wall of text then!
Are you requesting a sampler reset per LSCP comand via netcat somewhere in
between? Because a sampler reset request will reset really everything, i.e.
the sampler would also call
src/Sampler.cpp:
void Sampler::Reset() {
...
InstrumentEditorFactory::ClosePlugins();
...
}
And ClosePlugin() closes all open plugin DLLs. Once the instrument editor DLL
is unloaded from memory, the following destructor code is executed
automatically:
src/plugins/InstrumentEditorFactory.h:
~InnerFactoryRegistrator() {
InnerFactoryTemplate<PluginClass_T> innerFactory;
InstrumentEditor* pEditor = innerFactory.Create();
if (InnerFactories.count(pEditor->Name())) {
InnerFactory* pZombie =
InnerFactories[pEditor->Name()];
InnerFactories.erase(pEditor->Name());
if (pZombie) delete pZombie;
}
innerFactory.Destroy(pEditor);
}
CU
Christian
|
|
From: Andrew C <cou...@gm...> - 2022-01-05 10:27:18
|
Hi Christian,
Ah ok, that was my issue with the instrument editor not opening after all!
I might be missing something, but once the plugins are closed and that
destructor code is run (i.e a RESET is sent), how can linuxsampler open
them up again?
At that point, sending the LSCP commands to create a new audio interface,
load a gig file and open it for editing again gives the 'cannot find
instrument editor' message.
Thanks,
Andrew.
On Thu, Dec 30, 2021 at 6:03 PM Christian Schoenebeck <
sch...@li...> wrote:
> On Dienstag, 28. Dezember 2021 11:21:28 CET Andrew C wrote:
> > This is the output when I, shall we say, non-interactively (i.e netcat)
> > send a command to Linuxsampler:
> >
> > Data type is libgig and data version is 4.3.0.svn34
> > Trying to find an available editor.
> > Loading instrument editor plugins...Successfully loaded:
> > /usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
> > OK
> > InnerFactories.begin.
> > Returning available editors result.
> > Instrument plugin is
> > Searching for matching editors now...
> > Trying to find an editor that can support: libgig and 4.3.0.svn34
> > Trying to find an available editor.
> > Loading instrument editor plugins...Successfully loaded:
> > /usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
> > OK
> > InnerFactories.begin.
> > Returning available editors result.
> > Registered instrument editors again:
> > Searched finished for matching editors...
> > vEditors looks empty. What about available editors string?Trying to find
> an
> > available editor.
> > Loading instrument editor plugins...Successfully loaded:
> > /usr/local/lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
> > OK
> > InnerFactories.begin.
> > Returning available editors result.
> > ERROR: There is not any instrument editor registered to the sampler!
> >
> >
> > It looks like the iterating through the previously registered editors
> gets
> > "forgotten" or otherwise the 'InnerFactories.begin()' loop is empty in
> the
> > 'non-interactive' example..
> > Phew.. That's enough wall of text then!
>
> Are you requesting a sampler reset per LSCP comand via netcat somewhere in
> between? Because a sampler reset request will reset really everything,
> i.e.
> the sampler would also call
>
> src/Sampler.cpp:
> void Sampler::Reset() {
> ...
> InstrumentEditorFactory::ClosePlugins();
> ...
> }
>
> And ClosePlugin() closes all open plugin DLLs. Once the instrument editor
> DLL
> is unloaded from memory, the following destructor code is executed
> automatically:
>
> src/plugins/InstrumentEditorFactory.h:
> ~InnerFactoryRegistrator() {
> InnerFactoryTemplate<PluginClass_T> innerFactory;
> InstrumentEditor* pEditor = innerFactory.Create();
> if (InnerFactories.count(pEditor->Name())) {
> InnerFactory* pZombie =
> InnerFactories[pEditor->Name()];
> InnerFactories.erase(pEditor->Name());
> if (pZombie) delete pZombie;
> }
> innerFactory.Destroy(pEditor);
> }
>
> CU
> Christian
>
>
>
>
> _______________________________________________
> Linuxsampler-devel mailing list
> Lin...@li...
> https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
>
|
|
From: Christian S. <sch...@li...> - 2022-01-05 16:32:21
|
On Mittwoch, 5. Januar 2022 11:26:57 CET Andrew C wrote: > Hi Christian, > > Ah ok, that was my issue with the instrument editor not opening after all! I disabled this behaviour for now as a workaround, so it no longer unloads instrument editor plugins on a LSCP "RESET" command: http://svn.linuxsampler.org/cgi-bin/viewvc.cgi?view=revision&revision=4021 > I might be missing something, but once the plugins are closed and that > destructor code is run (i.e a RESET is sent), how can linuxsampler open > them up again? > At that point, sending the LSCP commands to create a new audio interface, > load a gig file and open it for editing again gives the 'cannot find > instrument editor' message. IIRC The original intended behaviour was to unload all instrument editor plugins to prevent them causing a crash if they were still open, as a sampler reset basically wipes away everything from RAM editors are working on. ClosePlugin() then resets bPluginsLoaded, which would cause the next time instrument editors were requested, to automatically reload the plugins. And it did that actually there. However AFAICS the subsequent LSCP "CHANNEL EDIT" command was issued so fast on your side that it apparently caused a race condition: 1. now missing plugins were reloaded 2. previous DLL instance was unloaded and immediately deleted the new plugin instances of step (1.) again (due to the InnerFactoryDestructor being executed deferred) At least that's what I assume ATM. I currently don't have plans to address this potential race, from my comments in the svn diff you probably see that it would not be a quick and easy to fix, e.g. Windows would be tricky. Hence my decision for this workaround for now. CU Christian |