2
votes

I've been trying for a few days to use the kAudioUnitSubType_MatrixMixer on iOS.

For testing purposes I tried to port the MatrixMixerTest sample code from MacOSX. But I don't have any sound (there is no error reported).

here is what I do :

  • Create AUGraph
  • Add RemoteIO Node to graph
  • Add MatrixMixer Node to graph
  • Connect MatrixMixer to RemoteIO.
  • Open AUGraph
  • Getting the Mixer AudioUnit from MatrixMixer Node
  • Setting 2 Input Bus to Mixer AudioUnit
  • Setting 1 Output Bus to Mixer AudioUnit
  • Setting Rendering Callback to both Inputs
  • Setting Correct StreamFormat to each input bus
  • Setting Correct StreamFormat to output bus
  • AuGraph Initialize
  • Setting All volumes of the matrixmixer to 1.0

And when I start the graph no sound, and no error. And when I show the matrix Mixer with PrintMatrixMixerVolumes (from Core Audio Utility by Apple) everything looks normal.

One of my question is : Is the AUMatrixMixer really works on iOS ? And the other is : Is there something specific to do with this Audio Unit ?

Thank You

EDIT : When I print the matrix it shows :

Input Channels = 4, Output Channels = 2 Input Elements: 0:[2, T] 1:[2, T]
Output Elements: 0:[2, T]
Global Volume: 1.000 1.000 (1.000) (1.000) 1.000 (1.000) (1.000) 1.000 (1.000) (1.000) 1.000 (1.000) (1.000) 1.000 1.000

1
Did you set the crosspoint gains?sbooth
Yes. See edit for what it prints :)Aymarick
Yes, it works. But I definitely agree - it's a pain to figure out. Took me two weeks. Did you enable the two input buses and the output bus? Did you set the input levels and the output levels on the channels? They are different from the cross point gains. Did you check your rendering function to make sure it is giving data? What's your graph look like?Matt H
Hi, I'm struggling with it just now. Everything seems to be connected, rendering working good, no errors, but I can't get any sound. With typical kAudioUnitType_Mixer works perfect, but I need Matrix. How do you set cross-point gain ? I can't get any info about itFischer

1 Answers

0
votes

I had the same issue, everything seemed ok but no sound. I solved with this line to set the Master Volume for the Matrix Mixer:

AudioUnitSetParameter(matrixMixer, kMatrixMixerParam_Volume, kAudioUnitScope_Global, 0xFFFFFFFF, 1.0, 0);