From e86ece4d341e674c0ca32caa506bae9c5f2fc860 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Mon, 16 Feb 2009 18:45:43 +0000 Subject: Fix too-soon frequency unboost when pcm buffer crosses watermark from the low side. It's supposed to stay boosted until full again. Also align the static beep buffer to 4 bytes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20017 a1c6a512-1295-4272-9138-f99709370657 --- apps/pcmbuf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index 6e22348..7d2c579 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c @@ -285,20 +285,19 @@ static void pcmbuf_under_watermark(bool under) { if (under) { + /* Fill audio buffer by boosting cpu */ + trigger_cpu_boost(); #ifdef HAVE_PRIORITY_SCHEDULING /* If buffer is critically low, override UI priority, else set back to the original priority. */ boost_codec_thread(LOW_DATA(2) && pcm_is_playing()); #endif - /* Fill audio buffer by boosting cpu */ - trigger_cpu_boost(); } else { #ifdef HAVE_PRIORITY_SCHEDULING boost_codec_thread(false); #endif - cancel_cpu_boost(); } } @@ -1016,7 +1015,7 @@ void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude) } else if (nsamples <= MINIBUF_SAMPLES) { - static int16_t minibuf[MINIBUF_SAMPLES*2]; + static int16_t minibuf[MINIBUF_SAMPLES*2] __attribute__((aligned(4))); /* Use mini buffer */ bufstart = minibuf; bufend = SKIPBYTES(bufstart, MINIBUF_SIZE); -- cgit v1.1