jamoma / JamomaCore

Jamoma Frameworks for Audio and Control Structure
Other
36 stars 14 forks source link

how to increase the OSC packet size ? #388

Open avilleret opened 8 years ago

avilleret commented 8 years ago

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 8 years ago

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?

avilleret commented 8 years ago

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.

avilleret commented 8 years ago

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

avilleret commented 8 years ago

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