Csound Csound-dev Csound-tekno Search About

[Cs-dev] OSC problem

Date2008-10-08 20:23
FromJean-Pierre Lemoine
Subject[Cs-dev] OSC problem
Helllo all,

Ar you looking at this problem with OSC?
Thanks
jp


Looking at the OSC code, OSCinit does not have a deinit callback
(but OSClisten does). I never programmed liblo, but I expect
lo_server_thread_stop() needs to be called to free the port. I
don't think it is called.

John's your expert here, he should be able to answer this one.

Victor

----- Original Message ----- From: "victor" 
To: 
Sent: Tuesday, October 07, 2008 9:50 PM
Subject: [Csnd] Re: use of OSC with csound API


Looks like the opcode requires a deinit callback (a destructor), which
it doesn't have, to free the port. Or does it? Perhaps we should discuss 
this in the
developer's list.

Victor
----- Original Message ----- From: "jean-pierre lemoine" 

To: 
Sent: Tuesday, October 07, 2008 8:11 PM
Subject: [Csnd] use of OSC with csound API


I am implemented OSC support in AVSynthesis.  but I have a problem
with reusing the csound instance (windows platform, csound double)

I start a thread which executes in its loop
 cs.Perform();
 cs.Cleanup();
 cs.Reset();

When I stop the csound execution from the main thread, csound stops,
and the cleanup , reset are done.
If I launch a new thread with the same csound instance, i get the
following error message and a trap
OSC server error 9904 in path (null): cannot find free port

The trap
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x2fc75321, pid=2444, 
tid=3524
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing 
windows-x86)
# Problematic frame:
# C  [lo.dll+0x5321]
#

It seems that the OSC resources are not released during cleanup and
reset. Do I need to do something specific?

In the csd I have
giOSChandle OSCinit 7770

and

instr 1
kreadOSC init 0
kosc OSClisten giOSChandle, "/AVS/layer1", "f", kreadOSC
if (kosc == 0) goto exl1
gkchLayer1 = kreadOSC
printk .1, gkchLayer1
exl1:
kosc OSClisten giOSChandle, "/AVS/layer2", "f", kreadOSC
if (kosc == 0) goto exl2
gkchLayer2 = kreadOSC
exl2:
kosc OSClisten giOSChandle, "/AVS/layer3", "f", kreadOSC
if (kosc == 0) goto exl3
gkchLayer3 = kreadOSC
exl3:
kosc OSClisten giOSChandle, "/AVS/layer4", "f", kreadOSC
if (kosc == 0) goto exl4
gkchLayer4 = kreadOSC
exl4:
kosc OSClisten giOSChandle, "/AVS/layer5", "f", kreadOSC
if (kosc == 0) goto exl5
gkchLayer5 = kreadOSC
exl5:
kosc OSClisten giOSChandle, "/AVS/layer6", "f", kreadOSC
if (kosc == 0) goto exl6
gkchLayer6 = kreadOSC
exl6:
kosc OSClisten giOSChandle, "/AVS/layer7", "f", kreadOSC
if (kosc == 0) goto exl7
gkchLayer7 = kreadOSC
exl7:
kosc OSClisten giOSChandle, "/AVS/layer8", "f", kreadOSC
if (kosc == 0) goto exl8
gkchLayer8 = kreadOSC
exl8:
endin

Thanks for any help



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net