diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/pcm_playback.c | 14 |
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 | ||
112 | void pcm_calculate_peaks(int *left, int *right) | 112 | void pcm_calculate_peaks(int *left, int *right) |
113 | { | 113 | { |