summaryrefslogtreecommitdiff
path: root/firmware/pcm.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-08-23 14:18:08 -0400
committerMichael Sevakis <jethead71@rockbox.org>2014-03-08 08:04:41 +0100
commit61d0583384b81de28498544ea3ec2e5c8eba42be (patch)
tree0901394a414674d70c82ee56cdfece1c7cce682a /firmware/pcm.c
parent62b10e383cc7439508e57751dbcdf0d8a617cf1a (diff)
downloadrockbox-61d0583384b81de28498544ea3ec2e5c8eba42be.tar.gz
rockbox-61d0583384b81de28498544ea3ec2e5c8eba42be.zip
Greatly reduce volume-change zipper artifacts with SW volume.
Uses a cosine factor to smoothly shift the PCM level from the old level to the new one over the length of a frame. Implements indirect calls to PCM scaling function instead of testing conditions on every callback, cleanly assigning a different call to do the volume transition. The volume change call then assigns the final scaling function. Change-Id: If1004b92a91c5ca766dd0e4014ec274636e8ed26 Reviewed-on: http://gerrit.rockbox.org/763 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'firmware/pcm.c')
-rw-r--r--firmware/pcm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/pcm.c b/firmware/pcm.c
index 60ccdbd2fc..640bb7830f 100644
--- a/firmware/pcm.c
+++ b/firmware/pcm.c
@@ -111,6 +111,10 @@ void pcm_play_stop_int(void);
111 ** pcm_sw_volume.c **/ 111 ** pcm_sw_volume.c **/
112static inline void pcm_play_dma_start_int(const void *addr, size_t size) 112static inline void pcm_play_dma_start_int(const void *addr, size_t size)
113{ 113{
114#ifdef HAVE_SW_VOLUME_CONTROL
115 /* Smoothed transition might not have happened so sync now */
116 pcm_sync_pcm_factors();
117#endif
114 pcm_play_dma_start(addr, size); 118 pcm_play_dma_start(addr, size);
115} 119}
116 120