Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:5199] Re: [Portaudio] Re: Re: Preliminary implementationof low latency audio for Windows

Date2004-08-11 14:39
From"gogins@pipeline.com"
Subject[CSOUND-DEV:5199] Re: [Portaudio] Re: Re: Preliminary implementationof low latency audio for Windows
Thanks for the tip, I'll take a look at the Csound 5 code for this tonight.

Original Message:
-----------------
From: Richard Dobson richarddobson@blueyonder.co.uk
Date: Wed, 11 Aug 2004 09:25:31 +0100
To: csound-dev@eartha.mills.edu
Subject: [CSOUND-DEV:5188] Re: [Portaudio] Re: Re: Preliminary
implementationof low latency audio for Windows


Should be the same, CTRL-C is just SIGINT. I use this entirely
conventionally to 
stop playtback in my "paplay" soundfile play program using portaudio.

In essence:

static int file_playing;

void playhandler(int sig)
{
	if(sig == SIGINT)
		file_playing = 0;
}

int main()
{
   signal(SIGINT,playhandler);

  /* start:*/
  file_playing = 1;
   /* playback loop*/
   while(fileplaying){
     do_portaudio_stuff(...);
   }
   close_portaudio_stuff();
   return 0;
}

This works unchanged on both Windows and OS X. SO it should jolly well work
on 
Linux too! Probably need to do more for a re-entrant multi-threaded
monster, but 
hopefully the principle is the same. Often the trick is to trap CTRL-C and
do 
nothing, so the user can't stop a program that way.


Richard Dobson

Michael Gogins wrote:
> I have fixed up Top/threads.c to compile on Linux. I was able to build and
> run Csound and CsoundVST in csound 5 on Fedora Core 1. Everything still
> compiles and runs on Windows as well.
> 
> The portaudio DLL for Windows in CVS is now built for ASIO. Thanks to the
> PortAudio people for getting the ASIO thunks working for MinGW, even if
they
> have not done anything about blocking read and write yet.
> 
> You PortAudio people, note that there is code in Csound5/Top/pa_blocking.c
> that uses mutexes to create a blocking read and write from asynchronous
> ASIO.
> 
> Csound people, please note that it is now necessary to upgrade SWIG to
> version 1.3.21 to build CsoundVST on any platform.
> 
> Breaking a performance on Windows with control-C can leave PortAudio
hanging
> with an eventual blue screen of death. Suggestions for how to trap
control-C
> on Windows (works fine on Linux) would be appreciated.
> 
> ----- Original Message ----- 
> From: "John ffitch" 
> To: "Csound Developers Discussion List" 
> Sent: Tuesday, August 10, 2004 9:35 AM
> Subject: [CSOUND-DEV:5175] Re: Preliminary implementation of low latency
> audio for Windows
> 
> 
> 
>>...but it does mean that Linux Csound5 idoes not build
>>==John ff
>>
> 
> 
> 
> _______________________________________________
> Portaudio mailing list
> Portaudio@techweb.rfa.org
> http://techweb.rfa.org/mailman/listinfo/portaudio
> 
> 
> 


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .