Csound Csound-dev Csound-tekno Search About

[Csnd-dev] UDP server not stopped on csoundStop()

Date2017-10-28 06:26
FromTarmo Johannes
Subject[Csnd-dev] UDP server not stopped on csoundStop()
Hi,

I am enjoying a lot the new UDP server features.
One thing: in CsoundQt with today's build of Csound from git develop branch, 
CSoundQt rebuilt against that,  and possibly other hosts using Csound API -  
when I start csound with --port= flag, on first run everything works as 
expected, when I stop, seems, the server is not stopped, the port is  not 
released and thus next run the server is not started again. 

If I run the csd in terminal, everything works (ie closing the terminal window 
or Ctrl+C closes the server)

In previous version of Csound  stopping UDP server worked.

Victor, can you guess what is the cause? Or should there be something added to 
host on stopping Csound process? Is there any API calls to deal with the 
server?

Thanks!

Date2017-10-28 07:04
FromVictor Lazzarini
SubjectRe: [Csnd-dev] UDP server not stopped on csoundStop()
Did you try stopping with ##close## or
!!close!! ? That is the command to stop it.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 28 Oct 2017, at 06:28, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:

Hi,

I am enjoying a lot the new UDP server features.
One thing: in CsoundQt with today's build of Csound from git develop branch,
CSoundQt rebuilt against that,  and possibly other hosts using Csound API -  
when I start csound with --port= flag, on first run everything works as
expected, when I stop, seems, the server is not stopped, the port is  not
released and thus next run the server is not started again.

If I run the csd in terminal, everything works (ie closing the terminal window
or Ctrl+C closes the server)

In previous version of Csound  stopping UDP server worked.

Victor, can you guess what is the cause? Or should there be something added to
host on stopping Csound process? Is there any API calls to deal with the
server?

Thanks!
tarmo

Date2017-10-28 07:39
FromTarmo Johannes
SubjectRe: [Csnd-dev] UDP server not stopped on csoundStop()
Yes, 

If I send ##close## from client, it works but if I stop CsoundQt from stop 
button (that performanceThread->Stop, joim, stopCsound, cleanUp etc), then 
server is not stopped. And it was OK before -  I could use --port flag with csd 
files running in CsoundQt.

tarmo

On Saturday, October 28, 2017 9:04:50 AM EEST you wrote:
> Did you try stopping with ##close## or
> !!close!! ? That is the command to stop it.
> 
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
> 
> On 28 Oct 2017, at 06:28, Tarmo Johannes
> > wrote:
 
> Hi,
> 
> I am enjoying a lot the new UDP server features.
> One thing: in CsoundQt with today's build of Csound from git develop
> branch,
 CSoundQt rebuilt against that,  and possibly other hosts using
> Csound API - when I start csound with --port= flag, on first run everything
> works as expected, when I stop, seems, the server is not stopped, the port
> is  not released and thus next run the server is not started again.
> 
> If I run the csd in terminal, everything works (ie closing the terminal
> window
 or Ctrl+C closes the server)
> 
> In previous version of Csound  stopping UDP server worked.
> 
> Victor, can you guess what is the cause? Or should there be something added
> to
 host on stopping Csound process? Is there any API calls to deal with
> the server?
> 
> Thanks!

Date2017-10-28 09:55
FromVictor Lazzarini
SubjectRe: [Csnd-dev] UDP server not stopped on csoundStop()
The correct way is to send the message because that will stop the thread cleanly.
Maybe it worked before but it was not
guaranteed. 
I can look into having an API method to
stop the server if that’s an issue.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 28 Oct 2017, at 07:39, Tarmo Johannes <trmjhnns@GMAIL.COM> wrote:

Yes,

If I send ##close## from client, it works but if I stop CsoundQt from stop
button (that performanceThread->Stop, joim, stopCsound, cleanUp etc), then
server is not stopped. And it was OK before -  I could use --port flag with csd
files running in CsoundQt.

tarmo

On Saturday, October 28, 2017 9:04:50 AM EEST you wrote:
Did you try stopping with ##close## or
!!close!! ? That is the command to stop it.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 28 Oct 2017, at 06:28, Tarmo Johannes
<trmjhnns@GMAIL.COM<mailto:trmjhnns@GMAIL.COM>> wrote:

Hi,

I am enjoying a lot the new UDP server features.
One thing: in CsoundQt with today's build of Csound from git develop
branch,
CSoundQt rebuilt against that,  and possibly other hosts using
Csound API - when I start csound with --port= flag, on first run everything
works as expected, when I stop, seems, the server is not stopped, the port
is  not released and thus next run the server is not started again.

If I run the csd in terminal, everything works (ie closing the terminal
window
or Ctrl+C closes the server)

In previous version of Csound  stopping UDP server worked.

Victor, can you guess what is the cause? Or should there be something added
to
host on stopping Csound process? Is there any API calls to deal with
the server?

Thanks!
tarmo

Date2017-10-28 11:02
FromVictor Lazzarini
SubjectRe: [Csnd-dev] UDP server not stopped on csoundStop()
Actually I am wrong, there is code there to stop the server on cleanup. I tested here with CsoundQT 0.9.4.1 and
I can stop the server with the stop button. From the CsoundQT console, I get

UDP server on port 6006 stopped
inactive allocs returned to freespace
end of score.		   overall amps:      0.1
	   overall samples out of range:        0
0 errors in performance
Elapsed time at end of performance: real: 12.620s, CPU: 0.725s
closing device
543 1024 sample blks of 64-bit floats written to dac



========================
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 28 Oct 2017, at 09:55, Victor Lazzarini  wrote:
> 
> The correct way is to send the message because that will stop the thread cleanly.
> Maybe it worked before but it was not
> guaranteed. 
> I can look into having an API method to
> stop the server if that’s an issue.
> 
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
> 
> On 28 Oct 2017, at 07:39, Tarmo Johannes  wrote:
> 
>> Yes, 
>> 
>> If I send ##close## from client, it works but if I stop CsoundQt from stop 
>> button (that performanceThread->Stop, joim, stopCsound, cleanUp etc), then 
>> server is not stopped. And it was OK before -  I could use --port flag with csd 
>> files running in CsoundQt.
>> 
>> tarmo
>> 
>> On Saturday, October 28, 2017 9:04:50 AM EEST you wrote:
>>> Did you try stopping with ##close## or
>>> !!close!! ? That is the command to stop it.
>>> 
>>> Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy
>>> Maynooth University
>>> Ireland
>>> 
>>> On 28 Oct 2017, at 06:28, Tarmo Johannes
>>> > wrote:
>> 
>>> Hi,
>>> 
>>> I am enjoying a lot the new UDP server features.
>>> One thing: in CsoundQt with today's build of Csound from git develop
>>> branch,
>> CSoundQt rebuilt against that,  and possibly other hosts using
>>> Csound API - when I start csound with --port= flag, on first run everything
>>> works as expected, when I stop, seems, the server is not stopped, the port
>>> is  not released and thus next run the server is not started again.
>>> 
>>> If I run the csd in terminal, everything works (ie closing the terminal
>>> window
>> or Ctrl+C closes the server)
>>> 
>>> In previous version of Csound  stopping UDP server worked.
>>> 
>>> Victor, can you guess what is the cause? Or should there be something added
>>> to
>> host on stopping Csound process? Is there any API calls to deal with
>>> the