-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jacko hangs because of 'e' #1
Comments
I think I have had other, different problems with 'e' myself. Might be related. |
Trouble getting things going on macOS. However, this works:
|
I don't have a MIDI interface showing up in Jack. However, I can still reproduce the problem. It looks like I need to get on Linux to debug this properly. The thread to close the Jack state completes, but then the Jack state starts up again. There is probably a simple solution -- either check some existing or new flag or condition in the Jack state creation code, or put in diagnostics to see if there is a data race. |
Yes that the problem; the Jack state starts up again. Sorry you had to find out how to run Jack on OSX and then have to go to Linux anyway.... |
Not a problem. I will be able to get to this next week, when I go back to
where I have a good Linux setup.
…-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com
On Wed, Oct 25, 2023 at 11:40 AM Menno Knevel ***@***.***> wrote:
Yes that the problem; the Jack state starts up again. Sorry you had to
find out how to run Jack on OSX and then have to go to Linux anyway....
—
Reply to this email directly, view it on GitHub
<#1 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQIGJIIR3NHUIIRBFEWXYDYBEXGXAVCNFSM6AAAAAA6NYKG6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZZGU2TSMZYGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I have build Csound 6.19 and the plugins on Ubuntu and can reproduce the error. But I get another error, stack smashing, and can't open the MIDI port on my Focusrite. It's not clear to me what MIDI port events.csd should be connecting to -- capture, or playback? Well, capture is "in" and playback is "out." It's also not clear to me whether to use "raw" or "seq" MIDI. |
mkg@xenakis:/etc$ lsb_release -a |
Re: stack smashing |
I have fixed the stack smashing, which was caused by faulty or, at least, flaky logic in the JackoMidiInConnect and JackoMidiOutConnect opcodes, which were unnecessarily translating back and forth between port objects and port names; I have simplified the code to use only port names. I rewrote the test csds, combined them into one, and added some stuff it; it's attached. jacko_test.txt |
Where can i find these improved Jacko opcodes? |
Some more progress. I changed CMakeLists.txt to link with But there is no sound! |
Can you test if the Midi connection is working? |
Now there is sound. I had introduced a new bug! Now the sound is perfect when Csound instruments are playing, but there is a buzz when Csound is silent. I think this will be easy to fix. |
sounds spooky! |
This may help understand: https://github.com/resinbeard/jacksandbox/blob/master/sandbox.c |
The new jacko.cpp file is here:
https://github.com/gogins/plugins/blob/develop/src/jackops/jacko.cpp
I don't think this will work unless you link with libjack.so rather than
libjackserver.so.
-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com
…On Wed, Nov 1, 2023 at 4:23 AM Menno Knevel ***@***.***> wrote:
Where can i find these improved Jacko opcodes?
—
Reply to this email directly, view it on GitHub
<#1 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQIGJKMXBWEPYPGRY6L5BDYCIBINAVCNFSM6AAAAAA6NYKG6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBYGU4DIMRQGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Updated test, so that it tests:
|
i am still unable to build and test. But i do not know what i am doing and get the same: |
Now that everything seems to be working, I'll do some more testing. I'll put a binary up here right away, and I'll try to fix the build system also. If the build system works and your tests are OK I will do a pull request. |
I will do the testing tomorrow, and get back to you with a report. Thanks! |
i was able to build the Plugins.
result with cmake: //Path to a library. //Dependencies for the target //Dependencies for the target installing:
Then, over to the jacko_test csd in Visual Studio Code:
Then an error:
Even now that Csound Aborted, i still see the Csound Midiout port active: i manually killed Zyn and Csound. Then i started to try and cut back the csd. I stopped Jackd from Cadence, and restarted it. I noticed that in the jacko_test.csd, 2 times JackoInfo was set. So i deleted one of them to see what happens.
So i took out JackoInfo to avoid the error, and ran the csd. A VERY LOUD sine wave was piercing my head!
So i changed this connection so that it would connect to some hardware synth i have: and in the score i changed the amplitude of instr 1 to a MUCH lower level:
to
Then run the csd again:
After 20 seconds instr 1000 kicks in and closes all activity:
Q: is JackoOn not needed anymore? I do think the issue is solved. Thanks for your work! It still crashes Blue immediately and do not know why.I think i will have to turn to Steven and hope he might have a peak and debug why this is not working in Blue. |
Thanks for testing!
This is good news, but I am not done yet. I will do some more debugging
before I issue a pull request.
Best,
Mike
…On Sun, Nov 5, 2023, 08:01 Menno Knevel ***@***.***> wrote:
i was able to build the Plugins.
There are a few opcodes i will not use and do not have their dependencies
on my computer. So, in CMakeLists.txt, i manually deleted:
add_subdirectory(./src/faustcsound)
add_subdirectory(./src/AbletonLinkOpcodes)
add_subdirectory(./src/CUDA)
add_subdirectory(./src/websockets)
add_subdirectory(./src/wiimote)
add_subdirectory(./src/p5glove)
add_subdirectory(./src/hdf5)
add_subdirectory(./src/widgets)
result with cmake:
//Path to a library.
JACK_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libjack.so
//Dependencies for the target
jackTransport_LIB_DEPENDS:STATIC=general;/usr/lib/x86_64-linux-gnu/libjack.so;
//Dependencies for the target
jacko_LIB_DEPENDS:STATIC=general;/usr/lib/x86_64-linux-gnu/libjack.
result with make:
[ 77%] Linking CXX shared module libjacko.so
Installed succesfully:
-- Install configuration: ""
-- Installing: /usr/local/lib/csound/plugins64-6.0/libchua.so
-- Installing: /usr/local/lib/csound/plugins64-6.0/libimage.so
-- Installing: /usr/local/lib/csound/plugins64-6.0/libpy.so
-- Installing: /usr/local/lib/csound/plugins64-6.0/libstkops.so
-- Installing: /usr/local/lib/csound/plugins64-6.0/liblinear_algebra.so
-- Installing: /usr/local/lib/csound/plugins64-6.0/libmp3out.so
-- Installing: /usr/local/lib/csound/plugins64-6.0/libjacko.so
-- Installing: /usr/local/lib/csound/plugins64-6.0/libjackTransport.so
-- Installing: /usr/local/lib/csound/plugins64-6.0/libfluidOpcodes.so
Then, over to the jacko_test csd in Visual Studio Code:
- I activated zynaddsubfx as requested.
Then an error:
...
40: Input 8 bit raw midi zynaddsubfx:osc
41: Output 8 bit raw midi system:midi_capture_6
Alias: alsa_pcm:Csound/midi_playback_1
Alias: Csound:midi/playback_1
42: Input 8 bit raw midi zynaddsubfx:midi_input
*** stack smashing detected ***: terminated
csound command: Aborted
inactive allocs returned to freespace
end of score. overall amps: 0.0 0.0
overall samples out of range: 0 0
0 errors in performance
Elapsed time at end of performance: real: 0.277s, CPU: 0.013s
JackoState::close...
Jack client deactivated.
Jack ports unregistered.
Jack client closed.
JackoState::close.
...
Even now that Csound Aborted, i still see the Csound Midiout port active:
[image: Screenshot from 2023-11-05 13-18-20]
<https://user-images.githubusercontent.com/6670911/280527632-59da5529-ce2a-4484-8387-08ac67671397.png>
i manually killed Zyn and Csound.
Then i started to try and cut back the csd. I stopped Jackd from Cadence,
and restarted it.
I noticed that in the jacko_test.csd, *2 times JackoInfo* was set. So i
deleted one of them to see what happens.
*** stack smashing detected ***: terminated
csound command: Aborted
So i took out JackoInfo to avoid the error, and ran the csd. A VERY LOUD
sine wave was piercing my head!
But i saw the connection: JackoMidiInConnect "system:midi_capture_1",
"midiin"
and
JackoAudioOutConnect "audio_out_left", "system:playback_1"
JackoAudioOutConnect "audio_out_right", "system:playback_2"
and
JackoMidiOutConnect "midiout", "zynaddsubfx:midi_input" but as i deleten
Zyn, it was not connecting.
instr 801: p1 = 801.000 p2 = 10.000 p3 = 3.000 p4 = 69.000 p5 = 60.000
csound command: Segmentation fault
jack_port_get_buffer called with an incorrect port 0
jack_midi_event_reserve: port buffer is set to NULL
So i changed this connection so that it would connect to some hardware
synth i have:
JackoMidiOutConnect "midiout", "M-Audio-Delta-1010:midi/capture_1"
and in the score i changed the amplitude of instr 1 to a MUCH lower level:
from
i1 5 3 63 60
i801 10 3 69 60
i1 15 3 72 60
to
i1 5 3 63 3
i801 10 3 69 60
i1 15 3 72 3
Then run the csd again:
instr 900: p1 = 900.000 p2 = 0.000 p3 = -1.000
Jacko is now driving Csound performance...
B 0.000 .. 5.000 T 5.000 TT 5.000 M: 0.0 0.0
new alloc for instr 1:
instr 1: p1 = 1.000 p2 = 5.000 p3 = 3.000 p4 = 63.000 p5 = 3.000
instr 1: i_frequency = 311.127 i_amplitude = 1.413
B 5.000 .. 10.000 T 10.000 TT 10.000 M: 1.4 1.4
new alloc for instr 801:
instr 801: p1 = 801.000 p2 = 10.000 p3 = 3.000 p4 = 69.000 p5 = 60.000
noteon: 144 69 60
Sent note to midiout.
noteoff: 128 69 0
B 10.000 .. 15.000 T 15.000 TT 15.000 M: 0.0 0.0
instr 1: p1 = 1.000 p2 = 15.000 p3 = 3.000 p4 = 72.000 p5 = 3.000
instr 1: i_frequency = 523.251 i_amplitude = 1.413
B 15.000 .. 20.000 T 20.000 TT 20.000 M: 1.4 1.4
new alloc for instr 1000:
instr 1000: p1 = 1000.000 p2 = 20.000 p3 = 1.000
Ending Csound performance with 'e' event
rtevent: T 20.003 TT 20.003 M: 0.0 0.0
Score finished in csoundPerformKsmpsInternal().
Csound performance driven by Jack has finished.
JackoState::close...
Jack client deactivated.
Jack ports unregistered.
Jack client closed.
Jacko has quit driving Csound performance.
JackoState::close.
WARNING: Buffer underrun in real-time audio output
After 20 seconds instr 1000 kicks in and closes all activity:
Ending Csound performance with 'e' event
rtevent: T 20.003 TT 20.003 M: 0.0 0.0
Score finished in csoundPerformKsmpsInternal().
Csound performance driven by Jack has finished.
JackoState::close...
Jack client deactivated.
Jack ports unregistered.
Jack client closed.
Jacko has quit driving Csound performance.
JackoState::close.
B 20.000 .. 60.000 T 60.000 TT 60.000 M: 0.0 0.0
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score. overall amps: 1.4 1.4
overall samples out of range: 0 0
0 errors in performance
Elapsed time at end of performance: real: 70.025s, CPU: 4.902s
11250 512 sample blks of 64-bit floats written to dac
*Q: is JackoOn not needed anymore?*
I do think the issue is solved. Thanks for your work!
*It still crashes Blue immediately and do not know why.I think i will have
to turn to Steven and hope he might have a peak and debug why this is not
working in Blue.*
—
Reply to this email directly, view it on GitHub
<#1 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQIGJMIL55AGAWLSMMG4LDYC6E2LAVCNFSM6AAAAAA6NYKG6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTG4ZTANZYGI>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Up to now, I was testing on Ubuntu 22.04. I am now trying to test on macOS 14.1. On my Mac, I need to start jackd -d coreaudio, then I can start from QjackCtl and see the graph. Audio works, but MIDI is shown as disabled in QjackCtl and does not work. The Audio MIDI Setup app is no help. I'll try with GarageBand... still no help. |
I tried using valgrind memory check, no unusual reports, no help. |
But with valgrind --tool=helgrind many reports of this kind:
But I think this is a false positive in this context. |
I'm experimenting to see if the Valgrind errors also occur without Jacko, i.e. simply running xanadu.csd. The answer is NO, which means that the errors with Jacko are probably not false positives, but are pointing at something. And I get possible data races in running the jacko_test.csd WITHOUT ANY NOTES. |
I reordered code as follows. I changed
to
This vastly reduced the "possible data race" notifications from Valgrind. |
it still produces a very loud signal |
The audio is going out through the Jack audio ports. The |
With I'm not sure if this is telling me anything. I'm going to look at ways of doing this within one thread. |
Question: Does |
( i hope that this is a rhetorical question...) |
It is a question to myself. And the answer is in the API documentation:
Oops, that does NOT answer the question. "Before" in this context means before the default sense events processing, not before OK, I will try running without writing audio to a soundfile, but rather using the Jack command line audio output instead. |
It may be necessary to use the client name provided on the command line, e.g. No help, this way we end up with two clients, many xruns, and Csound hangs at the end of performance. The implication is that at the current state of implementation in both Csound and Jacko, mixing Jacko with |
Current order of processing:
|
There is no kperf callback, that is why I came up with this design. |
The implication is that at the current state of implementation in both Csound and Jacko, mixing Jacko with -+rtaudio=jack is not advisable. I think this would be good to add this to the manual. |
I have fixed some bugs that showed up when connecting Jack audio input to Csound using Jacko. valgrind shows a lot of possible data races but I think these are false positives. There will be "stack smashing" if there happens to be a zombie Jack daemon when running the test CSD. |
Is it possible to use |
I replaced the relatively low-level pthreads code with somewhat higher-level std::thread code. |
I think some of the data race notifications from valgrind thread checking are caused by creating Jack ports and connections while Csound is running. Perhaps I need to synchronize this code. |
when i run the example in VSC and the example finishes with JackoState::Close, the sound of a youtube video (also connected to Jack) also hangs. After a while Jack gets back to life. |
What a mess. Csound implements both
So it seems that the value of the That is correct:
If, then, The registered sensevents callback is called not at the beginning of |
I need to find whether I assume I can now ignore the helgrind warnings. |
I issued a pull request, which built in the cloud, and was merged by @stekyne. I am closing this issue for the time being. |
This from @tjingboem:
The text was updated successfully, but these errors were encountered: