From 6b807b2d248baee699eb2b5e43344cd278a7f01d Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Sat, 30 Jul 2005 13:46:38 +0000 Subject: Fixed MAC initialization problem with mpa codec and removed workaround for that bug. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7260 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/Tremor/asm_mcf5249.h | 4 ---- apps/codecs/Tremor/vorbisfile.c | 1 + apps/codecs/mpa.c | 6 +++++- firmware/export/system.h | 4 ++++ 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 @@ #define MB() -static inline void mcf5249_init_mac(void) { - asm volatile ("move.l #0x20, %macsr;"); /* frac, truncate, no saturation */ -} - static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { 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 @@ #include #include #include +#include "system.h" #include "ivorbiscodec.h" #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 @@ #include "playback.h" #include "dsp.h" #include "lib/codeclib.h" +#include "system.h" struct mad_stream Stream IDATA_ATTR; struct mad_frame Frame IDATA_ATTR; @@ -92,7 +93,10 @@ enum codec_status codec_start(struct codec_api* api) ci->memset(&Frame, 0, sizeof(struct mad_frame)); ci->memset(&Synth, 0, sizeof(struct mad_synth)); ci->memset(&Timer, 0, sizeof(mad_timer_t)); - + +#if defined(CPU_COLDFIRE) && !defined(SIMULATOR) + mcf5249_init_mac(); +#endif mad_stream_init(&Stream); mad_frame_init(&Frame); 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 { : /* %0 */ "d"(mask), \ /* %1 */ "a"(address)) +static inline void mcf5249_init_mac(void) { + asm volatile ("move.l #0x20, %macsr;"); /* frac, truncate, no saturation */ +} + #endif #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)) callback_for_more = get_more; - /** FIXME: This is a temporary fix to prevent playback glitches when - * playing the first file. We will just drop the first frame to prevent - * that problem from occurring. - * Some debug data: - * - This problem will occur only when the first file. - * - First frame will be totally corrupt and the song will begin - * from the next frame. But at the next time (when the bug has - * already happened), the song will start from first frame. - * - Dropping some frames directly from (mpa) codec will also - * prevent the problem from happening. So it's unlikely you can - * find the explanation for this bug from this file. - */ - get_more((unsigned char **)&start, (long *)&size); // REMOVE THIS TO TEST get_more((unsigned char **)&start, (long *)&size); get_more(&next_start, &next_size); dma_start(start, size); -- cgit v1.2.3