[Csnd] Trying to build JUCE + Csound library. Need help on error of performanceKsmps exiting early
| Date | 2026-09-09 10:30 |
| From | Anton Kholomiov |
| Subject | [Csnd] Trying to build JUCE + Csound library. Need help on error of performanceKsmps exiting early |
Hi! there!
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
I'm trying to build a JUCE library for csound that will handle audio processing and parameters update. A use case if the user wants to write custom UI and integrate the Csound code. Here is a source code for this: https://github.com/anton-k/csound-for-juce/tree/simplify-csd-bug-fix The synthesizer case with no audio input works fine and it's solid with various DAW life cycles. But the FX plugin misbehaves and I'm kinda stuck. So asking for help. The problem that I get is that csound->PerfromKsmps() exits early. Although I define a long running score here: https://github.com/anton-k/csound-for-juce/blob/simplify-csd-bug-fix/examples/reverb/src/csd/reverb.csd#L35 It exits after approx 200 csound performance runs. I've checked with logs that spin and my internal buffers are properly set up. I can see with logs that the processing function works well. I can see that audio buffer exchange between DAw and Csound are in proper sync: https://github.com/anton-k/csound-for-juce/blob/simplify-csd-bug-fix/src/juce_csd/audio/Processor.cpp#L185 Here is how I setup the Csound: https://github.com/anton-k/csound-for-juce/blob/simplify-csd-bug-fix/src/csd_plugin/audio/Processor.cpp#L232 I'm running: CSOUND VERSION: 7 "Sep 9" 2026 7.0 Also I've tried the April 2026 version of the API. I've tried various flags. But Csound seems to exit early after several (~200) runs. Sometimes it also starts and works for FX plugin. The ratio is 3/1 for failure to run. For the synth plugin it works and runs 100%. By logs I can see that processing is not interrupted with initialization calls prepareToPlay/releaseResources. It just runs the process block and suddenly crashes. Do you have any clues why this can happen? What can cause such behaviour? |
| Date | 2026-09-09 15:21 |
| From | Hlöðver Sigurðsson |
| Subject | Re: [Csnd] Trying to build JUCE + Csound library. Need help on error of performanceKsmps exiting early |
Hi Anton, I hope you are well! long shot, can you compare io_layout.get_total_in_size() with csound->GetChannels(1) after start? On Wed, 9 Sept 2026 at 12:30, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
|
| Date | 2026-09-10 16:50 |
| From | Steven Yi |
| Subject | Re: [Csnd] Trying to build JUCE + Csound library. Need help on error of performanceKsmps exiting early |
Have you tried: 1. checking the channel values to ensure they aren't getting odd values that might destabilize calculations? 2. Trying an empty CSD with an empty instrument and no channel reading 3. Then, try passthrough with just inch and writing to out I don't see anything off in the processing code, so I'm wondering if it's some unexpected control data getting the reverb to initialize or have runtime bad values gets to a crashing situation. On Wed, Sep 9, 2026 at 5:30 AM Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
|