Re: HALOutputUnit: Nx1 or 1xN
Re: HALOutputUnit: Nx1 or 1xN
- Subject: Re: HALOutputUnit: Nx1 or 1xN
- From: Austin Shoemaker <email@hidden>
- Date: Thu, 29 Jan 2004 21:46:37 -0800
That seems to be an optimal solution. I have one question regarding
the implementation of this approach: if the volume of an input bus is
0.0, can I change the number of channels of that bus without disrupting
the rest of the mixing cycle?
Thanks,
Austin Shoemaker
On Jan 28, 2004, at 5:03 PM, Doug Wyatt wrote:
On Jan 27, 2004, at 12:19, Austin Shoemaker wrote:
What is the performance difference between using one HALOutputUnit
mapped to N streams versus N HALOutputUnits each mapped to one of the
streams?
A lot depends on whether the channels you are using are in different
streams on the device.
It's definitely creating unnecessary overhead to run multiple I/O
procs (in this case, output units) that output to the same stream.
You'll potentially end up rendering to every channel in the stream
from each I/O proc, and even if you leave a stream's buffer untouched
(silent), the HAL won't know that and will be obliged to mix.
However, if you segregated your I/O procs (output units) per stream,
then, while there is still some overhead in having multiple I/O procs,
I suspect the HAL will not have to do any mixing.
How difficult would it be to reconfigure the input format of the
output unit and update the channel map to change the number of
streams that are running without any audio glitches?** Would it be
easier to just have a separate output unit for each independently
controllable stream?
There may not be any data on this, but if anyone knows that would be
helpful.
Thanks,
Austin
** So if I had 2 streams running to channels 3 and 4, and I wanted to
add another 2 streams running to channels 5 and 6, could I do that
without start/stop? If not, it is pretty clear that I should use one
output unit per stream.
You can reconfigure the channel map while the unit is running, but it
will create small critical region, during which, if the I/O proc gets
called, it will notice that the unit is being reconfigured, and render
silence.
Here's what I would do as a first pass:
If you have, say, a 10-channel device (be it split across streams 2+8
or whatever), set your input format to the output unit to 10 channels,
and connect it to a matrix mixer. Leave the channel map alone. So the
matrix 10 outputs from the matrix mixer will simply map to the 10
hardware channels. Then connect inputs to the matrix mixer and route
them to the desired outputs. The mixer is highly optimized for cases
like this, where an input channel is being routed (and not split) to a
single output. You can make and break connections to the mixer
dynamically, and if you set the volume to 0 before breaking a
connection, it will do a fast fade to prevent a click.
--
Doug Wyatt
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.