Re: Closing an audio stream connection problem
Re: Closing an audio stream connection problem
- Subject: Re: Closing an audio stream connection problem
- From: Jeff Moore <email@hidden>
- Date: Thu, 17 May 2007 11:27:11 -0700
Presuming you are using AUHAL, AudioOutputUnitStop() is a synchronous
call. It doesn't return until it knows that it's IOProc isn't going to
get called again by the HAL.
I don't know a whole lot about PortAudio, so I can't say if this is
significant or not, but the code you list below seems like the
StopStream routine is stopping an input thing whereas the CloseStream
routine seems to be shutting down an output thing. That doesn't seem
right.
On May 17, 2007, at 10:46 AM, Oron Cherry wrote:
Hello,
We are writing an application in C++ using port audio SDK v19 (which
uses the Mac core audio).
There are some issues closing our application.
Before we close we call PortAudio calls StopStream() and CloseStream()
that calls coreAudio functions specified below.
We have a crash on quit when closing the application with a single
device.
The crash is solved if we do a small sleep() between the stopStream()
and CloseStream() functions.
We suspect that the StopStream is called and returns without
completion
(asynchronous way).
Then, the CloseStream is called when the stream is not stopped and
causes a crash.
Is there a way to get a confirmation that the thread responsible for
stopping the stream has finished before calling closeStream()?
static PaError StopStream( PaStream *s )
...
ERR_WRAP( AudioOutputUnitStop(stream->inputUnit) );
ERR_WRAP( AudioUnitReset(stream->inputUnit,
kAudioUnitScope_Global, 1) );
ERR_WRAP( AudioUnitReset(stream->inputUnit,
kAudioUnitScope_Global, 0) );
...
static PaError CloseStream( PaStream* s ) ...
AudioUnitUninitialize( stream->outputUnit );
CloseComponent( stream->outputUnit );
...
Thanks,
Oron
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden