Discussion:
max OSC packet size ?
felix
2014-09-27 15:17:10 UTC
Permalink
It appears that sclang fails silently when trying to send an OSC message
that is too large.

I can't find documentation saying what that size is exactly. Also can't
seem to find it in the source code.

here?
https://github.com/supercollider/supercollider/blob/master/lang%2FLangPrimSource%2FOSCData.cpp




--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
nescivi
2014-09-28 21:06:31 UTC
Permalink
Hiho,

I believe it is OS dependent?

sincerely,
Marije

On 27-09-14 17:17, felix wrote:
>
> It appears that sclang fails silently when trying to send an OSC message
> that is too large.
>
> I can't find documentation saying what that size is exactly. Also can't
> seem to find it in the source code.
>
> here?
> https://github.com/supercollider/supercollider/blob/master/lang%2FLangPrimSource%2FOSCData.cpp
>
>
>
>
> --
> ..
> http://soundcloud.com/crucialfelix
> http://github.com/crucialfelix
> .


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Abram Hindle
2014-09-28 22:18:33 UTC
Permalink
What I think I know: If it is IPV4, the max total UDP data size is 66507
bytes. If fragmentation is disabled you have to keep below 1478 data
bytes if you're not using jumbo frames. And then if DSL is used you're
getting your data sized dropped down a lot more.

What I know less about: If you use OSC over TCP you shouldn't run into
this problem. The max osc size is probably the packet size of int32 so 2
or 4gb.

In general keep your messages short. You can always split messages.

Abram

On 14-09-28 02:06 PM, nescivi wrote:
> Hiho,
>
> I believe it is OS dependent?
>
> sincerely,
> Marije
>
> On 27-09-14 17:17, felix wrote:
>> It appears that sclang fails silently when trying to send an OSC message
>> that is too large.
>>
>> I can't find documentation saying what that size is exactly. Also can't
>> seem to find it in the source code.
>>
>> here?
>> https://github.com/supercollider/supercollider/blob/master/lang%2FLangPrimSource%2FOSCData.cpp
>>
>>
>>
>>
>> --
>> ..
>> http://soundcloud.com/crucialfelix
>> http://github.com/crucialfelix
>> .
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
felix
2014-09-29 08:15:03 UTC
Permalink
Thanks for that info.

The problem is with SC's implementation.

Its a long time known issue.

NetAddr.sc

// warning: this primitive will fail to send if the bundle size is too large
// but it will not throw an error. this needs to be fixed
sendBundle { arg time ... args;
_NetAddr_SendBundle
^this.primitiveFailed;
}

The relevant source code:

typedef scpacket<65516> big_scpacket;

It looks like it should correctly throw a primitive error:

https://github.com/supercollider/supercollider/blob/061b53b1be1580aeb60ede76a16eda4a66d3a182/lang/LangPrimSource/OSCData.cpp#L197

but it fails silently






On Mon, Sep 29, 2014 at 12:18 AM, Abram Hindle <abram.hindle-yfeSBMgouQgsA/***@public.gmane.org>
wrote:

> What I think I know: If it is IPV4, the max total UDP data size is 66507
> bytes. If fragmentation is disabled you have to keep below 1478 data
> bytes if you're not using jumbo frames. And then if DSL is used you're
> getting your data sized dropped down a lot more.
>
> What I know less about: If you use OSC over TCP you shouldn't run into
> this problem. The max osc size is probably the packet size of int32 so 2
> or 4gb.
>
> In general keep your messages short. You can always split messages.
>
> Abram
>
> On 14-09-28 02:06 PM, nescivi wrote:
> > Hiho,
> >
> > I believe it is OS dependent?
> >
> > sincerely,
> > Marije
> >
> > On 27-09-14 17:17, felix wrote:
> >> It appears that sclang fails silently when trying to send an OSC message
> >> that is too large.
> >>
> >> I can't find documentation saying what that size is exactly. Also can't
> >> seem to find it in the source code.
> >>
> >> here?
> >>
> https://github.com/supercollider/supercollider/blob/master/lang%2FLangPrimSource%2FOSCData.cpp
> >>
> >>
> >>
> >>
> >> --
> >> ..
> >> http://soundcloud.com/crucialfelix
> >> http://github.com/crucialfelix
> >> .
> >
> > _______________________________________________
> > sc-users mailing list
> >
> > info (subscription, etc.):
> http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> > archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> > search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>
>
>


--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
Ali Rustamov
2014-09-29 09:07:47 UTC
Permalink
May be here?

https://github.com/supercollider/supercollider/blob/master/server/scsynth/SC_World.cpp


bool nextOSCPacket(FILE *file, OSC_Packet *packet, int64& outTime)
{
int32 msglen;
if (fread(&msglen, 1, sizeof(int32), file) != sizeof(int32))
return true;
// msglen is in network byte order
msglen = OSCint((char*)&msglen);


if (msglen > 1073741824){
throw std::runtime_error("OSC packet too long. > 2^30 bytes\n");
}


packet->mData = (char *)realloc((void *)packet->mData, (size_t)msglen);
if(!packet->mData) throw std::runtime_error("nextOSCPacket: realloc
failed...\n");

size_t read = fread(packet->mData, 1, msglen, file);
if (read != msglen)
throw std::runtime_error("nextOSCPacket: invalid read of OSC packet\n");

if (strcmp(packet->mData, "#bundle")!=0)
throw std::runtime_error("OSC packet not a bundle\n");

packet->mSize = msglen;

outTime = OSCtime(packet->mData+8);
return false;
}







On Mon, Sep 29, 2014 at 12:15 PM, felix <felix-***@public.gmane.org> wrote:
>
> Thanks for that info.
>
> The problem is with SC's implementation.
>
> Its a long time known issue.
>
> NetAddr.sc
>
> // warning: this primitive will fail to send if the bundle size is too large
> // but it will not throw an error. this needs to be fixed
> sendBundle { arg time ... args;
> _NetAddr_SendBundle
> ^this.primitiveFailed;
> }
>
> The relevant source code:
>
> typedef scpacket<65516> big_scpacket;
>
> It looks like it should correctly throw a primitive error:
>
> https://github.com/supercollider/supercollider/blob/061b53b1be1580aeb60ede76a16eda4a66d3a182/lang/LangPrimSource/OSCData.cpp#L197
>
> but it fails silently
>
>
>
>
>
>
> On Mon, Sep 29, 2014 at 12:18 AM, Abram Hindle <abram.hindle-yfeSBMgouQgsA/***@public.gmane.org>
> wrote:
>>
>> What I think I know: If it is IPV4, the max total UDP data size is 66507
>> bytes. If fragmentation is disabled you have to keep below 1478 data
>> bytes if you're not using jumbo frames. And then if DSL is used you're
>> getting your data sized dropped down a lot more.
>>
>> What I know less about: If you use OSC over TCP you shouldn't run into
>> this problem. The max osc size is probably the packet size of int32 so 2
>> or 4gb.
>>
>> In general keep your messages short. You can always split messages.
>>
>> Abram
>>
>> On 14-09-28 02:06 PM, nescivi wrote:
>> > Hiho,
>> >
>> > I believe it is OS dependent?
>> >
>> > sincerely,
>> > Marije
>> >
>> > On 27-09-14 17:17, felix wrote:
>> >> It appears that sclang fails silently when trying to send an OSC
>> >> message
>> >> that is too large.
>> >>
>> >> I can't find documentation saying what that size is exactly. Also can't
>> >> seem to find it in the source code.
>> >>
>> >> here?
>> >>
>> >> https://github.com/supercollider/supercollider/blob/master/lang%2FLangPrimSource%2FOSCData.cpp
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> ..
>> >> http://soundcloud.com/crucialfelix
>> >> http://github.com/crucialfelix
>> >> .
>> >
>> > _______________________________________________
>> > sc-users mailing list
>> >
>> > info (subscription, etc.):
>> > http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
>> > archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
>> > search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>>
>>
>
>
>
> --
> ..
> http://soundcloud.com/crucialfelix
> http://github.com/crucialfelix
> .

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
felix
2014-09-29 09:13:50 UTC
Permalink
This post might be inappropriate. Click to display it.
Hanns Holger Rutz
2014-09-29 10:04:56 UTC
Permalink
felix
2014-09-29 11:10:35 UTC
Permalink
re speed:

have you noticed anything when sending real time controls like sliders or
midi ?
I know that gaming developers always use UDP because of the response time.

re size:

in any case when using sclang then TCP will still have the 65516 limitation
of packet size

there is an OSC blob type, but not implemented in sc.

its easy enough to open a normal socket for anything big.



On Mon, Sep 29, 2014 at 12:04 PM, Hanns Holger Rutz <contact-***@public.gmane.org>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> TCP doesn't have the 8K UDP limitation. I have used TCP for many years
> and not used UDP any longer. I have found that the theoretical impact
> on performance (TCP must wait for the reception of the packets) is
> irrelevant.
>
> Best, .h.h.
>
>
> On 09/29/2014 11:13 AM, felix wrote:
> >
> > btw. I'm getting failure on things as small as 12k, so I'm not
> > completely sure its due to the size, but it is correlated with it.
> >
> > ...
> >
> > ah ha ! it is actually sending. the failure was on the receiving
> > end due to malformed JSON.
> >
> > -Infinity is legal javascript, but its not legal JSON. it should
> > be represented as 'null'
> >
> > because the implementation of Infinity is as a property on a
> > number slot. so its not a type or a value in itself.
> >
> > "{\"result\": {\"numCols\": 8, \"numRows\": 12, \"layers\":
> > [{\"outVar\": \"freq\", \"args\": [{\"in\": \"freq\", \"spec\":
> > {\"maxval\": 20000, \"minval\": 20, \"class\": \"ControlSpec\",
> > \"default\": 440, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"exp\", \"units\": \" Hz\"}, \"name\": \"freq\"}, {\"spec\":
> > {\"maxval\": 20, \"minval\": -20, \"class\": \"ControlSpec\",
> > \"default\": 0, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"linear\", \"units\": \" Hz\"}, \"name\": \"detune\", \"value\":
> > 1, \"defArg\": 1}, {\"spec\": {\"maxval\": 64, \"minval\": 2,
> > \"class\": \"StaticIntegerSpec\", \"default\": 2, \"rate\":
> > \"noncontrol\", \"step\": 1, \"warp\": \"linear\", \"units\":
> > \"\"}, \"name\": \"quantity\", \"value\": 7}], \"active\": false,
> > \"point\": [0, 2], \"instr\": \"freqFxKr.detunedArray\"},
> > {\"outVar\": \"noncontrol\", \"args\": [{\"spec\": {\"maxval\": 64,
> > \"minval\": 2, \"class\": \"StaticIntegerSpec\", \"default\": 2,
> > \"rate\": \"noncontrol\", \"step\": 1, \"warp\": \"linear\",
> > \"units\": \"\"}, \"name\": \"quantity\", \"value\": 5, \"defArg\":
> > 5}, {\"spec\": {\"maxval\": 10, \"minval\": 0.01, \"class\":
> > \"ControlSpec\", \"default\": 0.01, \"rate\": \"control\",
> > \"step\": 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\":
> > \"speed\", \"value\": 0.1, \"defArg\": 0.1}], \"active\": false,
> > \"point\": [0, 3], \"instr\": \"freqFxKr.bipolarSpinningCircle\"},
> > {\"outVar\": \"igate\", \"args\": [{\"in\": \"trig\", \"spec\":
> > {\"maxval\": 1, \"minval\": 0, \"class\": \"TrigSpec\",
> > \"default\": 0, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"trig\"}, {\"in\":
> > \"duration\", \"spec\": {\"maxval\": 16, \"minval\": 0.125,
> > \"class\": \"ControlSpec\", \"default\": 1, \"rate\": \"control\",
> > \"step\": 0.125, \"warp\": \"linear\", \"units\": \"\"}, \"name\":
> > \"duration\", \"defArg\": 0.2}], \"active\": true, \"point\": [0,
> > 6], \"instr\": \"gateTrigs.extend\"}, {\"outVar\": \"audio\",
> > \"args\": [{\"in\": \"freq\", \"spec\": {\"maxval\": 20000,
> > \"minval\": 20, \"class\": \"ControlSpec\", \"default\": 440,
> > \"rate\": \"control\", \"step\": 0, \"warp\": \"exp\", \"units\":
> > \" Hz\"}, \"name\": \"freq\", \"defArg\": 440}, {\"spec\":
> > {\"maxval\": 128, \"minval\": 1, \"class\": \"StaticIntegerSpec\",
> > \"default\": 1, \"rate\": \"noncontrol\", \"step\": 1, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"quantity\", \"value\": 8,
> > \"defArg\": 4}, {\"in\": \"7\", \"spec\": {\"maxval\": 20,
> > \"minval\": -20, \"class\": \"ControlSpec\", \"default\": 0,
> > \"rate\": \"control\", \"step\": 0, \"warp\": \"linear\",
> > \"units\": \" Hz\"}, \"name\": \"detune\", \"defArg\": 1},
> > {\"spec\": {\"maxval\": 10, \"minval\": 0.01, \"class\":
> > \"ControlSpec\", \"default\": 0.01, \"rate\": \"control\",
> > \"step\": 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\":
> > \"speed\", \"value\": 0.12616279069767, \"defArg\": 0.1}, {\"in\":
> > \"8\", \"spec\": {\"maxval\": 1, \"minval\": 0, \"class\":
> > \"ControlSpec\", \"default\": 0.5, \"rate\": \"control\", \"step\":
> > 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\": \"spread\",
> > \"defArg\": 1}, {\"spec\": {\"maxval\": 1, \"minval\": 0,
> > \"class\": \"ControlSpec\", \"default\": 1, \"rate\": \"control\",
> > \"step\": 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\":
> > \"minAmp\", \"value\": 0.36046511627907, \"defArg\": 1}],
> > \"active\": true, \"point\": [1, 2], \"instr\":
> > \"syntharrays.spinningPulse\"}, {\"outVar\": \"audio\", \"args\":
> > [{\"in\": \"audio\", \"spec\": {\"rate\": \"audio\", \"class\":
> > \"AudioSpec\"}, \"name\": \"audio\"}, {\"in\": \"igate\",
> > \"spec\": {\"maxval\": 1, \"minval\": 0, \"class\":
> > \"ControlSpec\", \"default\": 0, \"rate\": \"control\", \"step\":
> > 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\": \"gate\"},
> > {\"spec\": {\"maxval\": 16, \"minval\": 0, \"class\":
> > \"ControlSpec\", \"default\": 0.01, \"rate\": \"control\",
> > \"step\": 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\":
> > \"attackTime\", \"value\": 0.01, \"defArg\": 0.01}, {\"in\":
> > \"amp\", \"spec\": {\"maxval\": 1, \"minval\": 0, \"class\":
> > \"ControlSpec\", \"default\": 0, \"rate\": \"control\", \"step\":
> > 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\": \"level\",
> > \"defArg\": 1}, {\"in\": \"releaseTime\", \"spec\": {\"maxval\":
> > 16, \"minval\": 0, \"class\": \"ControlSpec\", \"default\": 0.05,
> > \"rate\": \"control\", \"step\": 0, \"warp\": \"linear\",
> > \"units\": \"\"}, \"name\": \"releaseTime\", \"defArg\": 0.1}],
> > \"active\": true, \"point\": [1, 6], \"instr\":
> > \"compiler.innerenv.linen\"}, {\"outVar\": \"dust\", \"args\":
> > [{\"spec\": {\"maxval\": 30, \"minval\": 0, \"class\":
> > \"ControlSpec\", \"default\": 1, \"rate\": \"control\", \"step\":
> > 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\": \"density\",
> > \"value\": 1}, {\"spec\": {\"maxval\": 1, \"minval\": 0,
> > \"class\": \"ControlSpec\", \"default\": 1, \"rate\": \"control\",
> > \"step\": 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\":
> > \"amp\", \"value\": 1, \"defArg\": 1}], \"active\": false,
> > \"point\": [2, 5], \"instr\": \"oscillOrcKr.Dust\"}, {\"outVar\":
> > \"bus3\", \"args\": [{\"in\": \"audio\", \"spec\": {\"rate\":
> > \"audio\", \"class\": \"AudioSpec\"}, \"name\": \"audio\"},
> > {\"spec\": {\"maxval\": 0, \"minval\": -Infinity, \"class\":
> > \"ControlSpec\", \"default\": -Infinity, \"rate\": \"control\",
> > \"step\": 0, \"warp\": \"db\", \"units\": \" dB\"}, \"name\":
> > \"gain\", \"value\": 0, \"defArg\": 0}], \"active\": true,
> > \"point\": [3, 0], \"instr\": \"compiler.amp.gain\"}, {\"outVar\":
> > \"fft\", \"args\": [{\"in\": \"audio\", \"spec\": {\"rate\":
> > \"audio\", \"class\": \"AudioSpec\"}, \"name\": \"audio\"},
> > {\"spec\": {\"maxval\": 12, \"minval\": 6, \"class\":
> > \"StaticIntegerSpec\", \"default\": 6, \"rate\": \"noncontrol\",
> > \"step\": 1, \"warp\": \"linear\", \"units\": \"\"}, \"name\":
> > \"bufSize\", \"value\": 11, \"defArg\": 11}, {\"spec\":
> > {\"maxval\": 0.9, \"minval\": 0.1, \"class\": \"ControlSpec\",
> > \"default\": 0.1, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"hop\", \"value\": 0.5,
> > \"defArg\": 0.5}, {\"spec\": {\"maxval\": 1, \"minval\": -1,
> > \"class\": \"StaticIntegerSpec\", \"default\": -1, \"rate\":
> > \"noncontrol\", \"step\": 1, \"warp\": \"linear\", \"units\":
> > \"\"}, \"name\": \"wintype\", \"value\": 0, \"defArg\": 0},
> > {\"spec\": {\"maxval\": 1, \"minval\": -1, \"class\":
> > \"ControlSpec\", \"default\": 0, \"rate\": \"control\", \"step\":
> > 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\": \"active\",
> > \"value\": 1, \"defArg\": 1}, {\"spec\": {\"maxval\": 12,
> > \"minval\": 6, \"class\": \"StaticIntegerSpec\", \"default\": 6,
> > \"rate\": \"noncontrol\", \"step\": 1, \"warp\": \"linear\",
> > \"units\": \"\"}, \"name\": \"winsize\", \"value\": 11, \"defArg\":
> > 11}], \"active\": true, \"point\": [3, 1], \"instr\":
> > \"compiler.FFT.FFT\"}, {\"outVar\": \"fft\", \"args\": [{\"in\":
> > \"fft\", \"spec\": {\"rate\": \"noncontrol\", \"class\":
> > \"FFTSpec\"}, \"name\": \"fft\"}, {\"in\": \"4\", \"spec\":
> > {\"maxval\": 256, \"minval\": 0, \"class\": \"ControlSpec\",
> > \"default\": 0, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"numBins\"}], \"active\":
> > true, \"point\": [3, 4], \"instr\": \"compiler.FFT.PV_MagSmear\"},
> > {\"outVar\": \"fft\", \"args\": [{\"in\": \"fft\", \"spec\":
> > {\"rate\": \"noncontrol\", \"class\": \"FFTSpec\"}, \"name\":
> > \"fft\"}, {\"in\": \"dust\", \"spec\": {\"maxval\": 1, \"minval\":
> > 0, \"class\": \"ControlSpec\", \"default\": 0, \"rate\":
> > \"control\", \"step\": 0, \"warp\": \"linear\", \"units\": \"\"},
> > \"name\": \"gate\"}], \"active\": false, \"point\": [3, 5],
> > \"instr\": \"compiler.JoshPV.PV_Freeze\"}, {\"outVar\": \"bus3\",
> > \"args\": [{\"in\": \"fft\", \"spec\": {\"rate\": \"noncontrol\",
> > \"class\": \"FFTSpec\"}, \"name\": \"fft\"}, {\"spec\":
> > {\"maxval\": 1, \"minval\": -1, \"class\": \"StaticIntegerSpec\",
> > \"default\": -1, \"rate\": \"noncontrol\", \"step\": 1, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"wintype\", \"value\": 0,
> > \"defArg\": 0}, {\"spec\": {\"maxval\": 12, \"minval\": 6,
> > \"class\": \"StaticIntegerSpec\", \"default\": 6, \"rate\":
> > \"noncontrol\", \"step\": 1, \"warp\": \"linear\", \"units\":
> > \"\"}, \"name\": \"winsize\", \"value\": 11, \"defArg\": 11}] ,
> > \"active\": true, \"point\": [3, 7], \"instr\":
> > \"compiler.FFT.IFFT\"}, {\"outVar\": \"bus3\", \"args\": [{\"in\":
> > \"bus3\", \"spec\": {\"rate\": \"audio\", \"class\":
> > \"AudioSpec\"}, \"name\": \"audio\", \"defArg\": 0}, {\"in\":
> > \"4\", \"spec\": {\"maxval\": 1, \"minval\": 0, \"class\":
> > \"ControlSpec\", \"default\": 1, \"rate\": \"control\", \"step\":
> > 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\": \"amp\",
> > \"defArg\": 1}], \"active\": true, \"point\": [3, 8], \"instr\":
> > \"filters.amp\"}, {\"outVar\": \"bus3\", \"args\": [{\"in\":
> > \"bus3\", \"spec\": {\"rate\": \"audio\", \"class\":
> > \"AudioSpec\"}, \"name\": \"audio\"}, {\"spec\": {\"maxval\":
> > 10000, \"minval\": 100, \"class\": \"StaticSpec\", \"default\":
> > 100, \"rate\": \"noncontrol\", \"step\": 0, \"warp\": \"linear\",
> > \"units\": \"\"}, \"name\": \"attack\", \"value\": 7582.5581395349,
> > \"defArg\": 0.02}, {\"spec\": {\"maxval\": 10000, \"minval\": 100,
> > \"class\": \"StaticSpec\", \"default\": 100, \"rate\":
> > \"noncontrol\", \"step\": 0, \"warp\": \"linear\", \"units\":
> > \"\"}, \"name\": \"decay\", \"value\": 7812.7906976744, \"defArg\":
> > 0.1}], \"active\": true, \"point\": [3, 9], \"instr\":
> > \"compiler.slews.slew\"}, {\"outVar\": \"bus3\", \"args\":
> > [{\"in\": \"bus3\", \"spec\": {\"rate\": \"audio\", \"class\":
> > \"AudioSpec\"}, \"name\": \"audio\", \"defArg\": 0}, {\"spec\":
> > {\"maxval\": 1, \"minval\": 0, \"class\": \"ControlSpec\",
> > \"default\": 0.5, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"coef\", \"value\":
> > 0.55813953488372, \"defArg\": 0.99}], \"active\": true, \"point\":
> > [3, 10], \"instr\": \"filters.LeakDC\"}, {\"outVar\": \"bus3\",
> > \"args\": [{\"in\": \"bus3\", \"spec\": {\"rate\": \"audio\",
> > \"class\": \"AudioSpec\"}, \"name\": \"audio\"}, {\"spec\":
> > {\"maxval\": 0, \"minval\": -Infinity, \"class\": \"ControlSpec\",
> > \"default\": -Infinity, \"rate\": \"control\", \"step\": 0,
> > \"warp\": \"db\", \"units\": \" dB\"}, \"name\": \"gain\",
> > \"value\": 0, \"defArg\": 0}], \"active\": true, \"point\": [3,
> > 11], \"instr\": \"compiler.amp.gain\"}, {\"outVar\": \"bus4\",
> > \"args\": [{\"in\": \"audio\", \"spec\": {\"rate\": \"audio\",
> > \"class\": \"AudioSpec\"}, \"name\": \"audio\"}, {\"spec\":
> > {\"maxval\": 0, \"minval\": -Infinity, \"class\": \"ControlSpec\",
> > \"default\": -Infinity, \"rate\": \"control\", \"step\": 0,
> > \"warp\": \"db\", \"units\": \" dB\"}, \"name\": \"gain\",
> > \"value\": 0, \"defArg\": 0}], \"active\": true, \"point\": [4, 0],
> > \"instr\": \"compiler.amp.gain\"}, {\"outVar\": \"bus4\", \"args\":
> > [{\"in\": \"bus4\", \"spec\": {\"rate\": \"audio\", \"class\":
> > \"AudioSpec\"}, \"name\": \"audio\", \"defArg\": 0}, {\"spec\":
> > {\"maxval\": 1, \"minval\": 0.125, \"class\": \"StaticSpec\",
> > \"default\": 0.125, \"rate\": \"noncontrol\", \"step\": 0,
> > \"warp\": \"linear\", \"units\": \"\"}, \"name\": \"maxBeats\",
> > \"value\": 0.25726744186047, \"defArg\": 0.5}, {\"spec\":
> > {\"maxval\": 1, \"minval\": 0.0125, \"class\": \"ControlSpec\",
> > \"default\": 0.0125, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"beats\", \"value\":
> > 0.05843023255814, \"defArg\": 0.375}, {\"in\": \"3\", \"spec\":
> > {\"maxval\": 0.25, \"minval\": 0, \"class\": \"ControlSpec\",
> > \"default\": 0, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"wobble\", \"defArg\":
> > 0.05}, {\"in\": \"tempo\", \"spec\": {\"rate\": \"control\",
> > \"class\": \"TempoSpec\"}, \"name\": \"tempo\", \"defArg\": 1}],
> > \"active\": false, \"point\": [4, 6], \"instr\":
> > \"timeDomainEfx.DelayT\"}, {\"outVar\": \"bus4\", \"args\":
> > [{\"in\": \"bus4\", \"spec\": {\"rate\": \"audio\", \"class\":
> > \"AudioSpec\"}, \"name\": \"audio\", \"defArg\": 0}, {\"spec\":
> > {\"maxval\": 20000, \"minval\": 20, \"class\": \"ControlSpec\",
> > \"default\": 440, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"exp\", \"units\": \" Hz\"}, \"name\": \"freq\", \"value\":
> > 4011.9506022008, \"defArg\": 440}, {\"spec\": {\"maxval\": 2,
> > \"minval\": 0.001, \"class\": \"ControlSpec\", \"default\": 0.707,
> > \"rate\": \"control\", \"step\": 0, \"warp\": \"exp\", \"units\":
> > \"\"}, \"name\": \"rq\", \"value\": 1, \"defArg\": 1}, {\"spec\":
> > {\"maxval\": 12, \"minval\": -160, \"class\": \"ControlSpec\",
> > \"default\": 0, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"db\", \"units\": \" dB\"}, \"name\": \"db\", \"value\":
> > -6.8840179637288, \"defArg\": 0}, {\"spec\": {\"maxval\": 1,
> > \"minval\": 0, \"class\": \"ControlSpec\", \"default\": 1,
> > \"rate\": \"control\", \"step\": 0, \"warp\": \"linear\",
> > \"units\": \"\"}, \"name\": \"mul\", \"value\": 1, \"defArg\": 1},
> > {\"spec\": {\"maxval\": 1, \"minval\": 0, \"class\":
> > \"ControlSpec\", \"default\": 0, \"rate\": \"control\", \"step\":
> > 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\": \"add\",
> > \"value\": 0, \"defArg\": 0}], \"active\": true, \"point\": [4,
> > 8], \"instr\": \"compiler.Filter.MidEQ\"}, {\"outVar\": \"bus4\",
> > \"args\": [{\"in\": \"bus4\", \"spec\": {\"rate\": \"audio\",
> > \"class\": \"AudioSpec\"}, \"name\": \"audio\"}, {\"spec\":
> > {\"maxval\": 20000, \"minval\": 60, \"class\": \"ControlSpec\",
> > \"default\": 1095.45, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"exp\", \"units\": \"\"}, \"name\": \"ffreq\", \"value\": 10000,
> > \"defArg\": 10000}, {\"spec\": {\"maxval\": 1, \"minval\": 0,
> > \"class\": \"ControlSpec\", \"default\": 0, \"rate\": \"control\",
> > \"step\": 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\":
> > \"resonance\", \"value\": 0.5, \"defArg\": 0.5}, {\"spec\":
> > {\"maxval\": 1, \"minval\": 0, \"class\": \"ControlSpec\",
> > \"default\": 0, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"low\", \"value\": 0.25,
> > \"defArg\": 0.25}, {\"spec\": {\"maxval\": 1, \"minval\": 0,
> > \"class\": \"ControlSpec\", \"default\": 0, \"rate\": \"control\",
> > \"step\": 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\":
> > \"band\", \"value\": 0, \"defArg\": 0}, {\"spec\": {\"maxval\": 1,
> > \"minval\": 0, \"class\": \"ControlSpec\", \"default\": 0,
> > \"rate\": \"control\", \"step\": 0, \"warp\": \"linear\",
> > \"units\": \"\"}, \"name\": \"high\", \"value\": 0, \"defArg\": 0},
> > {\"spec\": {\"maxval\": 1, \"minval\": 0, \"class\":
> > \"ControlSpec\", \"default\": 0, \"rate\": \"control\", \"step\":
> > 0, \"warp\": \"linear\", \"units\": \"\"}, \"name\": \"notch\",
> > \"value\": 0, \"defArg\": 0}, {\"spec\": {\"maxval\": 1,
> > \"minval\": 0, \"class\": \"ControlSpec\", \"default\": 0,
> > \"rate\": \"control\", \"step\": 0, \"warp\": \"linear\",
> > \"units\": \"\"}, \"name\": \"peak\", \"value\": 0.1, \"defArg\":
> > 0.1}], \"active\": true, \"point\": [4, 9], \"instr\":
> > \"moreFilters.SVFwobbler\"}, {\"outVar\": \"bus4\", \"args\":
> > [{\"in\": \"bus4\", \"spec\": {\"rate\": \"audio\", \"class\":
> > \"AudioSpec\"}, \"name\": \"audio\"}, {\"in\": \"3\", \"spec\":
> > {\"maxval\": 0, \"minval\": -Infinity, \"class\": \"ControlSpec\",
> > \"default\": -Infinity, \"rate\": \"control\", \"step\": 0,
> > \"warp\": \"db\", \"units\": \" dB\"}, \"name\": \"gain\",
> > \"defArg\": 0}], \"active\": true, \"point\": [4, 11], \"instr\":
> > \"compiler.amp.gain\"}, {\"outVar\": \"audio\", \"args\": [{\"in\":
> > \"mixbus\", \"spec\": {\"rate\": \"audio\", \"class\":
> > \"AudioSpec\"}, \"name\": \"audio\"}, {\"spec\": {\"maxval\": 0,
> > \"minval\": -Infinity, \"class\": \"ControlSpec\", \"default\":
> > -Infinity, \"rate\": \"control\", \"step\": 0, \"warp\": \"db\",
> > \"units\": \" dB\"}, \"name\": \"gain\", \"value\": 0, \"defArg\":
> > 0}], \"active\": true, \"point\": [7, 0], \"instr\":
> > \"compiler.amp.gain\"}, {\"outVar\": \"audio\", \"args\": [{\"in\":
> > \"audio\", \"spec\": {\"rate\": \"audio\", \"class\":
> > \"AudioSpec\"}, \"name\": \"audio\"}, {\"in\": \"gate\", \"spec\":
> > {\"maxval\": 1, \"minval\": 0, \"class\": \"ControlSpec\",
> > \"default\": 0, \"rate\": \"control\", \"step\": 0, \"warp\":
> > \"linear\", \"units\": \"\"}, \"name\": \"gate\"}], \"active\":
> > true, \"point\": [7, 10], \"instr\": \"compiler.env.linen\"}],
> > \"inArgs\": [\"freq\", \"trig\", \"duration\", \"releaseTime\",
> > \"amp\", \"gate\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\",
> > \"8\", \"tempo\"]}}"
> >
> >
> > On Mon, Sep 29, 2014 at 10:15 AM, felix <felix-***@public.gmane.org
> > <mailto:felix-***@public.gmane.org>> wrote:
> >
> >
> > Thanks for that info.
> >
> > The problem is with SC's implementation.
> >
> > Its a long time known issue.
> >
> > NetAddr.sc
> >
> > // warning: this primitive will fail to send if the bundle size is
> > too large // but it will not throw an error. this needs to be
> > fixed sendBundle { arg time ... args; _NetAddr_SendBundle
> > ^this.primitiveFailed; }
> >
> > The relevant source code:
> >
> > typedefscpacket<65516>big_scpacket;
> >
> > It looks like it should correctly throw a primitive error:
> >
> >
> https://github.com/supercollider/supercollider/blob/061b53b1be1580aeb60ede76a16eda4a66d3a182/lang/LangPrimSource/OSCData.cpp#L197
> >
> > but it fails silently
> >
> >
> >
> >
> >
> >
> > On Mon, Sep 29, 2014 at 12:18 AM, Abram Hindle
> > <abram.hindle-yfeSBMgouQgsA/***@public.gmane.org <mailto:abram.hindle-yfeSBMgouQgsA/***@public.gmane.org>>
> > wrote:
> >
> > What I think I know: If it is IPV4, the max total UDP data size is
> > 66507 bytes. If fragmentation is disabled you have to keep below
> > 1478 data bytes if you're not using jumbo frames. And then if DSL
> > is used you're getting your data sized dropped down a lot more.
> >
> > What I know less about: If you use OSC over TCP you shouldn't run
> > into this problem. The max osc size is probably the packet size of
> > int32 so 2 or 4gb.
> >
> > In general keep your messages short. You can always split
> > messages.
> >
> > Abram
> >
> > On 14-09-28 02:06 PM, nescivi wrote:
> >> Hiho,
> >>
> >> I believe it is OS dependent?
> >>
> >> sincerely, Marije
> >>
> >> On 27-09-14 17:17, felix wrote:
> >>> It appears that sclang fails silently when trying to send an
> > OSC message
> >>> that is too large.
> >>>
> >>> I can't find documentation saying what that size is exactly.
> > Also can't
> >>> seem to find it in the source code.
> >>>
> >>> here?
> >>>
> >
> https://github.com/supercollider/supercollider/blob/master/lang%2FLangPrimSource%2FOSCData.cpp
> >
> >
> >>
> >>>
> >>>
> >>>
> >>> -- .. http://soundcloud.com/crucialfelix
> >>> http://github.com/crucialfelix .
> >>
> >> _______________________________________________ sc-users mailing
> >> list
> >>
> >> info (subscription, etc.):
> > http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> >> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> >> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
> >
> >
> >
> >
> >
> > -- .. http://soundcloud.com/crucialfelix
> > http://github.com/crucialfelix .
> >
> >
> >
> >
> > -- .. http://soundcloud.com/crucialfelix
> > http://github.com/crucialfelix .
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQIcBAEBAgAGBQJUKS7HAAoJEKZFmaPaYk6Qk4EP/3efAZAdmwB97rFFQflDgGtn
> cC4r1vmEQ/P96oA8razs6R143Yh2vsdyhI4HXw6W24UIwFZ0W1BDa9454zPsXY4A
> 87dAUW2h4h5pdr4+DFbhjDtAhmFWsutau2WxnGDTlZ1MFq+Ql53ietBTXZSm/wC0
> Ks4lUEIIUmt6AmY+xICDe4VaVcCS8F2rq8QcOw6vDiIzO8LsbhwFjRDatUwcVrev
> F+25rkx29kSPC2Yblr96H+VRQ4Ou0s1P1uVWL1D6P8O9I2jQYWXaye+ja92c/Bug
> m3zDdy1BWh+NH2cB8mBdLTh7t1uT+4eFVREHtSGXN6c4y8cy+xrBin3vc/6WjJwC
> F5XyzubztbMw3VxZVxXGKzyEna4P4rQ1paNWTDkKZd3Z5WZsEgee2V+XmPJW4UcJ
> uoqkbT6FR/MaVDC/e6aFvOqqPeUxFuOuqe/nra0/9JZ9QmVGF/UVvbZ0RwVLTELz
> cCDDZCzF0IU7exII22ukRqBc8paJTvvXAuwnRXct2pkIdbIS+iNuREugEClH0lti
> StYUbr0gKzcRtXXKZP9FZdPmolxyokIilHzy3ZMbK9NKcQKDq2ymCdG3yROZaYFw
> MgZoY1YmpWGs06F6HCy1DzI+Nj5bNwyCEZDa001Pb0S0cgmCoZ+3xHXLT6VxkWeG
> dkbXZDWNJvqWV+FDhK8O
> =apg0
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.):
> http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>



--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
Hanns Holger Rutz
2014-09-29 11:16:44 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/29/2014 01:10 PM, felix wrote:
> re speed:
>
> have you noticed anything when sending real time controls like
> sliders or midi ? I know that gaming developers always use UDP
> because of the response time.

No, but then I'm not very critical with latencies, all my systems are
a bit sluggish, and you know I'm using non-RT garbage collected
languages ;)

>
> re size:
>
> in any case when using sclang then TCP will still have the 65516
> limitation of packet size

Yes, but you rarely hit these. You can split a bundle into multiple
messages, as long as these are asynchronous messages. The only problem
might be very large SynthDefs, in which case you need to go back to
/d_load.

>
> there is an OSC blob type, but not implemented in sc.

Blob type 'b' is implemented in SC. It is used for example to receive
completion packets and also for SynthDefs. On the SC-Lang side, I
think you need to use Int8Array (not 100% sure, check SynthDef.sc)

Best, .h.h.


>
> its easy enough to open a normal socket for anything big.
>
>
>
> On Mon, Sep 29, 2014 at 12:04 PM, Hanns Holger Rutz
> <contact-***@public.gmane.org <mailto:contact-***@public.gmane.org>> wrote:
>
> TCP doesn't have the 8K UDP limitation. I have used TCP for many
> years and not used UDP any longer. I have found that the
> theoretical impact on performance (TCP must wait for the reception
> of the packets) is irrelevant.
>
> Best, .h.h.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJUKT+cAAoJEKZFmaPaYk6Qhc8P/i7esqaB+h5MUIlcfxUSueWw
kFX8MS7ENq23tD4pEjIvXiJTEh0mcixteCmj5Ukr2sFGdG4hHkCn99FS0Ml8HYGu
9w+pUNdkVUwJsgmskbaGA4kapOgx9+Ln0qvnAgb+l3uXJGfcD56yZXdFbzqRcblb
dRs6l3L5vBC296ReMTgn9pNfCU7fgJLIftpRxnQTw27e1GENF+RmG/HlZ/wn7l3T
teoXzI9pxJM1jztEvvRa2Pw8a2U/gcnW/aIHGxpi+s5SEcz2QUygkR05m12a1C4J
lgQdZDB1xwlJU/jlklw5PXsJ1DHGsDgJIEhnSLh+ZW0jhw+CupCv6/2t6ym5kqUO
10wpRav5K4K6lCIQJgCPCFBVFKPEreo3TUvZXLmCWadW5QB0RELIjyfXeTqVpqls
aiWQVksBvi8H3YgZEL2fyBwxK7mDRbCMgeMeUl9Vk8/Frp7dXFeOyX9bOhFdjMew
OwKENMfi3rN1dJoSGMQ7AYuWFSXLRK9ImhSHcaeTGRrD74ahvkwZZ/qS0XxM2Gze
G+VVhYiCWOhf24I45I7y92Wt58yhJjkeNz1DePBHB2RQ3UiSrWLA32YAmspOtqse
eqcUJcAvdGjeYmTQPSrCxRBtOaiVFPlZp7SDsdO8fL8L4zzPdU9n3vjxo+LDc3nR
nc3UkkejZNFF1Fsu37ou
=lZVQ
-----END PGP SIGNATURE-----

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
felix
2014-09-29 13:00:09 UTC
Permalink
On Mon, Sep 29, 2014 at 1:16 PM, Hanns Holger Rutz <contact-***@public.gmane.org> wrote:

> No, but then I'm not very critical with latencies, all my systems are
> a bit sluggish, and you know I'm using non-RT garbage collected
> languages ;)
>

in sc lang many people use the default 0.2s server latency anyway,
so nothing is real time.

there are many things in sclang that are more disturbing to performance
than garbage collection might be.

I'm building interfaces in the browser now and its super fast. sclang has
far less to deal with, so it can concentrate on music making.

this has been my project for a while: to reduce my sclang usage to its core
competencies.




> >
> > in any case when using sclang then TCP will still have the 65516
> > limitation of packet size
>
> Yes, but you rarely hit these. You can split a bundle into multiple
> messages, as long as these are asynchronous messages.
>

I'm sending JSON in single messages. so its not a bundle.

If I need to I can split the string and send multiple packets.

for now at least I raise an error when 65k is hit


> there is an OSC blob type, but not implemented in sc.
>
> Blob type 'b' is implemented in SC. It is used for example to receive
> completion packets and also for SynthDefs. On the SC-Lang side, I
> think you need to use Int8Array (not 100% sure, check SynthDef.sc)
>

oh thanks, will investigate !



>
> Best, .h.h.
>




--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
felix
2014-09-29 09:17:35 UTC
Permalink
OK, it does fail correctly:

ERROR: makeSynthMsgWithTags: buffer overflow
ERROR: throw during error handling!

Instance of DoesNotUnderstandError { (0x111ba9f18, gc=BC, fmt=00,
flg=00, set=03)
instance variables [6]
what : Symbol 'DoesNotUnderstandError'
protectedBacktrace : nil
path : nil
receiver : nil
selector : Symbol 'at'
args : instance of Array (0x11721e768, size=1, set=2)
}

sendBundle also fails correctly:

ERROR: makeSynthMsgWithTags: buffer overflow

so the comment in NetAddr is outdated and should be removed



On Sat, Sep 27, 2014 at 5:17 PM, felix <felix-***@public.gmane.org> wrote:

>
> It appears that sclang fails silently when trying to send an OSC message
> that is too large.
>
> I can't find documentation saying what that size is exactly. Also can't
> seem to find it in the source code.
>
> here?
>
> https://github.com/supercollider/supercollider/blob/master/lang%2FLangPrimSource%2FOSCData.cpp
>
>
>
>
> --
> ..
> http://soundcloud.com/crucialfelix
> http://github.com/crucialfelix
> .
>



--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
Loading...