dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Proposal to enable PLL for AMSv2 players to increase PCM rate accuracy

Proposal to enable PLL for AMSv2 players to increase PCM rate accuracy

From: Bertrik Sikken <>
Date: Sat, 14 Aug 2010 21:37:50 +0200

Hi all,

The AMSv2 players currently play back audio with quite a big pitch
and speed error. They play about 1.1% too "flat" and slow. This is
big enough for quite a few people to notice it, see for example the
anythingbutipod and head-fi forums.

This playback error is the result of how the playback PCM clocks are
currently derived: they are derived from the main CPU clock at 240 MHz
as follows
Fpcm = Fcpu / (128 * divider), where we can control the divider.
It turns out that the divider would need to be 42.52 for 44100 Hz
playback. We round this up to 43, giving a rounding error in PCM
frequency of 1.1%.

There are several solutions for this:
1) change the main clock to a different frequency like 248 MHz
   (just like on AMSv1) this would give an error of just 0.15%.
   We tried this but it gave problems with other peripherals no
   longer working reliably (micro-SD).
2) use the second PLL (PLL B) available in the SoC (which is
   currently unused) to generate a different frequency which gives
   a more accurate playback rate.

I propose to implement solution 2, see also

By enabling this PLL and setting it to 192 MHz, we can achieve
a much lower error, which is just 0.04%. The last time the
enabling of this PLL came up (IRC discussion and when I committed
a change to enable the PLL more easily), there was quite a bit of
opposition against this, with the main concern being increased
power consumption / decreased runtime.

The graph in this post gives a nice comparison of the improvement:

A couple of battery benchmarks have been done:
1) dfkt (Martin Sägmüller) found a 7 minute *increase* in runtime
   (from 15h33m to 15h40m) on his clip+
2) on one clip+ benchmark, I found a 1 minute decrease in runtime
   (from 17h21m to 17h20m)
3) on another clip+ benchmark, I found a 4 minute decrease in runtime
   (from 17h15m to 17h11m)
My conclusion is that the effect on runtime is negligible.
Also keep in mind that with the proposed change, playback is no longer
too slow, so we actually play more audio in the same time.

I think I have hereby addressed the previous concerns about runtime
decrease for AMSv2 players and would like to make the change in a
week or so unless someone objects.

Kind regards,

P.S. This discussion can also be done for the AMSv1 targets, however
they suffer only 0.15% pitch error and an initial measurement
does seem to show a significant effect on runtime (about 2.6%).
Received on 2010-08-14

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy