• 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
CoreAudio device removed question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreAudio device removed question


  • Subject: CoreAudio device removed question
  • From: Jean Bovet <email@hidden>
  • Date: Tue, 13 May 2003 21:02:49 +0200

Hi,

I'm trying to understand how the CoreAudio is notifying the software
when an audio device is removed from the Mac.

Currently, I've installed a listener as follow:

AudioDeviceAddPropertyListener(mDeviceID, 0, DIRECTION_INPUT,
kAudioDevicePropertyDeviceIsAlive,
inputDevicePropertyListener, self);

Then, in the callback routine, I stop the ioProc of the device (the
ioProc is running) as follow:

static OSStatus inputDevicePropertyListener(AudioDeviceID inDevice,
UInt32 inChannel, Boolean isInput,
AudioDevicePropertyID
inPropertyID, void *inClientData)
{
if(inPropertyID == kAudioDevicePropertyDeviceIsAlive)
AudioDeviceStop(..., ...);
return noErr;
}

It work quite well for one ioProc. But if I register two ioProc (one
for input, the other for output - on the same device, let say the iMic)
and then I remove the device, sometime (and this is why I don't
understand - sometime) my program crash with the following backtrace:

Thread 3 Crashed:
#0 0x94d84b18 in
XIOAudioDevice::GetCurrent0TimeStamp(AudioTimeStamp&)
#1 0x94d83798 in XIOAudioDevice::Update0TimeStamp()
#2 0x94d82480 in XThreadedDevice::IOThread()
#3 0x94d95a24 in XThreadedDevice::IOThreadEntry(void*)
#4 0x94d911b0 in CAPThread::Entry(CAPThread*)
#5 0x90020d28 in _pthread_body

It seems like one of the ioProc didn't stop: but sometime, my program
doesn't crash and the two ioProc are correctly stopped. What I'm doing
wrong ? It is the "good" way of stopping an ioProc when a device is
removed ?

Thank you for any help.

Jean Bovet
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: CoreAudio device removed question
      • From: Jeff Moore <email@hidden>
  • Prev by Date: Re: Slider values on an Input Volume(Gain) Control
  • Next by Date: Re: NewbieQuestion: _IODevices!
  • Previous by thread: Re: MIDI for my PCI device on OS X
  • Next by thread: Re: CoreAudio device removed question
  • Index(es):
    • Date
    • Thread