Setting Up The USB Audio 2.0 MC Dev Board as a Matrix Mixer

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
markgtr813
Junior Member
Posts: 6
Joined: Mon Jan 02, 2012 6:32 pm

Setting Up The USB Audio 2.0 MC Dev Board as a Matrix Mixer

Post by markgtr813 »

I am working on setting up the XMOS USB MC 2.0 as a matrix mixer - i.e. all inputs are mixed to all outputs as:
CodeCogsEqn.gif
where out1 is the physical hardware jack OUT1 and USB1 is the output audio from a PC on USB channel 1.

The routing setup will be performed within the code - as opposed to using the supplied PC command-line host mixer control. The node mix levels (c11 - c88) will then be set dynamically (externally controlled).

I am trying to figure out the correct c_mix_ctl commands to send to the mixer to accomplish this. I should note that the c_mix_ctl chanend has been disconnected from Endpoint0 and connected elsewhere for this purpose.

I have figured out that the following code adjusts the physical OUT1/2 volume which, on the default setup, corresponds to USB Audio out channels 1 and 2:

Code: Select all

outuint(c_mix_ctl, SET_MIX_OUT_VOL);
outuint(c_mix_ctl, 0);
outuint(c_mix_ctl, desiredVol);
outct(c_mix_ctl, XS1_CT_END);

outuint(c_mix_ctl, SET_MIX_OUT_VOL);
outuint(c_mix_ctl, 1);
outuint(c_mix_ctl, desiredVol);
outct(c_mix_ctl, XS1_CT_END);
Now I am thinking that I can use similar code to set up the matrix routing (SET_MIX_MAP ?)and also control mixer node levels (SET_MIX_MULT ?). If this is correct, can someone advise on how this is done in code? If I am barking up the wrong tree, can someone advise on the proper way of accomplishing my goal?

Thank you in advance.
You do not have the required permissions to view the files attached to this post.


markgtr813
Junior Member
Posts: 6
Joined: Mon Jan 02, 2012 6:32 pm

Post by markgtr813 »

One week with no reply...

Is there a way to get in touch with an XMOS Field Application Engineer or audio product specialist? Unfortunately it seems that no support is offered in the forums!

Thanks
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Hi there,

mix_map is the mapping of an channel into a input of a mixer (this can be USB channel or a physical audio channel)
markgtr813
Junior Member
Posts: 6
Joined: Mon Jan 02, 2012 6:32 pm

Post by markgtr813 »

Ross wrote:Hi there,

mix_map is the mapping of an channel into a input of a mixer (this can be USB channel or a physical audio channel)
So are you saying that I should use the SET_MIX_MAP as:

Code: Select all

outuint(c_mix_ctl, SET_MIX_MAP);
outuint(c_mix_ctl, ?? what goes here ??);     //mix
outuint(c_mix_ctl, ?? what goes here ??);     //index
outuint(c_mix_ctl, ?? what goes here ??);     //val
outct(c_mix_ctl, XS1_CT_END);
If so, what do the 'mix', 'index', and 'val' integers represent?

What do the integers in the mix_map variable represent? I see the from the definition that the mix_map is an 8x18 array

Code: Select all

int mix_map[MAX_MIX_COUNT][MIX_INPUTS];     //makes an 8x18 array 
and I also see how the mix_map is filled

Code: Select all

case SET_MIX_MAP:
     mix = inuint(c_mix_ctl);
     index = inuint(c_mix_ctl); /* mixer input */
     val = inuint(c_mix_ctl);   /* source */
     inct(c_mix_ctl);

...
asm("stw %0, %1[%2]"::"r"(val),"r"(mix_map[mix]),"r"(index));
but it is still unclear to me what values I should be setting in the mix_map so that a matrix mixer is made.

Two further questions on the matter:
Where are the eight mixes output to? For example, where does mix 0 show up on the hardware connections

What are the numberings for the audio channels in MIX_INPUTS. For example, which MIX_INPUT is USB audio out 1?
markgtr813
Junior Member
Posts: 6
Joined: Mon Jan 02, 2012 6:32 pm

Post by markgtr813 »

Ross,

Can you offer me any more assistance in the areas that I have mentioned in my last post? I still need clarification on this topic. Thanks.
User avatar
Ross
XCore Expert
Posts: 968
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

There are MAX_MIX_COUNT separate mixes (8 by default) Each of these mixs can have MIX_INPUTS inputs.

It sounds like you only require one mix?