diff options
-rw-r--r-- | apps/codecs/Tremor/asm_mcf5249.h | 4 | ||||
-rw-r--r-- | apps/codecs/Tremor/vorbisfile.c | 1 | ||||
-rw-r--r-- | apps/codecs/mpa.c | 6 | ||||
-rw-r--r-- | firmware/export/system.h | 4 | ||||
-rw-r--r-- | firmware/pcm_playback.c | 13 |
5 files changed, 10 insertions, 18 deletions
diff --git a/apps/codecs/Tremor/asm_mcf5249.h b/apps/codecs/Tremor/asm_mcf5249.h index 2dcff021a4..eb6ed759fc 100644 --- a/apps/codecs/Tremor/asm_mcf5249.h +++ b/apps/codecs/Tremor/asm_mcf5249.h | |||
@@ -29,10 +29,6 @@ | |||
29 | 29 | ||
30 | #define MB() | 30 | #define MB() |
31 | 31 | ||
32 | static inline void mcf5249_init_mac(void) { | ||
33 | asm volatile ("move.l #0x20, %macsr;"); /* frac, truncate, no saturation */ | ||
34 | } | ||
35 | |||
36 | static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { | 32 | static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { |
37 | 33 | ||
38 | asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply & shift */ | 34 | asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply & shift */ |
diff --git a/apps/codecs/Tremor/vorbisfile.c b/apps/codecs/Tremor/vorbisfile.c index 0d8c04ab91..92f42a313b 100644 --- a/apps/codecs/Tremor/vorbisfile.c +++ b/apps/codecs/Tremor/vorbisfile.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <errno.h> | 21 | #include <errno.h> |
22 | #include <string.h> | 22 | #include <string.h> |
23 | #include <math.h> | 23 | #include <math.h> |
24 | #include "system.h" | ||
24 | 25 | ||
25 | #include "ivorbiscodec.h" | 26 | #include "ivorbiscodec.h" |
26 | #include "ivorbisfile.h" | 27 | #include "ivorbisfile.h" |
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c index fb478222a4..8cfd6eff1c 100644 --- a/apps/codecs/mpa.c +++ b/apps/codecs/mpa.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "playback.h" | 24 | #include "playback.h" |
25 | #include "dsp.h" | 25 | #include "dsp.h" |
26 | #include "lib/codeclib.h" | 26 | #include "lib/codeclib.h" |
27 | #include "system.h" | ||
27 | 28 | ||
28 | struct mad_stream Stream IDATA_ATTR; | 29 | struct mad_stream Stream IDATA_ATTR; |
29 | struct mad_frame Frame IDATA_ATTR; | 30 | struct mad_frame Frame IDATA_ATTR; |
@@ -92,7 +93,10 @@ enum codec_status codec_start(struct codec_api* api) | |||
92 | ci->memset(&Frame, 0, sizeof(struct mad_frame)); | 93 | ci->memset(&Frame, 0, sizeof(struct mad_frame)); |
93 | ci->memset(&Synth, 0, sizeof(struct mad_synth)); | 94 | ci->memset(&Synth, 0, sizeof(struct mad_synth)); |
94 | ci->memset(&Timer, 0, sizeof(mad_timer_t)); | 95 | ci->memset(&Timer, 0, sizeof(mad_timer_t)); |
95 | 96 | ||
97 | #if defined(CPU_COLDFIRE) && !defined(SIMULATOR) | ||
98 | mcf5249_init_mac(); | ||
99 | #endif | ||
96 | mad_stream_init(&Stream); | 100 | mad_stream_init(&Stream); |
97 | mad_frame_init(&Frame); | 101 | mad_frame_init(&Frame); |
98 | mad_synth_init(&Synth); | 102 | mad_synth_init(&Synth); |
diff --git a/firmware/export/system.h b/firmware/export/system.h index 39663f1087..712e87d3ef 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h | |||
@@ -125,6 +125,10 @@ enum { | |||
125 | : /* %0 */ "d"(mask), \ | 125 | : /* %0 */ "d"(mask), \ |
126 | /* %1 */ "a"(address)) | 126 | /* %1 */ "a"(address)) |
127 | 127 | ||
128 | static inline void mcf5249_init_mac(void) { | ||
129 | asm volatile ("move.l #0x20, %macsr;"); /* frac, truncate, no saturation */ | ||
130 | } | ||
131 | |||
128 | #endif | 132 | #endif |
129 | 133 | ||
130 | #ifndef SIMULATOR | 134 | #ifndef SIMULATOR |
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c index ce59faaf56..17350edfb5 100644 --- a/firmware/pcm_playback.c +++ b/firmware/pcm_playback.c | |||
@@ -184,19 +184,6 @@ void pcm_play_data(void (*get_more)(unsigned char** start, long* size)) | |||
184 | 184 | ||
185 | callback_for_more = get_more; | 185 | callback_for_more = get_more; |
186 | 186 | ||
187 | /** FIXME: This is a temporary fix to prevent playback glitches when | ||
188 | * playing the first file. We will just drop the first frame to prevent | ||
189 | * that problem from occurring. | ||
190 | * Some debug data: | ||
191 | * - This problem will occur only when the first file. | ||
192 | * - First frame will be totally corrupt and the song will begin | ||
193 | * from the next frame. But at the next time (when the bug has | ||
194 | * already happened), the song will start from first frame. | ||
195 | * - Dropping some frames directly from (mpa) codec will also | ||
196 | * prevent the problem from happening. So it's unlikely you can | ||
197 | * find the explanation for this bug from this file. | ||
198 | */ | ||
199 | get_more((unsigned char **)&start, (long *)&size); // REMOVE THIS TO TEST | ||
200 | get_more((unsigned char **)&start, (long *)&size); | 187 | get_more((unsigned char **)&start, (long *)&size); |
201 | get_more(&next_start, &next_size); | 188 | get_more(&next_start, &next_size); |
202 | dma_start(start, size); | 189 | dma_start(start, size); |