< Back to IRCAM Forum

Best strategy for bundling OSC

Hi Thibaut !

When controlling Panoramix (inside of Max) via OSC in realtime the load of messages easily makes CPU usage peak. To remedy that I am using spat5.osc.collect to turn OSC messages into bundles. But what is the better strategy when using bundles: many messages bundled only now and then or fewer messages at regular polling interval? What is the most efficient and CPU friendly method? Ideally I’d like to avoid having a metronome running to poll bundles and rather only send it when necessary. Any suggestions of how to go about it?

Another point is the “FullPacket” send from OSCar (Reaper to Panoramix). Is that safe and fast? I read in the spat5-tuto-osc-6 that sending FullPackets via send-receive is not recommended. Does that advice include OSCars bundles? What is the best setting of Max’ overdrive/interupt to support bundles? I should probably mention that the send-receive happens locally on the same machine.

Kindly Hans Peter

Hello Hans Peter

When controlling Panoramix (inside of Max) via OSC in realtime the load of messages easily makes CPU usage peak. To remedy that I am using spat5.osc.collect to turn OSC messages into bundles. But what is the better strategy when using bundles: many messages bundled only now and then or fewer messages at regular polling interval? What is the most efficient and CPU friendly method? Ideally I’d like to avoid having a metronome running to poll bundles and rather only send it when necessary. Any suggestions of how to go about it?

Unfortunately the only answer I can give is “it depends”.
What really matters is that you send a reasonable rate of messages. I’ve seen many users sending trajectory data with ~5 msec update rate, and this is generally a waste of CPU. One would obtain smooth audible results with much lower rate (> 50 msec for instance).

Using the speedlim included in Panoramix’s OSC receive module (or reducing the sending rate in OSCar) could/should have significant CPU benefit.

Another point is the “FullPacket” send from OSCar (Reaper to Panoramix). Is that safe and fast?

It should be.

I read in the spat5-tuto-osc-6 that sending FullPackets via send-receive is not recommended. Does that advice include OSCars bundles?

No. OSCar should send bundles in a thread-safe manner.

What is the best setting of Max’ overdrive/interupt to support bundles? I should probably mention that the send-receive happens locally on the same machine.

In general, I’d recommend overdrive + interrupt.

Best,
T.

1 Like

Hi Thibaut!

Thank you for a very useful answer (as always) !

Concerning rate, does maxqueuesize and maxpatcketsize in the udpreceiver have an influence on the CPU usage? Or on the smoothness of bundle processing? Or are the default values ok?

Kindly Hans Peter

Hi Hans Peter

Concerning rate, does maxqueuesize and maxpatcketsize in the udpreceiver have an influence on the CPU usage? Or on the smoothness of bundle processing?

I’m not sure exactly, but I presume this settings should not have any significant impact on the CPU usage nor smoothness.

Or are the default values ok?

I think the default values are ok (at least for most “normal” use cases – assuming you’re not trying to send an insane amount of data per seconds).

Best,
T.

Thanks, again!

Just to make sure: is it ok to use spat5.osc.speedlim on bundles from OSCar? Even if the spat5-tuto-osc-6 says speedlim is not recommended I take that concerns the regular Max version of speedlim and not the spat5 version (as shown in the tuto-6)? In other words is spat5.osc.speedlim thread safe?

Kindly Hans Peter

Hi again,

I am trying to send bundles only from Reaper to Max, but look at this screenshot. Two instances of OSCar both with bundles enabled, both with some Reaper LFOs on the parameters. The first instance sends as bundles (as expected), the second instance sends as regular OSC message (inspite its bundle being enabled). What am I missing? Or is it simply because the first instance sends several parameters and the second only a single one? Is it such that a single parameters is not worth bundling?

I enclose the OSCar xml file for verification as well.

oscar.xml (7.2 KB)
.

Kindly Hans Peter

spat5.osc.speedlim is (supposed to be) safe to use, and thread-safe.

Indeed, when only 1 parameter is automated, OSCar sends a regular OSC message, not a bundle.
(a bundle containing only one message is not terribly useful)

T.