Audio clocks on SAM9X60


Introduction

SAM9X60 doesn't include an Audio PLL as other platforms like SAMA5D2 do. It only includes an UPLL, used mainly for USB, and PLLA, which is used to clock the CPU, DDR and the Master Clock. In the absence of the Audio PLL, the audio peripherals use PLLA to generate the Generic clock, just like the rest of the peripherals do. This leads to imprecise clocks for the audio peripherals, which, in the end, results in clicks and pops on the audio streams. To fix this, the PLLA can be configured in the AT91Bootstrap to generate a clock closer to (or exactly) what the audio peripherals require. Please use the attached AT91Bootstrap GIT patches to adjust PLLA for the required audio peripheral.

TIP For details on how to apply a git patch, please reference git-am

I2S GIT patch

The I2S patch will make PLLA generate a clock of (48 * Main Crystal Oscillator) / 2. On SAM9X60-EK there is a 24 MHz Crystal, so PLLA will generate a clock of 576 MHz. In the end, this will help provide a Generic clock of 1.536 KHz required by I2S to capture/playback a 48 KHz audio stereo stream with S16_LE format (48 * 2 * 16). For different sampling frequencies, channel number or audio format, different values are required for PLLA.

ALERT! This GIT patch will change the CPU clock to 576 MHz and Master clock to 192 MHz

ALERT! This patch is required only if the I2S is configured as master (generates I2SMCC_MCK, I2SMCC_CK or I2SMCC_WS)

CLASSD GIT patch

The CLASSD patch will make PLLA generate a clock of (49 + 637,53410/2^22) * Main Crystal Oscillator) / 2. On SAM9X60-EK there is a 24 MHz Crystal, so PLLA will generate a clock of 588 MHz. In the end, this will help provide a Generic clock of 96 MHz, close to the CLASSD's DSP clock of 12.288 KHz (* 8) to playback a 48 KHz audio mono stream with S16_LE format. For different sampling frequencies, channel number or audio format, we will need different values for PLLA.

ALERT! This GIT patch will change the CPU clock to 588 MHz and Master clock to 196 MHz

Topic attachments
I Attachment Action Size Date Who Comment
Unknown file formatpatch 0001-sam9x60-Configure-fractional-PLLA-for-CLASSD.patch manage 1.2 K 2020-02-18 - 13:37 CodrinCiubotariu at91bootstrap patch to configure PLLA for audio over CLASSD
Unknown file formatpatch 0001-sam9x60-Configure-fractional-PLLA-for-I2S-audio.patch manage 1.0 K 2020-02-18 - 13:35 CodrinCiubotariu at91bootstrap patch to configure PLLA for audio over I2S
r2 - 18 Feb 2020 - 15:28:11 - CodrinCiubotariu
 
Linux & Open Source related information for AT91 Smart ARM Microcontrollers

Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.

Atmel® and others, are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. This site is powered by the TWiki collaboration platform

ARM® and others are registered trademarks or trademarks of ARM Ltd. Other terms and product names may be trademarks of others.

Ideas, requests, contributions ? Connect to LinksToCommunities page.

Syndicate this siteRSS ATOM