USB Audio Project: Setting up the Matrix Mixer in mixer.xc
Posted: Wed Jul 10, 2019 10:45 am
Hello,
I am working on a USB audio project and would like to make use of the Digital Mixer included in the USB Audio Reference Design. The document that accompanies the software (Doc. No. XM0088546.1) briefly describes the Digital Mixer and its control channel - namely:
There is a short example in the document for controlling the matrix from the Host PC but I would like to control the matrix internally - so rerouting the control channel "c_mix_ctl" from Endpoint0 to my own processing in the XMOS device.
This is the source from mixer.xc showing what happens when the SET_MIX_MULT or SET_MIX_MAP commands are received. Can anyone tell me how the parameters "mix", "index" and "val" relate to the mix matrix? There is little documentation on how the matrix is arranged i.e. which cells relate to which input or output.
Any pointers to additional documentation would be useful. Hope someone can help, cheers!
I am working on a USB audio project and would like to make use of the Digital Mixer included in the USB Audio Reference Design. The document that accompanies the software (Doc. No. XM0088546.1) briefly describes the Digital Mixer and its control channel - namely:
Command | Description |
---|---|
SET_SAMPLES_TO_HOST_MAP | Sets the source of one of the audio streams going to the host. |
SET_SAMPLES_TO_DEVICE_MAP | Sets the source of one of the audio streams going to the audio driver. |
SET_MIX_MULT | Sets the multiplier for one of the inputs to a mixer. |
SET_MIX_MAP | Sets the source of one of the inputs to a mixer. |
SET_MIX_IN_VOL | If volume adjustment is being done in the mixer, this command sets the volume multiplier of one of the USB audio inputs. |
SET_MIX_OUT_VOL | If volume adjustment is being done in the mixer, this command sets the volume multiplier of one of the USB audio outputs. |
Code: Select all
case SET_MIX_MULT:
mix = inuint(c_mix_ctl);
index = inuint(c_mix_ctl);
val = inuint(c_mix_ctl);
inct(c_mix_ctl);
write_word_to_mix_mult(mix, index, val);
break;
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);
#ifdef FAST_MIXER
setPtr(index, val, mix);
#else
write_word_to_mix_map(mix, index, val);
Any pointers to additional documentation would be useful. Hope someone can help, cheers!