Discussion:
[Linuxsampler-devel] lscp loader
Nicola Pandini
2014-04-13 02:02:40 UTC
Permalink
Hi,
I have problems with netcat of a big lscp file (~250 lines).
Sometimes happens that the loading stops before the end. It seems that
netcat is too fast.
So I wrote this bash script that introduces some latency between every
line that is sent to LS:

#!/bin/sh
while read line
do
if [ "$( echo "${line}" | head -c 1)" != "#" ]
then
echo "${line}" | netcat -q 0.01 localhost 8888 &
sleep 0.1
fi
done < $1
--
Nicola
http://nicolapandini.damai.it
Stjepan Horvat
2014-04-13 05:13:07 UTC
Permalink
i have tried all kinds of netcats and combinations of invoking the config
file but non is 100% relieble when i try to load it using bash script or
systemd at startup..for example i have 27 channels and 27 instruments..it
stops at 24 or 26..
Christian Schoenebeck
2014-04-13 10:52:14 UTC
Permalink
Post by Stjepan Horvat
i have tried all kinds of netcats and combinations of invoking the config
file but non is 100% relieble when i try to load it using bash script or
systemd at startup..for example i have 27 channels and 27 instruments..it
stops at 24 or 26..
You mean the LSCP server freezes?

CU
Christian
Stjepan Horvat
2014-04-13 11:51:02 UTC
Permalink
no..it just doesnt complete the config loading..its like if it never comes
to the server..
On Apr 13, 2014 1:49 PM, "Christian Schoenebeck" <
Post by Christian Schoenebeck
Post by Stjepan Horvat
i have tried all kinds of netcats and combinations of invoking the config
file but non is 100% relieble when i try to load it using bash script or
systemd at startup..for example i have 27 channels and 27 instruments..it
stops at 24 or 26..
You mean the LSCP server freezes?
CU
Christian
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Linuxsampler-devel mailing list
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
Christian Schoenebeck
2014-04-13 11:07:28 UTC
Permalink
Post by Stjepan Horvat
no..it just doesnt complete the config loading..its like if it never comes
to the server..
It's very unlikely that this misbehavior could be a bug in netcat, bash or the
TCP/IP stack of your OS. It rather sounds like a bug in the sampler's internal
instrument manager or the LSCP server. There are various individual tasks
inside the sampler for which separate threads are spawned. And if there is
some kind of bug regarding the synchronization between those threads (of the
sampler) it can lead to such a misbehavior. So debugging this issue on sampler
side would be preferable, to get some informations what's going on when this
misbehavior occurs.

CU
Christian
Stjepan Horvat
2014-04-13 12:38:17 UTC
Permalink
is there a way to see what did sampler recive before it has send its data
for loading....?
On Apr 13, 2014 2:04 PM, "Christian Schoenebeck" <
Post by Christian Schoenebeck
Post by Stjepan Horvat
no..it just doesnt complete the config loading..its like if it never
comes
Post by Stjepan Horvat
to the server..
It's very unlikely that this misbehavior could be a bug in netcat, bash or the
TCP/IP stack of your OS. It rather sounds like a bug in the sampler's internal
instrument manager or the LSCP server. There are various individual tasks
inside the sampler for which separate threads are spawned. And if there is
some kind of bug regarding the synchronization between those threads (of the
sampler) it can lead to such a misbehavior. So debugging this issue on sampler
side would be preferable, to get some informations what's going on when this
misbehavior occurs.
CU
Christian
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Linuxsampler-devel mailing list
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
Christian Schoenebeck
2014-04-13 11:55:04 UTC
Permalink
Post by Stjepan Horvat
is there a way to see what did sampler recive before it has send its data
for loading....?
Sure! Recompile the server with increased debug level:

./configure --enable-debug-level=2
make

Debug level 2 like suggested, should be enough for this. Then run the sampler
(no need to install it):

src/linuxsampler

Then it should show a debug message for every LSCP command recognized by the
LSCP server (see src/network/lscpserver.cpp).

In the sampler's source code you see debug messages are placed like this:

dmsg(2,("This is some value to debug: %d\n", value));

The number in front indicates the minimum debug level for the debug message to
be printed to the console.

CU
Christian
Nicola Pandini
2014-04-25 16:29:15 UTC
Permalink
I tried with debug-level=2 several times, but the problem didn't occurs.
To make it occurs, I had to compile linuxsampler with the following options:
./configure --enable-debug-level=2 --enable-refill-streams=2
--enable-stream-size=320000 --enable-preload-samples=65536
--enable-max-voices=200 --enable-max-streams=220
I found these options here: http://www.linuxsampler.org/debian.html
The differences between the two versions are:
# Preload Samples: 32768 - (the latter version has 65536)
# Streams to be refilled per Disk Thread Cycle: 4 - (the latter version
has 2)
# Default Maximum Disk Streams: 90 - (the latter version has 220)
# Default Maximum Voices: 64 - (the latter version has 200)

I attached a .tar.gz that contains the lscp file, and three different
logs where you can see that the loading stops before the end.
Post by Christian Schoenebeck
Post by Stjepan Horvat
is there a way to see what did sampler recive before it has send its data
for loading....?
./configure --enable-debug-level=2
make
Debug level 2 like suggested, should be enough for this. Then run the sampler
src/linuxsampler
Then it should show a debug message for every LSCP command recognized by the
LSCP server (see src/network/lscpserver.cpp).
dmsg(2,("This is some value to debug: %d\n", value));
The number in front indicates the minimum debug level for the debug message to
be printed to the console.
CU
Christian
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Linuxsampler-devel mailing list
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
--
Nicola
Stjepan Horvat
2014-04-25 17:34:43 UTC
Permalink
Thanks for caring..I appriciate it..
Post by Nicola Pandini
I tried with debug-level=2 several times, but the problem didn't occurs.
./configure --enable-debug-level=2 --enable-refill-streams=2
--enable-stream-size=320000 --enable-preload-samples=65536
--enable-max-voices=200 --enable-max-streams=220
I found these options here: http://www.linuxsampler.org/debian.html
# Preload Samples: 32768 - (the latter version has 65536)
# Streams to be refilled per Disk Thread Cycle: 4 - (the latter version
has 2)
# Default Maximum Disk Streams: 90 - (the latter version has 220)
# Default Maximum Voices: 64 - (the latter version has 200)
I attached a .tar.gz that contains the lscp file, and three different logs
where you can see that the loading stops before the end.
Post by Christian Schoenebeck
Post by Stjepan Horvat
is there a way to see what did sampler recive before it has send its data
for loading....?
./configure --enable-debug-level=2
make
Debug level 2 like suggested, should be enough for this. Then run the sampler
src/linuxsampler
Then it should show a debug message for every LSCP command recognized by the
LSCP server (see src/network/lscpserver.cpp).
dmsg(2,("This is some value to debug: %d\n", value));
The number in front indicates the minimum debug level for the debug message to
be printed to the console.
CU
Christian
------------------------------------------------------------
------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Linuxsampler-devel mailing list
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
--
Nicola
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Linuxsampler-devel mailing list
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel
Nicola Pandini
2014-04-13 20:04:36 UTC
Permalink
I forgot to mention that:
- I successfully load the .lscp if I open it with QSampler and Fantasia.
- I also successfully load the .lscp with netcat if I set netcat -i 1
(-i 1 means that netcat waits 1 second between each line of text, but
unfortunately you can't tell netcat to wait less than 1 second, so it
will take too much time to finish).
Post by Nicola Pandini
Hi,
I have problems with netcat of a big lscp file (~250 lines).
Sometimes happens that the loading stops before the end. It seems that
netcat is too fast.
So I wrote this bash script that introduces some latency between every
#!/bin/sh
while read line
do
if [ "$( echo "${line}" | head -c 1)" != "#" ]
then
echo "${line}" | netcat -q 0.01 localhost 8888 &
sleep 0.1
fi
done < $1
--
Nicola
Christian Schoenebeck
2014-04-14 10:17:20 UTC
Permalink
Post by Nicola Pandini
- I successfully load the .lscp if I open it with QSampler and Fantasia.
Those have a "natural" delay between sending the LSCP commands, since QSampler
and Fantasia are also executing their UI code in between.
Post by Nicola Pandini
- I also successfully load the .lscp with netcat if I set netcat -i 1
(-i 1 means that netcat waits 1 second between each line of text, but
unfortunately you can't tell netcat to wait less than 1 second, so it
will take too much time to finish).
And which type of LSCP commands fail actually? A simple

cat whatever.lscp | netcat localhost 8888

"should" always work without problems. If not, then it is most probably a bug
in the sampler, which should be fixed. My guess is that it might be something
about MIDI instruments.

CU
Christian
Loading...