electro-smith / libDaisy

Hardware Library for the Daisy Audio Platform
https://www.electro-smith.com/daisy
MIT License
314 stars 131 forks source link

feat: add 44.1kHz to SAI #438

Open TheSlowGrowth opened 2 years ago

TheSlowGrowth commented 2 years ago

Is this all that's needed to add support for 44.1kHz? It seems too simple, so I guess I'm missing something.

44.1kHz makes sense when sample playback from *.wav files is desired.

stephenhensley commented 2 years ago

Hahahaha, if only. Right?

Because of the SAI clock source this will still end up generating a 48kHz clock.

In order to add 44.1kHz (and the other related samplerates) we'll have to adjust the PLL for the clock.

I can't recall if the PLL (2?) is used exclusively for audio/ADCs at this point, but that's the goal. And then we can adjust the PLL/MCLK freq to target the desired 256fs speed.

Once something like that is set up, we could probably implement something that can hit pretty much any target samplerate with good accuracy.

stephenhensley commented 1 year ago

Hi @TheSlowGrowth

I'm starting a little bit of housekeeping, and just want to tidy up some stale PRs.

I've marked this as a draft for now. If you'd rather close it for the time being instead, that's also fine. It'll probably still be a little bit before we get around to reworking the clock tree, adding an API for adjusting the PLLs for the required frequency changes on our end unless someone else gets to it sooner. Thanks!