Re: AudioDeviceIOProc not called after AudioDeviceStart
Re: AudioDeviceIOProc not called after AudioDeviceStart
- Subject: Re: AudioDeviceIOProc not called after AudioDeviceStart
- From: Jeff Moore <email@hidden>
- Date: Thu, 1 Apr 2004 13:08:59 -0800
Using printf to stdout from the IO thread also requires that you fflush
it too each time to be sure that it makes it out. I have seen cases
where not doing that leads to printf's just getting swallowed.
Do you have any conditions in your IOProc that need to be checked
before producing audio? Have you checked to be sure they are being met?
I'd also check to see if you aren't also stopping your IOProc somewhere
inadvertently.
Apart from that, I'm not sure what else to tell you with the
information at hand.
On Apr 1, 2004, at 12:56 PM, Alain Mazy wrote:
Le 4/1/04 9:49 PM, + Jeff Moore ; <email@hidden> a icrit :
That's not enough information to know what might be going astray in
your app. That sequence of calls by itself works fine if I paste them
into a command line tool. This will probably sound like a stupid
Yes, I'm sure the sequence of calls is correct because it works fine
in some
condition. I just wonder what kind of side effect could cause the
IOProc
not to be called.
question, but how are you judging whether or not your IOProc is
getting
called?
By putting a print statement the first time it is called or by setting
a
breakpoint and because I don't hear anything !
Thanks for your help.
Alain Mazy
On Apr 1, 2004, at 6:07 AM, Alain Mazy wrote:
Here is a piece of code I have to start an audio device (input).
err = AudioDeviceAddPropertyListener(fInputDevice->mID, 0, TRUE,
kAudioDevicePropertyDeviceIsRunning,
AudioDeviceIsRunningListenerProc,
NULL);
err = AudioDeviceAddIOProc(fInputDevice->mID,
AudioDeviceSourceInputIOProc, self);
err = AudioDeviceStart(fInputDevice->mID,
AudioDeviceSourceInputIOProc);
The PropertyListener callback is called and tells me the device is
running
but the AudioDeviceIOProc is never called. I get no error message.
Actually, this piece of code sometimes work and sometimes not. It
depends
on what the user has done before. However, the failure/success of
this code
does not depend on the creation code or startup code for the
AudioDevice
which is always the same.
An here comes the 'funniest' part: if I put a breakpoint on the first
line
and then execute the code step by step it ALWAYS work !
So what's the problem ? Timing ? Multi-thread related ? How should I
know
since the API tells me that everything is fine ?
Thanks a lot for your help.
Alain.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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.