diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2007-11-18 17:12:19 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2007-11-18 17:12:19 +0000 |
commit | 99617d71bad0e5870a38e37c8654e46868e2a5ba (patch) | |
tree | e0ecc3b73e8e167c7f5bf00a6c88b83c1119aea3 /firmware | |
parent | 75432619e8be2f22f86ed0869d46bf7245c7c14d (diff) |
Make speex the new voice format for SWCODEC targets (non-Archos). Remove codec swapping and build speex voice decoding directly into the core binary.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15668 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/SOURCES | 3 | ||||
-rw-r--r-- | firmware/common/memswap128.c | 44 | ||||
-rw-r--r-- | firmware/export/audio.h | 14 | ||||
-rw-r--r-- | firmware/export/config.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/memswap128-arm.S | 44 | ||||
-rw-r--r-- | firmware/target/coldfire/memswap128-coldfire.S | 50 |
6 files changed, 11 insertions, 146 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 9f3b490e5e..59179961ee 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -282,7 +282,6 @@ target/coldfire/crt0.S target/coldfire/memcpy-coldfire.S target/coldfire/memmove-coldfire.S target/coldfire/memset-coldfire.S -target/coldfire/memswap128-coldfire.S target/coldfire/strlen-coldfire.S #if defined(HAVE_LCD_COLOR) \ || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED) @@ -305,7 +304,6 @@ common/strlen.c #ifndef SIMULATOR target/arm/memset-arm.S target/arm/memset16-arm.S -target/arm/memswap128-arm.S #if CONFIG_I2C == I2C_PP5024 || CONFIG_I2C == I2C_PP5020 || CONFIG_I2C == I2C_PP5002 target/arm/i2c-pp.c #elif CONFIG_I2C == I2C_PNX0101 @@ -350,7 +348,6 @@ common/memcpy.c common/memmove.c common/memset.c common/memset16.c -common/memswap128.c common/strlen.c #ifndef SIMULATOR crt0.S diff --git a/firmware/common/memswap128.c b/firmware/common/memswap128.c deleted file mode 100644 index af1fe157b6..0000000000 --- a/firmware/common/memswap128.c +++ /dev/null @@ -1,44 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2007 by Michael Sevakis - * - * All files in this archive are subject to the GNU General Public License. - * See the file COPYING in the source tree root for full license agreement. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#include "config.h" -#include <string.h> -#include <inttypes.h> - -void memswap128(void *a, void *b, size_t len) -{ - for (len >>= 4; len > 0; len--, a += 16, b += 16) - { - int32_t a0 = *((int32_t *)a + 0); - int32_t a1 = *((int32_t *)a + 1); - int32_t a2 = *((int32_t *)a + 2); - int32_t a3 = *((int32_t *)a + 3); - int32_t b0 = *((int32_t *)b + 0); - int32_t b1 = *((int32_t *)b + 1); - int32_t b2 = *((int32_t *)b + 2); - int32_t b3 = *((int32_t *)b + 3); - *((int32_t *)b + 0) = a0; - *((int32_t *)b + 1) = a1; - *((int32_t *)b + 2) = a2; - *((int32_t *)b + 3) = a3; - *((int32_t *)a + 0) = b0; - *((int32_t *)a + 1) = b1; - *((int32_t *)a + 2) = b2; - *((int32_t *)a + 3) = b3; - } -} diff --git a/firmware/export/audio.h b/firmware/export/audio.h index 468856a87a..061b2230f4 100644 --- a/firmware/export/audio.h +++ b/firmware/export/audio.h @@ -109,10 +109,16 @@ void audio_beep(int duration); void audio_init_playback(void); /* Required call when audio buffer is require for some other purpose */ unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size); -#ifdef IRAM_STEAL -/* Required call when codec IRAM is needed for some other purpose */ -void audio_iram_steal(void); -#endif +/* Stops audio from serving playback */ +void audio_hard_stop(void); +/* Retores the audio buffer to handle the requested playback */ +enum +{ + AUDIO_WANT_PLAYBACK = 0, + AUDIO_WANT_VOICE, +}; + +bool audio_restore_playback(int type); /* channel modes */ enum rec_channel_modes diff --git a/firmware/export/config.h b/firmware/export/config.h index 48dc3f5693..6a2c02cffd 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -383,7 +383,7 @@ #define IBSS_ATTR __attribute__ ((section(".ibss"))) #define USE_IRAM #if CONFIG_CPU != SH7034 -#define IRAM_STEAL +#define PLUGIN_USE_IRAM #endif #if defined(CPU_ARM) /* GCC quirk workaround: arm-elf-gcc treats static functions as short_call diff --git a/firmware/target/arm/memswap128-arm.S b/firmware/target/arm/memswap128-arm.S deleted file mode 100644 index f672def1ec..0000000000 --- a/firmware/target/arm/memswap128-arm.S +++ /dev/null @@ -1,44 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2007 by Michael Sevakis - * - * All files in this archive are subject to the GNU General Public License. - * See the file COPYING in the source tree root for full license agreement. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -/**************************************************************************** - * void memswap128(void *buf1, void *buf2, size_t len) - */ - .section .icode, "ax", %progbits - .align 2 - .global memswap128 - .type memswap128, %function -memswap128: - @ r0 = buf1 - @ r1 = buf2 - @ r2 = len - movs r2, r2, lsr #4 @ bytes => lines, len == 0? - moveq pc, lr @ not at least a line? leave - stmdb sp!, { r4-r10, lr } @ save registers and return address -.loop: @ - ldmia r0, { r3-r6 } @ read four longwords from buf1 - ldmia r1, { r7-r10 } @ read four longwords from buf2 - stmia r0!, { r7-r10 } @ write buf2 data to buf1, buf1 += 16 - stmia r1!, { r3-r6 } @ write buf1 data to buf2, buf2 += 16 - subs r2, r2, #1 @ len -= 1, len > 0 ? - bhi .loop @ yes? keep exchanging - ldmia sp!, { r4-r10, pc } @ restore registers and return -.end: - .size memswap128, .end-memswap128 - diff --git a/firmware/target/coldfire/memswap128-coldfire.S b/firmware/target/coldfire/memswap128-coldfire.S deleted file mode 100644 index 5de628dabd..0000000000 --- a/firmware/target/coldfire/memswap128-coldfire.S +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2007 by Michael Sevakis
- *
- * All files in this archive are subject to the GNU General Public License.
- * See the file COPYING in the source tree root for full license agreement.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * void memswap128(void *buf1, void *buf2, size_t len)
- */
- .section .icode, "ax", @progbits
- .align 2
- .global memswap128
- .type memswap128, @function
-memswap128:
- lea.l -28(%sp), %sp | save registers
- movem.l %d2-%d7/%a2, (%sp) |
- movem.l 32(%sp), %a0-%a2 | %a0 = buf1
- | %a1 = buf2
- | %a2 = len
- lea.l -15(%a0, %a2.l), %a2 | %a2 = end address - 15
- cmp.l %a0, %a2 | end address <= buf1?
- bls.b .no_lines | not at least a line? leave
-.loop: |
- movem.l (%a0), %d0-%d3 | read four longwords from buf1
- movem.l (%a1), %d4-%d7 | read four longwords from buf2
- movem.l %d4-%d7, (%a0) | write buf2 data to buf1
- movem.l %d0-%d3, (%a1) | write buf1 data to buf2
- lea.l 16(%a0), %a0 | buf1 += 16
- lea.l 16(%a1), %a1 | buf2 += 16
- cmp.l %a0, %a2 | %a0 < %d0?
- bhi.b .loop | yes? keep exchanging
-.no_lines: |
- movem.l (%sp), %d2-%d7/%a2 | restore registers
- lea.l 28(%sp), %sp |
- rts |
-.end:
- .size memswap128, .end-memswap128
|