[Csnd] OSCsend INIT ERROR: creating socket
Date | 2019-05-21 09:06 |
From | Tarmo Johannes |
Subject | [Csnd] OSCsend INIT ERROR: creating socket |
Attachments | None None osc-send-test.csd |
Date | 2019-05-21 10:33 |
From | Victor Lazzarini |
Subject | Re: [Csnd] OSCsend INIT ERROR: creating socket |
Here both OSCSend_lo and OSCSend have issues. The problem with OSCSend is that you are trying to open the same socket several times, it will never work. It is the same instance of the opcode running initialisation several times. What I can do is prevent that happening (if init is done, then don’t do it again). Messages are only actually sent at k-time. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 21 May 2019, at 09:06, Tarmo Johannes |
Date | 2019-05-21 12:45 |
From | Tarmo Johannes |
Subject | Re: [Csnd] OSCsend INIT ERROR: creating socket |
Hm, But if I want to send to different hosts in the same cycle, it should need separate sockets anyway, right? How is it done in the opcode - the socket is opened in init time? When is it closed? The strange thing is that the error happens after a while as if there were some limit for opening a certain number of sockets? In another application I try the OSCsend as one call in separate instrument thus it is not run in loop. Still similar Cannot open socket error happens after a while. No problem with liblo version. I would be most happy to get rid of the liblo dependency though... Tarmo T, 21. mai 2019 12:33 Victor Lazzarini <Victor.Lazzarini@mu.ie> kirjutas: Here both OSCSend_lo and OSCSend have issues. |
Date | 2019-05-21 13:21 |
From | Victor Lazzarini |
Subject | Re: [Csnd] OSCsend INIT ERROR: creating socket |
you need separate instances. That's the case for the older version as well. You can't put it in a loop. Needs to be done as a recursive code, if you wish.
if there is a problem outside a loop, we're happy to look at it. I don't know if there is a time constraint in opening sockets, but I would not think so.
Oeyvind could also tell us if he ran into similar issues, since he's used these in very challenging setups.
Note that liblo has not gone away as the listening code uses it.
Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2019-05-21 14:33 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] OSCsend INIT ERROR: creating socket |
Hi, I haven't run into similar problems, but I haven't switched destinations quickly like this. However, I can anticipate that there could be an error caused by opening a port, then closing it, and then opening it again, all in quick succession. The port may not have been completely freed immediately when closing it, and then the subsequent attempt to open it would fail. Beware I am just guessing here, but it seems it *could* be an explanation to what you observe. Oeyvind tir. 21. mai 2019 kl. 14:21 skrev Victor Lazzarini <Victor.Lazzarini@mu.ie>:
Oeyvind Brandtsegg Professor of Music Technology NTNU 7491 Trondheim Norway Cell: +47 92 203 205 http://www.partikkelaudio.com/ http://crossadaptive.hf.ntnu.no http://gdsp.hf.ntnu.no/ http://soundcloud.com/brandtsegg http://flyndresang.no/ http://soundcloud.com/t-emp |
Date | 2019-05-21 20:08 |
From | Tarmo Johannes |
Subject | Re: [Csnd] OSCsend INIT ERROR: creating socket |
Attachments | osc-send-test.csd |
Hi, I made some more tests: moving OSCsend to separate instrument ie calling it in separate instances does not make difference. Also it is not the amount of calls that is made at once - I stopped increasing the amount of adresses and set it to modest 10 (ie a message is sent to 10 addresses 4 times per second) - the system lasts for longer, but sooner or later still the "Error: ... creating socket" appears. Also calling the mySendOsc instrument not in the same time (every instance after 10 k-cyclec) did not make difference. My guess is that there is still something in OSCsend that does not close the sockets properly and at some point it hits some limit. OSC_lo works as expected. Maybe there is something wrong in my logic or system setup... Please test with the csd attached. Thanks! tarmo ----- <CsoundSynthesizer> <CsOptions> -odac -d </CsOptions> <CsInstruments> sr = 44100 nchnls = 2 0dbfs = 1 ksmps = 32 ; schedule 1,0,10 instr 1 kcount init 80 if (metro(4)==1) then event "i", 2, 0, 0, kcount ; call OSC from different instances ;kcount +=1 endif
endin instr 2 icount = p4 ; how many addresses to send the message to print icount index = 0 iport = 6006 while index < icount do Shost sprintfk "127.0.0.%d", 1+(index%64) schedule "mySendOsc",(index*10)/kr,0.1, Shost, iport ; do not call in the same time ;schedule "mySendOsc",0,0.1, Shost, iport ; all in same time index += 1 od endin instr mySendOsc p3= 0.1 Shost strget p4 iport = p5 OSCsend 1, Shost, iport, "/native", "i", int(random:k(1000,2000)) ;OSCsend_lo 1, Shost, iport, "/liblo", "i", int(random:k(10,99))
endin </CsInstruments> <CsScore> i 1 0 60 </CsScore> </CsoundSynthesizer> ---- Kontakt Oeyvind Brandtsegg (<oyvind.brandtsegg@ntnu.no>) kirjutas kuupäeval T, 21. mai 2019 kell 16:34:
|
Date | 2019-05-21 20:32 |
From | Victor Lazzarini |
Subject | Re: [Csnd] OSCsend INIT ERROR: creating socket |
pushed a fix that looks like it fixes it. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 21 May 2019, at 20:08, Tarmo Johannes |
Date | 2019-05-21 21:03 |
From | Tarmo Johannes |
Subject | Re: [Csnd] OSCsend INIT ERROR: creating socket |
Attachments | None None |
Date | 2019-05-21 21:06 |
From | Victor Lazzarini |
Subject | Re: [Csnd] OSCsend INIT ERROR: creating socket |
Thanks for reporting the bug and confirming the fix. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 21 May 2019, at 21:03, Tarmo Johannes |