Fix resampling clicking as much as possible at the moment. 1) Upsampling clicked because of size inaccuracies returned by DSP. Fix by simplifying audio system to use per-channel sample count from codec to pcm buffer. 2) Downsampling affected by 1) and was often starting passed the end of the data when not enough was available to generate an output sample. Fix by clamping input range to last sample in buffer and using the last sample value in the buffer. A perfect fix will require a double buffering scheme on the resampler to sufficient data during small data transients on both ends at all times of the down ratio on input and the up ratio on output.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12218 a1c6a512-1295-4272-9138-f99709370657
diff --git a/apps/pcmbuf.h b/apps/pcmbuf.h
index a408cda..5c35ecc 100644
--- a/apps/pcmbuf.h
+++ b/apps/pcmbuf.h
@@ -63,16 +63,16 @@
size_t pcmbuf_free(void);
unsigned int pcmbuf_get_latency(void);
void pcmbuf_set_low_latency(bool state);
-void pcmbuf_write_complete(size_t length);
-void* pcmbuf_request_buffer(size_t length, size_t *realsize);
-void* pcmbuf_request_voice_buffer(size_t length, size_t *realsize, bool mix);
+void pcmbuf_write_complete(int count);
+void* pcmbuf_request_buffer(int *count);
+void* pcmbuf_request_voice_buffer(int *count, bool mix);
bool pcmbuf_is_crossfade_enabled(void);
void pcmbuf_crossfade_enable(bool on_off);
int pcmbuf_usage(void);
int pcmbuf_mix_free(void);
void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude);
-void pcmbuf_mix_voice(size_t length);
+void pcmbuf_mix_voice(int count);
int pcmbuf_used_descs(void);
int pcmbuf_descs(void);