Post
by Mike Teachman » Sat Feb 12, 2022 9:42 pm
I found the problem, which also exists in the newer prototype Teensy 4.1 firmware: In the new Teensy prototype firmware, the MCK frequency ("Fmck"), is set based on the sampling frequency ("Fs"). Fmck = Fs * 256. The *256 multiplier is typical for MCK. Previously, Fs was set to a much higher fixed frequency. So, why does the new means of deriving Fmck cause a problem? Ans: The SGTL5000 device needs to have a MCK signal before I2C will work, and that MCK signal must be > 8MHz. When Fs = 16kHz, which is used in the example code, Fmck = 16kHz * 256 = 4.096MHz, which is < 8MHz. Thus, I2C does not work.
Here is an experiment to try: set SAMPLE_RATE_IN_HZ = 44100 in the example file. The example should now work, with audio played at the much higher frequency.
With this prototype firmware, the Teensy audio shield will only work with audio streams that have Fs >= 32kHz
I am considering what options, if any, should to be added to the mimxrt I2S implementation to accommodate this questionable design choice in the SGTL5000 device.