summaryrefslogtreecommitdiff
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)
99 99
100/* 100/*
101 * This function goes directly into the DMA buffer to calculate the left and 101 * This function goes directly into the DMA buffer to calculate the left and
102 * right peak values. To avoid missing peaks it tries to look forward a full 102 * right peak values. To avoid missing peaks it tries to look forward two full
103 * refresh period (1/20 sec) although it's always possible that the entire 103 * peek periods (2/HZ sec, 100% overlap), although it's always possible that
104 * period will not be visible. To reduce CPU load it only looks at every 104 * the entire period will not be visible. To reduce CPU load it only looks at
105 * third sample, and this can be reduced even further if needed (even every 105 * every third sample, and this can be reduced even further if needed (even
106 * tenth sample would still be pretty accurate). 106 * every tenth sample would still be pretty accurate).
107 */ 107 */
108 108
109#define PEAK_SAMPLES 2205 /* 44100 sample rate / 20 Hz refresh */ 109#define PEAK_SAMPLES (44100*2/HZ) /* 44100 samples * 2 / 100 Hz tick */
110#define PEAK_STRIDE 3 /* every 3rd sample is plenty... */ 110#define PEAK_STRIDE 3 /* every 3rd sample is plenty... */
111 111
112void pcm_calculate_peaks(int *left, int *right) 112void pcm_calculate_peaks(int *left, int *right)
113{ 113{