Hi there,
We have the need to run at 16 kHz (many channels + voice processing + limited host CPU power). How hard is it to modify the USB 2.0 audio code to run at 16kHz? I notice that currently the lowest rate supported is 44.1.
Thanks,
-Caleb
USB Audio at 16 kHz
-
- Active Member
- Posts: 62
- Joined: Wed Sep 23, 2015 1:15 am
-
- XCore Legend
- Posts: 1126
- Joined: Thu May 27, 2010 10:08 am
Yes, this is possible. The main restriction is the MCLK:BCLK ratio, and the fact this must also be a power of 2. The current software can only deal with maximum x512 for this, so it means that you will need an MCLK of either a 8.192MHz or 4.096MHz for x256.
You will also need to change the MAX_FREQ and MIN_FREQ defines accordingly. There are likely other assumptions in the firmware (such as audio HW configure changes) that expect things to be either 44.1/48K and their multiples, but it should be fairly straightforward to weed these out.
If the MCLK frequency is too low for your system and you would like to use something higher, you could use a separate task (or clock block in XCORE200) to divide down the MCLK in the chip, but it would only be suitable for use as an internal I2S logic clock, not as an input to the DAC (because all XMOS I/O are resynch'd to the 500MHz core clock). You could always resynch using an external flop to the pre-prescaled MCLK..
You will also need to change the MAX_FREQ and MIN_FREQ defines accordingly. There are likely other assumptions in the firmware (such as audio HW configure changes) that expect things to be either 44.1/48K and their multiples, but it should be fairly straightforward to weed these out.
If the MCLK frequency is too low for your system and you would like to use something higher, you could use a separate task (or clock block in XCORE200) to divide down the MCLK in the chip, but it would only be suitable for use as an internal I2S logic clock, not as an input to the DAC (because all XMOS I/O are resynch'd to the 500MHz core clock). You could always resynch using an external flop to the pre-prescaled MCLK..