xmos / sw_usb_audio

XMOS USB Audio reference design
Other
32 stars 16 forks source link

MCLK_441 of 11289600 doesn't work #218

Closed xhuw closed 3 months ago

xhuw commented 5 months ago

Setting MCLK_441 to (256 * 44100) leads to an incorrect MCLK being setup and no audio being output. To reproduce change xua config as follows:

diff.txt

Then try playing audio through the device.

I have check this on commit 1e830c1

Suspect that these mclk values are incorrect:

https://github.com/xmos/sw_usb_audio/blob/d4a5f922bd9cc58eba80889098cd7033857fdd73/shared/apppll.h#L40-L42

XMOS-JoeG commented 3 months ago

define APP_PLL_DIV_11M 0x80000009

should be

define APP_PLL_DIV_11M 0x80000019

11M setting is just the same as 22 setting but you want to divide by twice as much. So the setting was /13 (register value of 12 (0xC)) and now needs to be /26 (register value of 25 (0x19))

xross commented 3 months ago

The code is just about to move to using lib_sw_pll even for fixed freqs, so we should fix it there.

xross commented 3 months ago

Fixed here: https://github.com/xmos/lib_sw_pll/pull/66

Moving to lib_sw_pll here: https://github.com/xmos/sw_usb_audio/pull/234