More LS blues

You're new to the LinuxSampler world? You don't know where to start and nothing works? Here's the place to ask for help.
Post Reply
delvento
Newbie
Posts: 9
Joined: Sat Nov 20, 2021 2:48 am

More LS blues

Post by delvento » Sun Nov 21, 2021 10:41 pm

Ok, so after I solved the yyrhs issue, I am now encountering this other error when compiling gigedit

Code: Select all

ScriptPatchVars.cpp:153:5: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::ScriptVM* vm = LinuxSampler::ScriptVMFactory::Create("gig");
    ^
ScriptPatchVars.cpp:153:34: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::ScriptVM* vm = LinuxSampler::ScriptVMFactory::Create("gig");
                                 ^
ScriptPatchVars.cpp:154:5: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::VMParserContext* ctx = vm->loadScript(
    ^
ScriptPatchVars.cpp:155:45: error: use of undeclared identifier 'String'; did you mean 'ToString'?
        script->GetScriptAsText(), std::map<String,String>(), &vars
                                            ^~~~~~
                                            ToString
./global.h:139:38: note: 'ToString' declared here
template<class T> inline std::string ToString(T o) {
                                     ^
ScriptPatchVars.cpp:155:52: error: unknown type name 'String'; did you mean 'GString'?
        script->GetScriptAsText(), std::map<String,String>(), &vars
                                                   ^~~~~~
                                                   GString
/usr/include/glib-2.0/glib/gstring.h:39:33: note: 'GString' declared here
typedef struct _GString         GString;
                                ^
ScriptPatchVars.cpp:155:45: error: template argument for template type parameter must be a type
        script->GetScriptAsText(), std::map<String,String>(), &vars
                                            ^~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_multimap.h:68:22: note: template parameter is declared
      here
  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
                     ^
ScriptPatchVars.cpp:163:5: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::optional<std::string> defaultValue;
    ^
ScriptPatchVars.cpp:164:5: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::optional<std::string> overrideValue;
    ^
which is so annoying since LinuxSampler identifier is all over the place in header files in include/linuxsampler/

Ignoring that error, and instead starting linuxsampler it crashes as follows when the GUI (I'm using Fantasia) tries to attach to it

Code: Select all

LinuxSampler 2.2.0
Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck
Copyright (C) 2005-2021 Christian Schoenebeck
Binary built: Nov 21 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: 
Registered internal effect systems: LADSPA
Registered internal effects: 109
Starting LSCP network server (0.0.0.0:8888)...OK
LinuxSampler initialization completed. :-)

LSCPServer: Client connection established on socket:4.
LSCPServer: Client connection established on socket:5.
ALSA lib conf.c:3523:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so
ALSA lib control.c:1373:(snd_ctl_open_noupdate) Invalid CTL hw:0
AudioOutputDeviceAlsa: Cannot open sound control for card 0 - No such file or directory
AudioOutputDeviceAlsa: Can't find any card
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)
Probably it's a moot point but the error on the console which started the GUI is as follows

Code: Select all

Nov 21, 2021 2:28:36 PM org.linuxsampler.lscp.Client setSoTimeout
INFO: Unable to set timeout
java.net.SocketException: Socket Closed
	at java.base/java.net.AbstractPlainSocketImpl.setOption(AbstractPlainSocketImpl.java:248)
	at java.base/java.net.Socket.setSoTimeout(Socket.java:1159)
	at org.linuxsampler.lscp.Client.setSoTimeout(Client.java:188)
	at org.jsampler.task.Global$SetClientReadTimeout.exec(Global.java:265)
	at org.jsampler.task.EnhancedTask.run(EnhancedTask.java:57)
	at net.sf.juife.AbstractTask.invokeAndWait(AbstractTask.java:180)
	at net.sf.juife.TaskQueue.processTheQueue(TaskQueue.java:176)
	at net.sf.juife.TaskQueue.start0(TaskQueue.java:147)
	at net.sf.juife.TaskQueue.access$000(TaskQueue.java:43)
	at net.sf.juife.TaskQueue$1.run(TaskQueue.java:140)

Nov 21, 2021 2:28:37 PM org.jsampler.DefaultLSConsoleModel$LSConsoleThread run
INFO: Stream closed.
java.io.IOException: Stream closed.
	at java.base/java.net.AbstractPlainSocketImpl.available(AbstractPlainSocketImpl.java:519)
	at java.base/java.net.SocketInputStream.available(SocketInputStream.java:235)
	at org.jsampler.DefaultLSConsoleModel$LscpInputStream.available(DefaultLSConsoleModel.java:528)
	at org.jsampler.DefaultLSConsoleModel$LSConsoleThread.processInput(DefaultLSConsoleModel.java:467)
	at org.jsampler.DefaultLSConsoleModel$LSConsoleThread.run(DefaultLSConsoleModel.java:443)
with the second part repeating over and over, and the GUI showing two dialogs saying "Connection to backend failed" and "Getting Audio Output Drivers: AudioOutputDeviceAlsa: Can't find any card" respectively. Not sure why the GUI does not let me select the other backend (or card), since at configure time it said:

Code: Select all

# Audio Output Drivers:
# ALSA: yes, JACK: yes, ARTS: no, CoreAudio: no, ASIO: no
So Jack should be available inside LinuxSampler. Getting this to work is so frustrating.... Any clues?

PS: it goes without saying that the computer I'm running this on has perfectly fine working ALSA installation which other applications (for example PianoTeQ) work fine with. Jack is also installed but not enabled -- yet I can select it with other applications (for same example PianoTeQ), even though it obviously does not sound (but does not crash anything either)

User avatar
cuse
Developer
Posts: 362
Joined: Wed Jan 23, 2008 10:07 pm
Location: Germany

Re: More LS blues

Post by cuse » Mon Nov 22, 2021 9:28 pm

That's a very uncommon compiler error that you got there. That more looks like a follow-up compiler error, not the very first one. Please check if you see any compiler error before that.

About the ALSA issue: the error message shows that you already get an error on ALSA level, which is inside libasound, not LS. Apparently ALSA tries to open Pulse Audio there and then aborts.

delvento
Newbie
Posts: 9
Joined: Sat Nov 20, 2021 2:48 am

Re: More LS blues

Post by delvento » Mon Nov 22, 2021 9:44 pm

Thanks for getting back to me. Here is the full compile output

Code: Select all

$ make && make install
make  all-recursive
make[1]: Entering directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0'
Making all in src
make[2]: Entering directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0/src'
Making all in gigedit
make[3]: Entering directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0/src/gigedit'
Making all in gfx
make[4]: Entering directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0/src/gigedit/gfx'
  CXX      builtinpix.lo
  CC       black_loop.lo
  CC       blue_hatched_pattern.lo
  CC       blue_hatched_pattern2.lo
  CC       grayblue_hatched_pattern.lo
  CC       gray_loop.lo
  CC       red_dot.lo
  CC       yellow_dot.lo
  CXXLD    libgigeditgfx.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[4]: Leaving directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0/src/gigedit/gfx'
make[4]: Entering directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0/src/gigedit'
  CXX      main.o
  CXX      libgigedit_la-Settings.lo
  CXX      libgigedit_la-compat.lo
  CXX      libgigedit_la-gigedit.lo
  CXX      libgigedit_la-mainwindow.lo
  CXX      libgigedit_la-regionchooser.lo
  CXX      libgigedit_la-dimregionchooser.lo
  CXX      libgigedit_la-dimregionedit.lo
  CXX      libgigedit_la-paramedit.lo
  CXX      libgigedit_la-dimensionmanager.lo
  CXX      libgigedit_la-CombineInstrumentsDialog.lo
  CXX      libgigedit_la-midirules.lo
  CXX      libgigedit_la-scripteditor.lo
  CXX      libgigedit_la-ScriptPatchVars.lo
ScriptPatchVars.cpp:153:5: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::ScriptVM* vm = LinuxSampler::ScriptVMFactory::Create("gig");
    ^
ScriptPatchVars.cpp:153:34: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::ScriptVM* vm = LinuxSampler::ScriptVMFactory::Create("gig");
                                 ^
ScriptPatchVars.cpp:154:5: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::VMParserContext* ctx = vm->loadScript(
    ^
ScriptPatchVars.cpp:155:45: error: use of undeclared identifier 'String'; did you mean 'ToString'?
        script->GetScriptAsText(), std::map<String,String>(), &vars
                                            ^~~~~~
                                            ToString
./global.h:139:38: note: 'ToString' declared here
template<class T> inline std::string ToString(T o) {
                                     ^
ScriptPatchVars.cpp:155:52: error: unknown type name 'String'; did you mean 'GString'?
        script->GetScriptAsText(), std::map<String,String>(), &vars
                                                   ^~~~~~
                                                   GString
/usr/include/glib-2.0/glib/gstring.h:39:33: note: 'GString' declared here
typedef struct _GString         GString;
                                ^
ScriptPatchVars.cpp:155:45: error: template argument for template type parameter must be a type
        script->GetScriptAsText(), std::map<String,String>(), &vars
                                            ^~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_multimap.h:68:22: note: template parameter is declared
      here
  template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
                     ^
ScriptPatchVars.cpp:163:5: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::optional<std::string> defaultValue;
    ^
ScriptPatchVars.cpp:164:5: error: use of undeclared identifier 'LinuxSampler'
    LinuxSampler::optional<std::string> overrideValue;
    ^
8 errors generated.
Makefile:831: recipe for target 'libgigedit_la-ScriptPatchVars.lo' failed
make[4]: *** [libgigedit_la-ScriptPatchVars.lo] Error 1
make[4]: Leaving directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0/src/gigedit'
Makefile:934: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0/src/gigedit'
Makefile:417: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0/src'
Makefile:466: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/davide/Music/LinuxSampler-2.2.0/tarballs/gigedit-1.2.0'
Makefile:396: recipe for target 'all' failed
make: *** [all] Error 2
As you can see the only thing I get before is the warning

Code: Select all

ar: `u' modifier ignored since `D' is the default (see `U')

User avatar
cuse
Developer
Posts: 362
Joined: Wed Jan 23, 2008 10:07 pm
Location: Germany

Re: More LS blues

Post by cuse » Tue Nov 23, 2021 2:08 pm

Ok, looks like gigedit's configure script did not detect LS as installed, which you can verify by looking at gigedit's generated value for HAVE_LINUXSAMPLER in config.h. If that macro's value is 0 then gigedit's configure did not find the LS header files installed on the system.

delvento
Newbie
Posts: 9
Joined: Sat Nov 20, 2021 2:48 am

Re: More LS blues

Post by delvento » Tue Nov 23, 2021 3:23 pm

Thanks very much for the clue. I should have suspected that myself and found it without your help, sorry.
Obviously, you are correct, the question is why? Digging deeper, in config.log there is the following

Code: Select all

configure:19695: $PKG_CONFIG --exists --print-errors "linuxsampler >= $liblinuxsampler_version"
Package linuxsampler was not found in the pkg-config search path.
Perhaps you should add the directory containing `linuxsampler.pc'
to the PKG_CONFIG_PATH environment variable
No package 'linuxsampler' found
The problem is that the linuxsampler.pc file did not get installed with make install. Running a full system find for it, it's found only in the compilation directory tarballs/linuxsampler-2.2.0/linuxsampler.pc

Manually copying it into lib/pkgconfig/ solved this issue. Not sure why it was not copied in the first place, I haven't checked the make install target for LinuxSampler itself and I did not save the make install logs (but I plan to do a reinstall, let me know if you want me to report anything, either here or as a bug report -- if you or someone else gives me an account int the bug tracker).

I am encountering another small issue which I will fix later today, and then only the ALSA issue remains. I have not experience programming the sound subsystems, do you have any suggestions here? Even appropriate documentation to read, which is related to how LS is using ALSA? I mean, other software on the same hardware (e.g. PianoTeq) works just fine using the ALSA audio device type with PulseAudio output. And yes, I had PianoTeq closed when I was trying LS.

Thanks

delvento
Newbie
Posts: 9
Joined: Sat Nov 20, 2021 2:48 am

Re: More LS blues

Post by delvento » Tue Nov 23, 2021 6:08 pm

Removing all things which I reported to bugzilla instead.

For reference they are So now I am able to run LS with Fantasia and try things around. I don't receive anymore that weird ALSA error that stops the GUI, so that's progress, since I can now try various settings.

Trying to load instruments from file still fails with the GUI error "Assigning instrument: No audio device connected to the sampler channel" (the audio output dropdown menu for the channel is empty) and the LS log is as follows

Code: Select all

LinuxSampler 2.2.0
Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck
Copyright (C) 2005-2021 Christian Schoenebeck
Binary built: Nov 23 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
Registered internal effects: 109
Starting LSCP network server (0.0.0.0:8888)...Thread: WARNING, can't mlockall() memory!
OK
LinuxSampler initialization completed. :-)

LSCPServer: Client connection established on socket:4.
LSCPServer: Client connection established on socket:5.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback
Cannot use real-time scheduling (RR/10)(1: Operation not permitted)
AcquireSelfRealTime error
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
JackTemporaryException : now quits...
Jack main caught signal 2
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
Cannot write socket fd = 6 err = Broken pipe
CheckRes error
CheckRes error
Could not write request type = 24
Released audio card Audio0
audio_reservation_finish
Cannot write socket fd = 19 err = Broken pipe
CheckRes error
Could not write notification
ClientNotify fails name = freewheel notification = 1 val1 = 0 val2 = 0
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
Cannot create RT messagebuffer thread: Operation not permitted (1)
Retrying messagebuffer thread without RT scheduling
Messagebuffer not realtime; consider enabling RT scheduling for user
no message buffer overruns
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback
Cannot use real-time scheduling (RR/10)(1: Operation not permitted)
AcquireSelfRealTime error
Cannot lock down 82280346 byte memory area (Cannot allocate memory)
JackTemporaryException : now quits...
Jack main caught signal 2
Released audio card Audio0
audio_reservation_finish
Instruments DB directory '/var/lib/linuxsampler' does not exist!
No audio output device connected to sampler channel
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
No audio output device connected to sampler channel
No audio output device connected to sampler channel
No audio output device connected to sampler channel
Even without knowing anything about audio soundsystem, I recognize that "Invalid value for card" as something to change, however in the audio devices section of Fantasia the drop down menu for card has only 0,0 which is what I've selected. The same behavior occur with ALSA or JACK (or both, not sure if "both" is something actually happening since it's unclear from the GUI).

Any clue will be greatly appreciated

delvento
Newbie
Posts: 9
Joined: Sat Nov 20, 2021 2:48 am

Re: More LS blues

Post by delvento » Thu Nov 25, 2021 1:02 am

After (metaphorically) banging my head on the keyboard long enough, the (metaphorical) blood shortened the switches under the right keys and solved the issue.

I needed to "create" an audio device not just "look" at what the "Audio Devices" window on the right show. The instruments that are loaded after doing that (but not the ones loaded before) will sound.

After some rest, I will now try to use it for what I wanted to play on my piano with LS (if I remember still what it was :lol:)

User avatar
cuse
Developer
Posts: 362
Joined: Wed Jan 23, 2008 10:07 pm
Location: Germany

Re: More LS blues

Post by cuse » Fri Nov 26, 2021 4:12 pm

You might consider trying QSampler as frontend. I can't remember what Fantasia/JSampler is doing, but QSampler automatically creates audio/MIDI device automatically when you add a "sampler channel" (a.k.a. "sampler part").

Once you have your desired setup that you might use frequently, you can save your session with QSampler to a .lscp file, and then in future you might just restore your session with LS from the command line.

Post Reply