Multiple unexpected AudioConverterComplexInputDataProc invocations
Multiple unexpected AudioConverterComplexInputDataProc invocations
- Subject: Multiple unexpected AudioConverterComplexInputDataProc invocations
- From: Heath Raftery <email@hidden>
- Date: Fri, 17 Jun 2005 00:05:55 +1000
After speaking with William Stewart at WWDC, I now have a working
prototype that in real-time, records from the microphone, compresses,
decompresses and plays to the speakers, after just one day of coding.
I'm ecstatic. The CoreAudio team, particularly Bill and Bob (? sorry,
can't remember your name) at WWDC2005 made my trip worthwhile. I know
Bill made at least one other developer's trip worthwhile too.
Whatever they're paying you, they should double ;)
Now after that buttering up, I have a couple of niggling things to
tie up. Here's one:
My input AudioUnit calls my audioArrived callback periodically, which
streams the data into a buffer. I have a different thread that loops
calling AudioConverterFillComplexBuffer. The
AudioConverterComplexInputDataProc that I supply to that call either
fills the buffer as requested, or if there's not enough data
collected at that time, returns a custom error value. After speaking
to Bill, I expected this error value to be propagated straight back
to my calling thread. When the calling thread receives this return
error it goes to sleep for a small amount of time before calling
AudioConverterFillComplexBuffer again.
The problem I have is that after returning my custom error, the
InputDataProc is called 6 more times before the calling thread gets
the return value. This doesn't really cause any problems, because the
InputDataProc just returns its "not enough data" error again each
time. I'm just worried that maybe I've done something wrong, or that
I'm seeing something unusual. Or does the
AudioConverterFillComplexBuffer just give the
AudioConverterComplexInputDataProc a few chances to satisfy its
request before bubbling the error back up?
My log messages look something like this:
2005-06-16 23:33:33.167 AudioDebug[9226] About to call
AudioConverterFillComplexBuffer
//Logged from the calling thread
2005-06-16 23:33:33.167 AudioDebug[9226] InputDataProc wants 4028
packets
//Logged at the top of my InputDataProc.
//In this case there is not enough data available, so my custom error
value is returned
2005-06-16 23:33:33.167 AudioDebug[9226] InputDataProc wants 4028
packets
//But control is not returned to my calling thread, instead the
InputDataProc is called again
2005-06-16 23:33:33.167 AudioDebug[9226] InputDataProc wants 4028
packets
//And again
2005-06-16 23:33:33.167 AudioDebug[9226] InputDataProc wants 4028
packets
2005-06-16 23:33:33.172 AudioDebug[9226] InputDataProc wants 4028
packets
2005-06-16 23:33:33.172 AudioDebug[9226] InputDataProc wants 4028
packets
2005-06-16 23:33:33.172 AudioDebug[9226] InputDataProc wants 4028
packets
//Until the 7th time when...
2005-06-16 23:33:33.172 AudioDebug[9226] Not enough data, sleeping
for a bit.
//AudioConverterFillComplexBuffer returns with my custom error and
the threads sleeps for a bit
Is this to be expected, or am I missing something?
Heath
_______________________________________________
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