summaryrefslogtreecommitdiff
path: root/firmware/target/arm/s3c2440/gigabeat-fx
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-06-29 06:37:04 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-06-29 06:37:04 +0000
commita2b6703a369f6cdbfec1f150c408dadc877631fb (patch)
tree3145a8c1372c44711d38feefeba39c7d4098f139 /firmware/target/arm/s3c2440/gigabeat-fx
parent8411614b8a068a4f274c3841aa55aab1df1bc246 (diff)
downloadrockbox-a2b6703a369f6cdbfec1f150c408dadc877631fb.tar.gz
rockbox-a2b6703a369f6cdbfec1f150c408dadc877631fb.zip
Commit FS#12150 - Fully-functional audio mixer - and finally whip old limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/s3c2440/gigabeat-fx')
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c3
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
index c1c9017fbb..33194ae5d9 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
@@ -25,6 +25,7 @@
25#include "audio.h" 25#include "audio.h"
26#include "sound.h" 26#include "sound.h"
27#include "file.h" 27#include "file.h"
28#include "pcm-internal.h"
28 29
29/* PCM interrupt routine lockout */ 30/* PCM interrupt routine lockout */
30static struct 31static struct
@@ -235,6 +236,8 @@ void fiq_handler(void)
235 236
236 /* Re-Activate the channel */ 237 /* Re-Activate the channel */
237 DMASKTRIG2 = 0x2; 238 DMASKTRIG2 = 0x2;
239
240 pcm_play_dma_started_callback();
238} 241}
239 242
240size_t pcm_get_bytes_waiting(void) 243size_t pcm_get_bytes_waiting(void)
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c
index 01b177da6c..eea4c58e4b 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c
@@ -99,14 +99,15 @@ void TIMER3(void)
99 INTPND = TIMER3_MASK; 99 INTPND = TIMER3_MASK;
100} 100}
101 101
102void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude) 102void beep_play(unsigned int frequency, unsigned int duration,
103 unsigned int amplitude)
103{ 104{
104 #define TIMER3_TICK_SEC (TIMER_FREQ / TIMER234_PRESCALE) 105 #define TIMER3_TICK_SEC (TIMER_FREQ / TIMER234_PRESCALE)
105 106
106 unsigned long tcnt, tcmp; 107 unsigned long tcnt, tcmp;
107 int oldstatus; 108 int oldstatus;
108 109
109 if (amplitude <= 0) 110 if (frequency == 0 || duration == 0 || amplitude == 0)
110 { 111 {
111 beep_stop(); /* won't hear it anyway */ 112 beep_stop(); /* won't hear it anyway */
112 return; 113 return;