• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Closing an audio stream connection problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Closing an audio stream connection problem


  • Subject: Closing an audio stream connection problem
  • From: "Oron Cherry" <email@hidden>
  • Date: Thu, 17 May 2007 13:46:49 -0400
  • Thread-topic: Closing an audio stream connection problem

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

  • Follow-Ups:
    • Re: Closing an audio stream connection problem
      • From: Jeff Moore <email@hidden>
  • Prev by Date: fixing user selected fonts in text track
  • Next by Date: Re: Closing an audio stream connection problem
  • Previous by thread: fixing user selected fonts in text track
  • Next by thread: Re: Closing an audio stream connection problem
  • Index(es):
    • Date
    • Thread