summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-08-29 20:07:17 +0000
committerJens Arnold <amiconn@rockbox.org>2005-08-29 20:07:17 +0000
commit99a0598c284471342fcda1fdcba90d4b666bfbb3 (patch)
tree83cc502095e87277de770456498d2de6cf8f473b /firmware
parent89a8ca4408c3ea34464898b0ce52a0d8351fa323 (diff)
downloadrockbox-99a0598c284471342fcda1fdcba90d4b666bfbb3.tar.gz
rockbox-99a0598c284471342fcda1fdcba90d4b666bfbb3.zip
Major peakmeter rework: * Changed set/get functions for dbfs mode to bool type. * Removed performance setting, leaving (slightly adapted) high performance mode only. * Refresh rate is always 20 Hz now. * Readout doesn't do an extra (hidden) peek, should allow for slightly better clip detection. * Brought back high performance peakmeter for recording. Peakmeter stops hogging the CPU when the disk is spinning; this is enough to avoid the performance problem when saving data. * Optimisations, code cleanup and code policeing. * (iriver) Reduced CPU load of peakmeter by not calculating excessive overlaps. ** Bumped config block version, so save your settings before upgrading.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7415 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/pcm_playback.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c
index f75ec69857..5597f69bdb 100644
--- a/firmware/pcm_playback.c
+++ b/firmware/pcm_playback.c
@@ -99,15 +99,15 @@ static void dma_stop(void)
/*
* This function goes directly into the DMA buffer to calculate the left and
- * right peak values. To avoid missing peaks it tries to look forward a full
- * refresh period (1/20 sec) although it's always possible that the entire
- * period will not be visible. To reduce CPU load it only looks at every
- * third sample, and this can be reduced even further if needed (even every
- * tenth sample would still be pretty accurate).
+ * right peak values. To avoid missing peaks it tries to look forward two full
+ * peek periods (2/HZ sec, 100% overlap), although it's always possible that
+ * the entire period will not be visible. To reduce CPU load it only looks at
+ * every third sample, and this can be reduced even further if needed (even
+ * every tenth sample would still be pretty accurate).
*/
-#define PEAK_SAMPLES 2205 /* 44100 sample rate / 20 Hz refresh */
-#define PEAK_STRIDE 3 /* every 3rd sample is plenty... */
+#define PEAK_SAMPLES (44100*2/HZ) /* 44100 samples * 2 / 100 Hz tick */
+#define PEAK_STRIDE 3 /* every 3rd sample is plenty... */
void pcm_calculate_peaks(int *left, int *right)
{