Re: HALOutputUnit: Nx1 or 1xN
Re: HALOutputUnit: Nx1 or 1xN
- Subject: Re: HALOutputUnit: Nx1 or 1xN
- From: Doug Wyatt <email@hidden>
- Date: Fri, 30 Jan 2004 14:42:07 -0800
James will hopefully jump in quickly if I am wrong here, but I believe
that you can't change the number of channels on a bus while the unit is
initialized/running (and if you could it would invalidate all the
indices of the subsequence channels).
The way I understood it when he explained it to me yesterday was that
the matrix inputs / outputs / crosspoints indices (used for setting
parameters) are channel indices, not element numbers.
So for example, if you have 2 input elements, and they're both mono,
these 2 channels are addressed exactly the same as if you had one
stereo input element.
One way to approach this would be to dedicate some number of input
elements for each possible channel valence that you expect to use...
there are probably others...
Doug
On Jan 29, 2004, at 21:46, Austin Shoemaker wrote:
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.