Cabbage Logo
Back to Cabbage Site

Cabbage3 alpha release

After “Run Cabbage”

Cabbage extension is now active!

Found a find free port: 9991

DEBUG: Devices successfully added to settings file. [CabbageAudioApp.cpp (908) addDevicesToSettings Thread ID: 0x1ff57df00]

Stopping audio stream...

DEBUG: RtApiCore::stopStream(): the stream is closed! [CabbageAudioApp.cpp (616) errorCallback Thread ID: 0x1ff57df00]

Closing MIDI input device...

Closing MIDI output device...

Audio and MIDI devices successfully deinitialised

Attempting to connect to WebSocket at ws://localhost:9991 (client instance: 0x128008eb0)

Websocket connection established. Waiting for file to be sent from VS-Code.

After saving keyboard.csd:

DEBUG: Devices successfully added to settings file. [CabbageAudioApp.cpp (908) addDevicesToSettings Thread ID: 0x1ff57df00]

DEBUG: Attempting to start audio with the following settings:

SR: 48000

Buffer Size: 32

Input device: Built-in Input

Number of input channels: 16

Output device: Apple Inc.: Mac mini Speakers

Number of output channels: 2 [CabbageAudioApp.cpp (529) initialiseAudio Thread ID: 0x1ff57df00]

DEBUG: 16-2 [CabbageAudioApp.cpp (433) createCabbageProcessor Thread ID: 0x1ff57df00]

DEBUG: csdFileAndPath:/Users/bryantysinger/.vscode/extensions/cabbageaudio.vscabbage-1.0.65-alpha/bt_test/keyboard.csd [CabbageAudioApp.cpp (434) createCabbageProcessor Thread ID: 0x1ff57df00]

DEBUG: Resetting csound ...

csound = 0x127e16a30 [Cabbage.cpp (113) setupCsound Thread ID: 0x1ff57df00]

DEBUG: Num widgets : 7 [CabbageAudioApp.cpp (442) createCabbageProcessor Thread ID: 0x1ff57df00]

UnifiedCSD: /Users/bryantysinger/.vscode/extensions/cabbageaudio.vscabbage-1.0.65-alpha/bt_test/keyboard.csd

--Csound version 7.0 (double samples) Jan 7 2025

[commit: 6f7dfd8d3434c9c6f8be3d02110be2fcc5613cfb]

The simplest .csd to test with are the slider ones. Can you try thre rotary slider one and see if they too appear stacked? It’s odd that when you select the mac speakers, it still tries to open 16 inputs…

I think the SSL is still the default input device. All of my other options are aggregate devices (SSL + some of my other devices), so that was the simplest.

I tried the rotary slider csd file. All eight sliders are on top of each other.

I’m away from the computer for the rest of the day, so no rush on debugging this. But to summarize my issues:

  • audio doesn’t work
  • UI doesn’t render correctly on initial saving
  • re-saving only goes to the splash screen or a black screen depending on how I save
  • Cabbage doesn’t quit correctly

Your experience there seems to differ from other users but I can’t think why. It’s hardly the external audio device. I’ll be away from the PC myself for the next few days, but I’ll try to push some changes to help us better understand the problem.

1 Like

@Bryan_T, can you confirm that you have no issues running audio through Csound7 outside of Cabbage? I could probably simplify things a lot by employing Csound’s audio IO modules for the vscode extension rather than rolling and maintaining my own.

I’m not sure I know how to run Csound7 outside of VSCode/Cabbage. The version that I downloaded (the vanilla version you link to in the doc) doesn’t have an executable like csound 6. /Applications/Csound/csound still points to csound6. (EDIT - I was wrong. That does point to Csound7. My confusion was that typing “csound” in terminal still launches Csound6.)

Here is what I’m running:

<Cabbage>[

{"type": "form", "caption": "Slider Example", "size": {"width": 360.0, "height": 460.0}, "guiMode": "queue", "pluginId": "def1"}

]</Cabbage>

<CsoundSynthesizer>

<CsOptions>

; Adjust audio output as needed:

; For real-time audio on most systems:

; -odac = output to default audio device

-odac

</CsOptions>

<CsInstruments>

sr = 44100

ksmps = 32

nchnls = 1

0dbfs = 1

instr 1

aSig oscili 0.2, 261.63 ; Sine wave, amplitude = 0.2, frequency = 261.63 Hz

out aSig

endin

</CsInstruments>

<CsScore>

i1 0 2 ; Play instr 1 at time 0 for 2 seconds

</CsScore>

</CsoundSynthesizer>

Here’s the output:

DEBUG: Devices successfully added to settings file. [CabbageAudioApp.cpp (908) addDevicesToSettings Thread ID: 0x1ffd91f00]

DEBUG: Attempting to start audio with the following settings:

SR: 44100

Buffer Size: 32

Input device: Built-in Input

Number of input channels: 16

Output device: Apple Inc.: Mac mini Speakers

Number of output channels: 2 [CabbageAudioApp.cpp (529) initialiseAudio Thread ID: 0x1ffd91f00]

DEBUG: 16-2 [CabbageAudioApp.cpp (433) createCabbageProcessor Thread ID: 0x1ffd91f00]

DEBUG: csdFileAndPath:/Users/bryantysinger/Downloads/csound_test.csd [CabbageAudioApp.cpp (434) createCabbageProcessor Thread ID: 0x1ffd91f00]

DEBUG: Resetting csound ...

csound = 0x1563154e0 [Cabbage.cpp (113) setupCsound Thread ID: 0x1ffd91f00]

DEBUG: Num widgets : 1 [CabbageAudioApp.cpp (442) createCabbageProcessor Thread ID: 0x1ffd91f00]

UnifiedCSD: /Users/bryantysinger/Downloads/csound_test.csd

rtaudio: coreaaudio-AuHAL module enabled

Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s

sorting score ...

... done

Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s

--Csound version 7.0 (double samples) Jan 7 2025

[commit: 6f7dfd8d3434c9c6f8be3d02110be2fcc5613cfb]

libsndfile-1.2.2

displays suppressed

sr = 44100.0,

kr = 1378.125,

ksmps = 32

0dBFS level = 1.0,

A4 tuning = 440.0

orch now loaded

audio buffered in 1024 sample-frame blocks

I do hear audio out of the mac’s speaker, but it is not as expected. It is just a short burst of noise, like a click.

You probably have the Csound extension plugin for vscode installed already. From the command palette, select Csound: Browse for Csound... and select the binary inside the /Applications/Csound folder. Now open a regular .csd file and run it with the Csound extension. Cmd+Shift+P Csound: Play Active Document.

That seems to have worked. Audio sounded as expected.

UnifiedCSD: /Users/bryantysinger/Downloads/test.csd

rtaudio: coreaaudio-AuHAL module enabled

Elapsed time at end of orchestra compile: real: 0.000s, CPU: 0.000s

sorting score ...

... done

Elapsed time at end of score sort: real: 0.000s, CPU: 0.000s

--Csound version 7.0 (double samples) Jan 7 2025

[commit: 6f7dfd8d3434c9c6f8be3d02110be2fcc5613cfb]

libsndfile-1.2.2

graphics suppressed, ascii substituted

sr = 44100.0, kr = 1378.125, ksmps = 32

0dBFS level = 1.0, A4 tuning = 440.0

orch now loaded

audio buffered in 1024 sample-frame blocks

AuHAL Module: found 6 output device(s):

1: DELL S3222DGM (2 channels)

2: unnamed device (8 channels)

3: Mac mini Speakers (2 channels)

4: SSL Cycles (8 channels)

5: SSL Samples (8 channels)

6: SSL Samples Cycles (8 channels)

selected output device: Mac mini Speakers

***** AuHAL module: output device open with 1024 buffer frames

writing 1024 sample blks of 64-bit floats to dac

SECTION 1:

new alloc for instr 1:

B 0.000 .. 2.000 T 2.000 TT 2.000 M: 0.20000

End of Performance inactive allocs returned to freespace

overall amps: 0.20000

overall samples out of range: 0

0 errors in performance

Elapsed time at end of performance: real: 2.010s, CPU: 1.839s

AuHAL module: device closed

87 1024 sample blks of 64-bit floats written to dac

Ok, thanks @Bryan_T, I think that might be the best way forward, i.e., simply use Csound’s IO modules. I’ll try to get some work done on that this week :+1:

I can confirm that Csound can play out of my SSL 12. Not sure why it can’t find its name when playing. It could in the output selection panel in VS Code.

UnifiedCSD: /Users/bryantysinger/Downloads/test.csd

rtaudio: coreaaudio-AuHAL module enabled

Elapsed time at end of orchestra compile: real: 0.001s, CPU: 0.000s

sorting score ...

... done

Elapsed time at end of score sort: real: 0.001s, CPU: 0.000s

--Csound version 7.0 (double samples) Jan 7 2025

[commit: 6f7dfd8d3434c9c6f8be3d02110be2fcc5613cfb]

libsndfile-1.2.2

graphics suppressed, ascii substituted

sr = 44100.0, kr = 1378.125, ksmps = 32

0dBFS level = 1.0, A4 tuning = 440.0

orch now loaded

audio buffered in 1024 sample-frame blocks

AuHAL Module: found 6 output device(s):

1: DELL S3222DGM (2 channels)

2: unnamed device (8 channels)

3: Mac mini Speakers (2 channels)

4: SSL Cycles (8 channels)

5: SSL Samples (8 channels)

6: SSL Samples Cycles (8 channels)

selected output device: (null)

WARNING: Attempted to set device SR, tried 44100.0, got 48000.0

***** AuHAL module: output device open with 1024 buffer frames

writing 1024 sample blks of 64-bit floats to dac

SECTION 1:

new alloc for instr 1:

B 0.000 .. 2.000 T 2.000 TT 2.000 M: 0.20000

End of Performance inactive allocs returned to freespace

overall amps: 0.20000

overall samples out of range: 0

0 errors in performance

Elapsed time at end of performance: real: 5.736s, CPU: 1.855s

AuHAL module: device closed

87 1024 sample blks of 64-bit floats written to dac

Thanks for testing. I’m just looking into this now…

@Bryan_T, I’ve just triggered a new build. I think the problem was that my audio IO callback would always try to open all channels of teh audio device, even if Csound only needed 2. I’ve changed this now so that Csound determines how many channels are used. I hope this will work better. When you get a chance could you try it out. It should be ready in a short while. Also, can you post the verbose output again. My plan to use Csound’s audio IO modules was a little ill-fated and would involve a huge rewrite. If it’s ok with you, I’d like to see if we can’t fix this first, before opting for the nuclear option.

[edit] looks like that build isn’t quite right, let me make some changes…
[edit 2] new build underway…

I was able to test this using the BlackHole virtual audio loopback device, and I’m able to pass audio from one application to Cabbage over 16 channels. I know it’s not quite the same as your hardware setup, but the results are encouraging. :+1:

[edit] Although this seems to be working now, I can still cause problem by choosing more outputs than are actually available. When this happens, I get a crash, and a zombie process that continues to eat CPU. I’ll fix this later if I get a chance.

I got the new version of Cabbage and installed it in VSCode. Audio works!

When I launch Cabbage:

Cabbage extension is now active!

Found a find free port: 9991

DEBUG: Devices successfully added to settings file. [CabbageAudioApp.cpp (916) addDevicesToSettings Thread ID: 0x1ffd91f00]

Stopping audio stream...

DEBUG: RtApiCore::stopStream(): the stream is closed! [CabbageAudioApp.cpp (624) errorCallback Thread ID: 0x1ffd91f00]

Closing MIDI input device...

Closing MIDI output device...

Audio and MIDI devices successfully deinitialised

Attempting to connect to WebSocket at ws://localhost:9991 (client instance: 0x14e0092b0)

Websocket connection established. Waiting for file to be sent from VS-Code.

And when I save keyboard.csd:

DEBUG: Devices successfully added to settings file. [CabbageAudioApp.cpp (916) addDevicesToSettings Thread ID: 0x1ffd91f00]

DEBUG: Attempting to start audio with the following settings:

SR: 44100

Buffer Size: 32

Input device: Built-in Input

Number of input channels: 2

Output device: Solid State Logic: SSL 12

Number of output channels: 2 [CabbageAudioApp.cpp (537) initialiseAudio Thread ID: 0x1ffd91f00]

DEBUG: 2-2 [CabbageAudioApp.cpp (436) createCabbageProcessor Thread ID: 0x1ffd91f00]

DEBUG: csdFileAndPath:/Users/bryantysinger/.vscode/extensions/cabbageaudio.vscabbage-1.0.65-alpha/bt_test/keyboard.csd [CabbageAudioApp.cpp (437) createCabbageProcessor Thread ID: 0x1ffd91f00]

DEBUG: Resetting csound ...

csound = 0x14e80f800 [Cabbage.cpp (113) setupCsound Thread ID: 0x1ffd91f00]

DEBUG: Num widgets : 7 [CabbageAudioApp.cpp (445) createCabbageProcessor Thread ID: 0x1ffd91f00]

UnifiedCSD: /Users/bryantysinger/.vscode/extensions/cabbageaudio.vscabbage-1.0.65-alpha/bt_test/keyboard.csd

--Csound version 7.0 (double samples) Jan 7 2025

[commit: 6f7dfd8d3434c9c6f8be3d02110be2fcc5613cfb]

libsndfile-1.2.2

sr = 44100.0,

kr = 1378.125,

ksmps = 32

0dBFS level = 1.0,

A4 tuning = 440.0

audio buffered in 1024 sample-frame blocks

SECTION 1:

I do note that when I quit VSCode the CabbageApp remains active in Activity Monitor. And it starts eating a lot of CPU. I ended up with two instances of CabbageApp and each were using 200% CPU.

And each time I’ve launched the keyboard.csd instrument the widgets have been stacked … except for once. I have no idea what I did differently that had it rendering as expected.

Ok, we’re making some progress at least. Can I ask if you stopped the Cabbage server before quitting VS-Code? Not doing so shouldn’t be an issue, but it might help me locate the source of the issue.

The stacking issue is down to timing. I can see if I can resolve that.

I’ve exited VSCode both ways - stopping the cabbage server and leaving it running. Both left instances of CabbageApp running. I think each time I stop/start CabbageApp I end up with a new instance in Activity Monitor. I’ll explore more tonight and let you know.

1 Like

@Bryan_T I’ve updated the code around the positioning of the widgets. I hope this resolves the issue you’ve been experiencing. I also pushed some more changes to the cabbage server app for multichannel IO. Can you let me know how it runs for you? I’m especially interested in avoiding any zombie processes.

That fixed the stacked widgets issue. Nice!

While running keyboard.csd the %CPU was at about 2%. I stopped Cabbage and the process remained in Activity Monitor. I quit VSCode and CabbageApp stuck around, now taking 200% CPU.

Same behavior if I quit VSCode without stopping Cabbage.

After “Run Cabbage”

Cabbage extension is now active!

Found a find free port: 9991

DEBUG: Devices successfully added to settings file. [CabbageAudioApp.cpp (918) addDevicesToSettings Thread ID: 0x1fbb29f00]

Stopping audio stream...

DEBUG: RtApiCore::stopStream(): the stream is closed! [CabbageAudioApp.cpp (624) errorCallback Thread ID: 0x1fbb29f00]

Closing MIDI input device...

Closing MIDI output device...

Audio and MIDI devices successfully deinitialised

Attempting to connect to WebSocket at ws://localhost:9991 (client instance: 0x11f00d2b0)

Websocket connection established. Waiting for file to be sent from VS-Code.

After Stop Cabbage without loading a .csd file:

Stopping audio stream...

DEBUG: RtApiCore::stopStream(): the stream is closed! [CabbageAudioApp.cpp (624) errorCallback Thread ID: 0x1fbb29f00]

Closing MIDI input device...

Closing MIDI output device...

Audio and MIDI devices successfully deinitialised

Attempting to connect to WebSocket at ws://localhost:9991 (client instance: 0x11f00d2b0)

Websocket connection established. Waiting for file to be sent from VS-Code.

Received signal 15. Cleaning up...

DEBUG: websocket connection closed.. [CabbageAudioApp.cpp (339) operator() Thread ID: 0x16b8a3000]

Process exited with code 15 and signal null

Process exited with code 15 and signal null