jamoma/JamomaCore

how to increase the OSC packet size ?

avilleret opened this issue · 4 comments

when trying to send big TTBoolean array over OSC, I got :

terminate called after throwing an instance of 'osc::OutOfBufferMemoryException'

what(): out of buffer memory

looking at the code it seems that the buffer size is computed from message and argument,
so I'm wondering why it fails with that exception ?

there are 17683 boolean to send in one bundle, yes that's huge, but I hope not impossible to transmit :-)

tap commented

I don't have the code/context to look at, but I'm curious what sizeof() TTBoolean is. On some systems sizeof(bool) == sizeof(int), in which case this is over 32K in memory.

Is this being allocated on the stack or the heap?

What architecture are you on? That could make a difference?

the size of the bundle doesn't seems to matter, I can't send 37 values in one shot either but I can send 2 int.

sizeof(TTBoolean) : 1   sizeof(TTInt) : 4

I'm on Ubuntu 64bit, but the code will run on RPi under Jessie soon.
And here is the code involved : https://github.com/avilleret/gorgone/blob/master/src/gorgone.cpp#L38-L61
Basically it iterates through an image and add a TTBoolean to the argument list for each pixel.

Now I'm using a return array to send the value to Max, but I have the same error.

Casting uchar to int fix the issue
But I do thing there is something wrong somewhere in the OSC buffer management