Re: How to route channels from SynthUnit to a multi-channel device?
Re: How to route channels from SynthUnit to a multi-channel device?
- Subject: Re: How to route channels from SynthUnit to a multi-channel device?
- From: William Stewart <email@hidden>
- Date: Mon, 19 Sep 2005 12:58:27 -0700
On 19/09/2005, at 12:32 PM, michael markert wrote:
Hello list!
I'm sorry, if I am asking something obvious, but I'm stuck.
I have a graph with a SynthNode, one effectNode and one outputNode
which represents my 10-Channel-Output-Device (DELTA 1010LT).
Now I'd like to be able to route the stereo-output of the
effectNode to another pair of channels of the outputNode (that is
the inputScope of the outputUnit, right?)
Synth Node
||
||
Effect Node
||
// \\
// \\
|| or ||
Output Node (CH 0/1 -OR- CH 2/3)
For stereo-output on CH 0/1 everything works fine (so my graph and
units are set up correctly).
Now I have three possible solutions but sadly also three problems:
1. I tried the MatrixMixerExample example from the CoreAudioSDK,
but it needs "CAStreamBasicDescription.h"
...and whenever I add these two files to my project, it doesn't
compile anymore with a bunch of errors:
"error: parse error before "CAStreamBasicDescription": line 71:
class CAStreamBasicDescription :
I must have overlooked some project settings for this case, for it
compiles with the exampleProject?
Do I need dealing with formats, when there's no real I/O but only
Synth-Output?
I just tried this with the CA SDK 1.4.2 and its fine - (http://
developer.apple.com/audio)
2. Do I have to use a MatrixMixer (connected between the effectNode
and the outputNode) and "route" channels by setting the desired
channel's volume? (This seems a bit of a strange solution). If this
is the case, is there any MatrixMixer Documentation? It's really
hard to find something useful about it and whenever I plug-in-
between a matrixMixer, I don't hear anything but silence?
If you look through the MM Test, you will see that to get anything
out of the MM you need to set volumes - basically there are 4 that
you must set to non-zero:
Below, the numbers in Hex are the parameter numbers where N is the
input channel and M is the output channel, F is uses AS IS (ie, Hex F)
Input volume for the channel (0xNNNNFFFF)
Output volume for the channel (0xFFFFMMMM)
Cross point volume for that input and output channel (0xNNNNMMMM)
Global volume on the whole matrix (0xFFFFFFFF)
Basically, the matrix mixer flattens all of its inputs and outputs
and you address these by channel number counting from the first
channel on the first bus on both the input and output side.
In Tiger there are two audio units that provide some simple
functionality that might be relevant for you in this case: AUMerger
(2 separate inputs, 1 output) and AUSplitter (1 input, 2 separate
outputs) (these are aufc audio units)
I think the AUSplitter might be ideal for what you would need. Try
doing this to see what params AUSplitter has. From the command line:
% auval -v aufc splt appl
3. I tried channelMapping (without using a mixerUnit), but I can't
get it to change anything. It simply keeps playing on the first two
channels. Here is the code (although I'm not sure if the format is
needed?):
-(void)mapOutputToChannels:(int)pairIndex {
// pair index is the index of menuItem, (e.g.) "delta 0/1",
"delta 2/3"...
OSStatus result = noErr;
UInt32 size;
AudioUnit effectUnit;
AUGraphGetNodeInfo(graph, effectNode, NULL, NULL, NULL,
&effectUnit);
AudioUnit outputUnit;
AUGraphGetNodeInfo(graph, outputNode, NULL, NULL, NULL,
&outputUnit);
AudioStreamBasicDescription format;
size = sizeof(format);
result = AudioUnitGetProperty(outputUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input, 0,
&format, &size);
result = AudioUnitSetProperty(effectUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output, 0,
&format, size);
This will fail - you can't set the format on the output scope of the
HAL output units (as this is the device)
You really should check the result :-)
With every document I'm reading I get more confused: I don't know
if I should use a matrixMixer, do channelMapping, using
channelLayouts, defining a channelBitmap or makeConnections in the
matrixMixer.
And whereever I go, something is stopping me :(
The matrix mixer is probably the most flexible approach - there is
also in PublicUtility a utility function in MatrixMixerVolumes.h -
this is good to see what volumes you need to set (and what you have set)
The Splitter might be all you need I think though - its also pretty
easy to use
Bill
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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