Cabbage Logo
Back to Cabbage Site

OSC close port on exit

When listening to OSC messages, we bind to a network port on init. It seems that this bind is not released when Cabbage stops Csound (before the score is finished). The situation arise when I have an OSC listener (OSCraw) in a plugin, use this plugin in a song in Reaper, close this song and then reopen it. When reopening I get a “bind failed” message from Csound (or no messages but it does not work). If I quit Reaper completely, then restarts Reaper and loads the song, it will work as expected again.

A simple example to test:

<Cabbage>
form caption("test"), size(330, 420), pluginID("tst1")
csoundoutput bounds(10, 10, 320, 400), text("Output")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n 
</CsOptions>
<CsInstruments>

instr 1
Smess[] init 32
ka = 0
Smess,ka OSCraw 9001
printk2 ka
endin

</CsInstruments>
<CsScore>
i 1 1 [3600*24*7]
</CsScore>
</CsoundSynthesizer>

I’m seeing the same here, but I’m a little stumped on how to fix it. Let me dig around a little more. If I can’t find the problem I’ll get on to the Csound devs to see if they can help. Btw, I’m getting the same behavior even if the score finishes before before I remove the plugin.

[edit] I can recreate the problem outside of Cabbage using just Csound. I’ll post to the devs and see what they can do.