Cabbage Logo
Back to Cabbage Site

Race condition when switching presets

Maybe this is a noob question, maybe this is something overly complicated.

I am having an issue where switching presets does not update my widgets properly. Rather, it might be in some sort of buffer, where some of the preset data does not update in time and instead only updates when you select the next preset, breaking the continuity and “blending” presets together visually. The values of the widget however are correct. It’s just how they are displaying.

I think there’s a race condition happening, and the problem is likely how I am checking if a preset is selected, from cabbageChanged on the preset combo box (line 212). I also have other code blocks that change the widgets individually, but removing them does not solve the issue, even though they are probably interfering too.

I just want all of the dynamic widgets to refresh when a preset is selected. Is there anything wrong in my approach? Thank you in advance. StepRouterWIP.zip (20.6 KB)

I just tested this here and I can’t recreate the problem you’re having in either Cabage or a DAW. Maybe I’m missing something. Can you take a short video of the issue just in case it’s more subtle than I thought. Right now, if I go crazy with the widgets and save a preset, it gets recalled without any problems.

1 Like

Sorry about the wait! Here I have recorded a silent video of my end (had to upload to GDrive because my connection isn’t the best here): https://drive.google.com/file/d/18v_hC0Zi9AKB4MtlDiit4OYMTScUYx0m/view?usp=sharing

Since this isn’t the first time I am having an issue with runtime, I have a feeling it might be my hardware, so I showed it at the beginning. I will try out this code on a different computer to see if I get different results.

EDIT: I am using Cabbage 2.9.0 and CSound 6.18.0 on Windows 10 in case that is relevant.

Oh yes, that’s entirely relevant :slight_smile: Can you try the latest beta build? That’s the one I’m using, and it’s also 100+ minor version ahead of 2.9.0. If that doesn’t work better I’ll take this apart in a little more details :+1:

I updated two computers to Cabbage 2.9.155 & Csound 6.18.1 and then copied over my project files. My first computer has Windows and my second one has Windows and Linux on separate drives. I didn’t record them individually, because they are all having the same issue, with or without my audio interface and regardless of the buffer size. On Linux I actually had more graphical glitches, such as the knobs missing their marker and some label widgets not updating automatically until I changed them with a button press.

I must be doing something wrong but I have no idea what it is, so I’m at a loss for what I should do.

Let me try on Windows and see if I can recreate the problem. Right now I’ve only been testing on my Mac…

I went to boot up my PC just now and the CPU fan died. :see_no_evil: That means I’m without a Windows machine until I can get a replacement. I’ll see if I can find a temporary one for the interim. The good news is it’s almost the holidays, and only fools like me will be using a PC over Christmas :rofl:

1 Like

Please take your time, I don’t want to occupy your holidays with some unknown issue :joy:

Ok, I managed to get my hands on a PC. And I can recreate the problems you’re having. But I’m away now for a few days so I won’t be able to take a deeper look till later in the week. But at least we can confirm it’s not something particular to your setup. :+1:

1 Like

That’s good to know. What could MacOS be doing that is different from Windows and Linux? Perhaps it matters little, because I think the move is to fix my code. I likely have to reimplement how I display everything.

Don’t reimplement your code just yet. If it works on MacOS it should work on windows :+1: let me take a look first.

1 Like