diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2013-04-23 03:20:49 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-04-27 06:59:27 +0200 |
commit | 08199cd6cb1e2c600eb16ce077cc308fee82de33 (patch) | |
tree | 5c33c39092a5f5aa65f6ac104f3fee54c5041519 /firmware/pcm.c | |
parent | 370ed6de7c7596b2a1f6a2f99c8070bd179b4abd (diff) |
Provide high resolution volume and prescaler to hosted targets.
HAVE_SW_VOLUME_CONTROL is required and at this time only affects the
SDL targets using pcm-sdl.c.
Enables balance control in SDL targets, unless mono volume is in use.
Compiles software volume control as unbuffered when
PCM_SW_VOLUME_UNBUFFERED is defined. This avoids the overhead and
extra latency introduced by the double buffer when it is not needed.
Use this config when the target's PCM driver is buffered and sufficient
latency exists to perform safely the volume scaling.
Simulated targets that are double-buffered when made as native targets
remain so in the sim in order to run the same code.
Change-Id: Ifa77d2d3ae7376c65afecdfc785a084478cb5ffb
Reviewed-on: http://gerrit.rockbox.org/457
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'firmware/pcm.c')
-rw-r--r-- | firmware/pcm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/pcm.c b/firmware/pcm.c index 6bf0e12c8d..e095ab2cea 100644 --- a/firmware/pcm.c +++ b/firmware/pcm.c @@ -106,8 +106,9 @@ static void pcm_play_data_start_int(const void *addr, size_t size); static void pcm_play_pause_int(bool play); void pcm_play_stop_int(void); -#ifndef HAVE_SW_VOLUME_CONTROL -/** Standard hw volume control functions - otherwise, see pcm_sw_volume.c **/ +#if !defined(HAVE_SW_VOLUME_CONTROL) || defined(PCM_SW_VOLUME_UNBUFFERED) +/** Standard hw volume/unbuffered control functions - otherwise, see + ** pcm_sw_volume.c **/ static inline void pcm_play_dma_start_int(const void *addr, size_t size) { pcm_play_dma_start(addr, size); @@ -150,7 +151,7 @@ bool pcm_play_dma_complete_callback(enum pcm_dma_status status, pcm_play_stop_int(); return false; } -#endif /* ndef HAVE_SW_VOLUME_CONTROL */ +#endif /* !HAVE_SW_VOLUME_CONTROL || PCM_SW_VOLUME_UNBUFFERED */ static void pcm_play_data_start_int(const void *addr, size_t size) { |