bolprocessor / php-frontend

A PHP interface for Bol Processor BP3
GNU General Public License v3.0
4 stars 2 forks source link

Csound segfault #2

Closed Aman1531 closed 2 years ago

Aman1531 commented 2 years ago

I have Csound 6.17 installed on Arch linux It is not working with Bol Processor . The issue occurs whenever php executes csound through Apache Exit status is 139 Issue persists when I downgraded to csound 6.16

belbernard commented 2 years ago

I am currently using Csound version 6.15 on a Mac0S 10.14 equipped with MAMP. Unfortunately not able to test Linux.

The version appeared with the command:

/usr/local/bin/csound --version --Csound version 6.15 (double samples) Aug 10 2020

Does this command work on your machine? Do you see the "Csound is installed and responsive" on the right top of the window?

Which Grammar or Data are you trying to operate?

The problem might just be in the syntax of the command since you are not in MacOS. So, let's see…

For instance, when PRODUCE ITEM(s) is clicked in grammar "-gr.Mozart", BP3 will first execute this command:

../bp produce -se ../ctests/-se.Mozart -gr ../ctests/-gr.Mozart -cs ../csound_resources/-cs.Mozart -d --csoundout ../my_output/Mozart.sco --traceout ../temp_bolprocessor/trace_5hvh0vhurlqrlhoul6sodr6r0n.txt

then the interface will send the following command to Csound:

/usr/local/bin/csound --wave -o ../my_output/Mozart@17325.wav ../csound_resources/0-default.orc ../my_output/Mozart.sco

"17325" is of course a random number aimed at preserving all occurrences of the WAV file.

These commands are displayed on a window showing up when "PRODUCE ITEM(s)" is called, as explained on https://bolprocessor.org/check-bp3/#csound

(Anyway I am going to check Csound 6.17!)

Aman1531 commented 2 years ago

csound --version command seg faults when it is executed with browser using Apache or lighttpd

belbernard commented 2 years ago

Well… Since "csound --version" is a pure Unix command, my guess is that this problem has nothing to do with BP3 (console and PHP interface)… Nonetheless I will try Csound 6.17 on Mac and let you know if I face a similar problem.

Aman1531 commented 2 years ago

Csound is also not owning this issue.

belbernard commented 2 years ago

"Not owning"… I don't understand. Do you mean that you can run Csound on your machine via another device? What is the syntax of the command? I tried to locate the meaning of "exit 139" on the Csound manual but wasn't successful.

Aman1531 commented 2 years ago

https://github.com/csound/csound/issues/1632 139 is bash exit code for seg fault You can also see the error in server error log which in linux is /var/log/httpd/error.log

How can I use bp on command line (without browser) ?

belbernard commented 2 years ago

Yes, but again you get this message with Linux command /usr/local/bin/csound --version which does not involve bp nor a browser. Therefore the problem may be only your installation of Csound.

Command lines are listed by command: ../bp --help

Below is the complete listing. Several commands have not (yet) been implemented in the PHP interface because we still miss an immplementation of the real-time MIDI output. There is not much you can do via exclusively command lines. You need to use or develop an interface to send commands to bp and then to csound…

Bol Processor console app Version 2.999... (May 21 2022)

Usage: ../bp action [options] { [file-type] inputfile }+

OPTIONS (General): -h or --help print this help information --version print the program name, version #, and date compiled --short-version print just the version number

ACTIONS: Specify which operation to perform. They are case-insensitive. produce produce one item from the grammar produce-items N produce N items from the grammar produce-all produce all items from the grammar

play play item in the input data file play-item N play the Nth item in the input data file play-all play all items in the input data file analyze-item N analyze the Nth item's derivation using the grammar expand expand item in the input data file to a complete polymetric expression show-beats N display the Nth item using periods to show the beats

compile check the syntax of input files and report errors templates produce templates from the grammar

FILE-TYPES: Input files are automatically recognized if they use BP's naming conventions (either prefixes or extensions). Otherwise, specify the type of input files with the following markers.

These file types can currently be loaded and used:

-da fname load data file 'fname' -gl fname load glossary file 'fname' -gr fname load grammar file 'fname' -ho fname load alphabet file 'fname' -se fname load settings file 'fname' -mi fname load sound-object prototypes file 'fname'

These file-type markers currently are recognized but ignored: -cs -in -kb -md -mi -or -tb -tr -wg +sc

OPTIONS (Output): -D or --display print produced items to standard output (default) -d or --no-display don't print produced items to standard output -o outfile write produced items to file 'outfile' -e or --use-stderr print messages to standard error instead of standard output --traceout tracefile write compilation & trace output to file 'tracefile'

--csoundout outfile write Csound score to file 'outfile' ('-' for stdout) --midiout outfile write Midi score to file 'outfile' ('-' for stdout) --midiformat num use Midi file format 0, 1, or 2 (default is 1) --rtmidi destination play real-time Midi on 'destination'

OPTIONS (Computation): -s or --start string use 'string' as the start string (default is "S") -S startfile read the start string from file 'startfile' --seed num seeds the random number generator with the integer 'num' --show-production outputs the work string at each step of producing items --trace-production outputs the work string & selected rule at each step of production

OPTIONS (Musical): --english specifies that the input files use English note conventions --french specifies that the input files use Italian/Spanish/French note conventions --indian specifies that the input files use Indian note conventions --keys specifies that the input files use Midi note numbers

belbernard commented 2 years ago

Maybe related with your request: after installing Csound 6.17, calling "csound --version" via exec() or system() hangs the PHP page although the same command in the terminal works fine for both versions. I submitted a query to the Csound forum…

Aman1531 commented 2 years ago

I use fluidsynth for midi out . Playing midi file is like aplaymidi -p 14 file.mid where 14 is port number of fluidsynth. How can I do the same with bp ? Bash supports pipes and redirection for combining programs. I hope I can do the same with bp and csound .

belbernard commented 2 years ago

FluidSynth seems to be an excellent improvement for the processing of MIDIfiles via BP3's interface. Thanks for the suggestion! As per today we only have the MIDIjs code played via HTML (with ugly sounds). Otherwise, I upload MIDI files to better synthesisers such as PianoTeq.

Therefore I am writing this development on our "to-do" list. I haven't yet looked at details but it shouldn't be too difficult if it is implemented in the interface…

As to pipes and redirections I'll need examples of commands that you would like to run. Keep in mind that BP3 should work on all platforms. In the PHP interface we have a getOS() function identifying the system, which helps customising shell commands if necessary.

belbernard commented 2 years ago

Regarding Csound: I am working on this problem and will hopefully get suggestions from the forum. Meanwhile, on page https://bolprocessor.org/check-bp3/ I have put a link for Mac users who need to download a copy of Csound 6.15.

belbernard commented 2 years ago

This problem has been identified and will be fixed in version 6.18 of Csound.