Re: Does anyone get an AudioDevice that has both input and output channels? (question is related to software play through)
Re: Does anyone get an AudioDevice that has both input and output channels? (question is related to software play through)
- Subject: Re: Does anyone get an AudioDevice that has both input and output channels? (question is related to software play through)
- From: Brian Willoughby <email@hidden>
- Date: Wed, 18 Jul 2001 16:59:36 -0700
I really don't understand the need for a unified IOProc.
Even if the device driver calls your code one time for both the input and
output buffers, your program still is limited to delivering a completed input
buffer to the output - this means even ASIO must incur a single buffer of
latency. In other words, you cannot pass in data for an output buffer until
AFTER the input buffer is completely full, even with one callback. Unless you
have hardware which can DMA the input directly to the output (in which case
your app would not need to consume/provide buffers unless it wants a copy too).
[ Agreed. Furthermore if there *is* a single clock for the built-in
[ input and output, then there should be a device available with a
[ unified IOProc. The complexity of the general case should not be
[ an excuse to unecessarily complicate (and add latency to) the
[ common case.
[
[ After all, we do get this with ASIO for the built in audio in
[ MacOS9.
With CoreAudio it seems you would register for input, set up output, and start
the output AFTER you have received at least one input buffer. You can use
semaphores and multiple buffers to make sure that you never deliver a buffer to
the output before it had been filled from the input. This should be
completely independent of whether there are separate callbacks or one unified
callback.
Perhaps I don't understand ASIO, but for situations where a single callback is
lauded, I cannot see how this eliminates latency. If someone cares to explain
this to me offline (private email), feel free, as I would like to hear how
ASIO achieves this. If there truly is a shortcoming in CoreAudio, it should
not be hard to explain how the competition (ASIO) is implemented.
P.S. I can think of one way that might avoid latency, but it seems very
fragile and quite hardware dependent.
Brian Willoughby
Sound Consulting