Cabbage Logo
Back to Cabbage Site

First run goes fine, second run locks cabbage

I know that I’ve seen this happen with older versions, so the issue might be related…

I’m using 2.8.100, and I am able to open and run my app, but on the second run, cabbage locks up and all I get is the spinning mouse pointer… Then I have to force quit cabbage.

I’ve also noticed other bugs that I thought got fixed, but have come back to haunt me…

What is the latest build number? Maybe I can fix this with a new version.

Mike

The latest build is 2.8.110/111 Can you remind me again of your OS, and what version of Csound are you running?

Mac OS 10.13.? and the version of csound is what cabbage installs.

Just to mention the other issue, it has to do with submenus and the first character getting dropped.

Darn it, that’s back :rage: I just pushed a fix for it now. If you run csound--version from the command line it will tell you what version you have. Btw, does the crash happen on every instrument or just some of your own? Does the same thing happen with any of the Cabbage example?

I’ll get back to night. I’m at work right now.

So, I downloaded the latest build (111), and got it installed. I reran my program, and it did the same thing, run once, then crash on second run. Next I tried other programs, and none of them would crash on the second run. I reran my program again, and it crashed the second time.

Scratching my head, I figured I would comment out various sections of the gui modules I working on, and rerun it until it crashed. I started with one module, and it would run multiple times. I added more and more of the modules, and each time it would run multiple times. And finally, when I got back to using all of the modules, somehow it now runs multiple times.

I noticed that randomly, the code editor will insert random characters into the code, and they almost always are invisible. I’m usually able to fix those things by retyping the line of code, and then deleting the first version.

So, I guess I don’t need any assistance with the second-run crashes.

By the way, I am using Csound…

--Csound version 6.16 (double samples) Aug 23 2021

Getting back to the latest build, the comboboxes now seem to default to 0, instead of selecting the first item in its list.

Screen Shot 2022-03-10 at 1.22.55 AM

If you notice, the one combobox that does have a selection is one that I have explicitly set in my code. Is this what is supposed to happen now? It defaults to nothing, and we have to explicitly set it? Either way, that is what I was planning on doing in the first place. I’m just wondering why this changed.

Also, the combobox submenu now works properly. I don’t have to add an extra character to the start of the label.

Thanks, Rory! Since I got back to using cabbage about a month ago, I have been making a lot of progress.

This popped up recently on the forum. The documentation states at the default value for comboboxes is 0. When I started digging through the code I noticed that a combobox would start off with a value of 1, and then on the first cycle return to the default value of 0. So it was for all intents and purposes 0 as default. But it would trigger a channel change on the first k-cycle, which is not desirable. If the first item of a combobox is shown, then the value of the combo channel should be 1, not 0. You see the issue? So I ‘fixed’ it by making sure that it’s as stating in the docs. Maybe this needs discussing on a separate thread…

Can you post or PM me you full project so I can take it for a spin here. I should be able to see pretty quickly where it’s falling down. :+1:

I attached the archive here…

Archive.zip (19.1 KB)

Maybe a little explanation is in order. It is an FM synth that allows for varying number of operators (depending on the algorithm selected, up to 4 operators). Also, there are 4 parts, which can be played seperately, or layered to combine these parts.

Parts are selected by the four radio buttons on the left upper corner, and within those parts, the operators are selected using the radio buttons in the middle.

The controls are split up into three sections, the left being the global parameters for each part, the middle for the operator controls, and the right is for the envelope controls.

The interface should be working, but it can’t produce sound. That’s the part that I am working on right now. You can play midi notes if you are using either the single operator or the two operator algorithms, but it only prints things at the moment.

I hope this isn’t too much of a tangled mess to follow. Let me know if you find anything, or might have any suggestions. Thanks again.

Mike

This makes sense. I guess for me, I was planning to set these things in my code, just to make sure everything is consistent. Also, I was depending on it to trigger a channel change on the first cycle so that it would execute some code to make sure the interface finishes in a known state.

So this will no longer work then? Because there is no longer a channel change on the first cycle?

I’ll try your .csd file later, I don’t mind what state the instrument is in. It should still be enough for me to find the problem.

If it doesn’t generate a channel change on the first cycle, then how did my code execute it on the first cycle? When I set the algorithm select combobox (in the global section on the left), the code will make the correct number of operator select radio buttons visible. By default, all four operator radio buttons are visible, but because the last thing I do before completing the build of the interface, is to change the value of these channels, which inturn does seem to be triggering a channel change on the first cycle because there is only a single operator visible.

Or does it still generate a channel change when calling cabbageSetValue?

It used to generate a channel change on first cycle, which was wrong.

It will always generate a channel change if you pass new values to the widget using cabbageSetValue, be it at i-rate or k-rate. :+1:

1 Like

When I try this on Windows I don’t even get an initial run. The debugger takes me to an issue in the Csound library. So this looks like something is causing Csound to crash. I was hoping it would be an issue with a widget in which case the debugger would let me know. But I get no information here at all. I also don’t have a Csound debug build set up. This might be a tricky one to sort. I’ll keep digging, but I think we need to isolate the Csound code that causes the issue. :grimacing:

It hangs when Cabbage tries to free Csound. I’m not sure why, but at least we know where the problem is. Csound can’t release some of its resources…

Huh, but it was working fine for me this morning. At least I wasn’t getting errors or crashes.

Thanks for looking into this.

It crashes for me on Windows with Csound 6.17… I’ll try on my Mac when I get a chance…

Ok, I didn’t really think of this until now, but in running my program, I get an error…

B 0.000 - note deleted. i11 (builder) had -391284016 init errors

And I started getting this error when it started doing the crash on second run thing. I didn’t really think about it because it came at the very end of this ‘builder’ instrument. I don’t really know what the error message means either.

The message doesn’t tell us much, but at least we know what instrument is causing the problem now. :+1:

I guess my question has to do with that there is no actual code that is generating this error. Every line of code in that instrument executes and it appears to do it properly.

Maybe I’ll try to retype this instrument and see if that fixes it…

If you take out that instrument does it still cause an issue?