Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#8162 - Core speex decoder and voice for SWCODEC targets

Attached to Project: Rockbox
Opened by Michael Sevakis (MikeS) - Thursday, 15 November 2007, 21:48 GMT+2
Last edited by Michael Sevakis (MikeS) - Sunday, 18 November 2007, 18:21 GMT+2
Task Type Patches
Category User Interface
Status Closed
Assigned To No-one
Player Type SW-codec
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This changes the suppoted voice format from MPEG audio to Speex and moves the decoder to the core which simplifies the playback engine greatly and factors voice away from playback.c.
   core-speex-voice-codec.diff (93.8 KiB)
 tools/voice.pl                                 |   12 
 tools/configure                                |   72 --
 apps/codecs.c                                  |    4 
 apps/codecs.h                                  |    4 
 apps/pcmbuf.c                                  |  124 ++-
 apps/pcmbuf.h                                  |    6 
 apps/dsp.c                                     |  290 ++++----
 apps/talk.c                                    |    2 
 apps/dsp.h                                     |   26 
 apps/playback.c                                |  854 +------------------------
 apps/voice_thread.c                            |  402 +++++++++++
 apps/plugin.c                                  |    3 
 apps/voice_thread.h                            |   33 
 apps/SOURCES                                   |    1 
 apps/codecs/libspeex/bits.c                    |    4 
 apps/codecs/libspeex/exc_10_32_table.c         |    3 
 apps/codecs/libspeex/exc_20_32_table.c         |    3 
 apps/codecs/libspeex/exc_8_128_table.c         |    3 
 apps/codecs/libspeex/exc_5_256_table.c         |    3 
 apps/codecs/libspeex/exc_5_64_table.c          |    3 
 apps/codecs/libspeex/exc_10_16_table.c         |    3 
 firmware/export/audio.h                        |   14 
 firmware/SOURCES                               |    3 
 firmware/target/arm/memswap128-arm.S           |   44 -
 firmware/target/coldfire/memswap128-coldfire.S |   50 -
 firmware/common/memswap128.c                   |   44 -
 26 files changed, 772 insertions(+), 1238 deletions(-)

This task depends upon

Closed by  Michael Sevakis (MikeS)
Sunday, 18 November 2007, 18:21 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  New format is now used as of r15668
Comment by Michael Sevakis (MikeS) - Thursday, 15 November 2007, 22:24 GMT+2
Oops...forgot to check for decoding errors. Bump the voice version to 4.00 as well.
   core-speex-voice-codec.diff (94.8 KiB)
 tools/voice.pl                                 |   12 
 tools/configure                                |   72 --
 tools/voicefont.c                              |    2 
 apps/codecs.c                                  |    4 
 apps/codecs.h                                  |    4 
 apps/pcmbuf.c                                  |  124 ++-
 apps/pcmbuf.h                                  |    6 
 apps/dsp.c                                     |  290 ++++----
 apps/dsp.h                                     |   26 
 apps/talk.c                                    |    2 
 apps/talk.h                                    |    2 
 apps/playback.c                                |  854 +------------------------
 apps/voice_thread.c                            |  406 +++++++++++
 apps/plugin.c                                  |    3 
 apps/voice_thread.h                            |   33 
 apps/SOURCES                                   |    1 
 apps/codecs/libspeex/bits.c                    |    4 
 apps/codecs/libspeex/exc_10_32_table.c         |    3 
 apps/codecs/libspeex/exc_20_32_table.c         |    3 
 apps/codecs/libspeex/exc_8_128_table.c         |    3 
 apps/codecs/libspeex/exc_5_256_table.c         |    3 
 apps/codecs/libspeex/exc_5_64_table.c          |    3 
 apps/codecs/libspeex/exc_10_16_table.c         |    3 
 firmware/export/audio.h                        |   14 
 firmware/SOURCES                               |    3 
 firmware/target/arm/memswap128-arm.S           |   44 -
 firmware/target/coldfire/memswap128-coldfire.S |   50 -
 firmware/common/memswap128.c                   |   44 -
 28 files changed, 778 insertions(+), 1240 deletions(-)

Comment by Linus Nielsen Feltzing (linusnielsen) - Friday, 16 November 2007, 08:30 GMT+2
I love it!!!!!!

However, there seems to be lots of unrelated changes as well, like renaming of types etc. Were these really necessary for the voice to work?

Anyway, I think this should be committed ASAP, provided that this doesn't in any way affect the Archos players, that still need voice files in MP3 format.
Comment by Michael Sevakis (MikeS) - Friday, 16 November 2007, 14:04 GMT+2
They were nescessary to get me to pay attention to details in pcmbuf.c (where mostly they are) so I could finish this :). Clipping changes in there were to improve the mixing speeds a bit. Can be cleaned. I'm having trouble with building the encoder (can't find headers) or I would have put Thom's extra changes to post a complete solution for testing.

No effect on Archos. That's the idea.

BTW, what about setting up the daily voice as speex? Shouldn't that be ready to go along with a full tools patch so this gets done in one felled swoop?
Comment by Michael Sevakis (MikeS) - Friday, 16 November 2007, 14:26 GMT+2
hmmm...perhaps I should leave the type conversions since the better clipping routine for mixing requires int32_t and int16_t explicitly and it's nicer to used the explicitely sized types for this?
Comment by Linus Nielsen Feltzing (linusnielsen) - Friday, 16 November 2007, 15:00 GMT+2
Keep the type conversions, they are for the better anyway.
Comment by Michael Sevakis (MikeS) - Friday, 16 November 2007, 17:31 GMT+2
Third version. Resync. Minor revisions and comments.
   core-speex-voice-codec.diff (84.3 KiB)
 apps/codecs.c                                  |    4 
 apps/codecs.h                                  |    4 
 apps/pcmbuf.c                                  |   32 
 apps/pcmbuf.h                                  |    6 
 apps/dsp.c                                     |  290 ++++----
 apps/talk.c                                    |    2 
 apps/dsp.h                                     |   26 
 apps/talk.h                                    |    2 
 apps/playback.c                                |  854 +------------------------
 apps/voice_thread.c                            |  408 +++++++++++
 apps/plugin.c                                  |    3 
 apps/voice_thread.h                            |   33 
 apps/SOURCES                                   |    1 
 apps/codecs/libspeex/bits.c                    |    6 
 apps/codecs/libspeex/exc_10_32_table.c         |    2 
 apps/codecs/libspeex/exc_20_32_table.c         |    2 
 apps/codecs/libspeex/exc_8_128_table.c         |    2 
 apps/codecs/libspeex/config-speex.h            |    6 
 apps/codecs/libspeex/exc_5_256_table.c         |    2 
 apps/codecs/libspeex/exc_5_64_table.c          |    2 
 apps/codecs/libspeex/exc_10_16_table.c         |    2 
 firmware/export/audio.h                        |   14 
 firmware/SOURCES                               |    3 
 firmware/target/arm/memswap128-arm.S           |   44 -
 firmware/target/coldfire/memswap128-coldfire.S |   50 -
 firmware/common/memswap128.c                   |   44 -
 26 files changed, 701 insertions(+), 1143 deletions(-)

Comment by Michael Sevakis (MikeS) - Saturday, 17 November 2007, 03:38 GMT+2
Fourth version. Some mp3-specific code was still being called that prevented speex .talk clips from loading successfully.

EDIT: The needed version change in voicefont.c was also missing thanks to an "svn revert" on /tools. Included here.
   core-speex-voice-codec.diff (88.3 KiB)
 tools/voicefont.c                              |    2 
 apps/codecs.c                                  |    4 
 apps/codecs.h                                  |    4 
 apps/pcmbuf.c                                  |   32 
 apps/pcmbuf.h                                  |    6 
 apps/dsp.c                                     |  290 ++++----
 apps/talk.c                                    |   10 
 apps/dsp.h                                     |   26 
 apps/talk.h                                    |    2 
 apps/playback.c                                |  854 +------------------------
 apps/voice_thread.c                            |  411 ++++++++++++
 apps/plugin.c                                  |    9 
 apps/voice_thread.h                            |   33 
 apps/SOURCES                                   |    1 
 apps/plugin.h                                  |    8 
 apps/codecs/libspeex/bits.c                    |    6 
 apps/codecs/libspeex/exc_10_32_table.c         |    2 
 apps/codecs/libspeex/exc_20_32_table.c         |    2 
 apps/codecs/libspeex/exc_8_128_table.c         |    2 
 apps/codecs/libspeex/config-speex.h            |    6 
 apps/codecs/libspeex/exc_5_256_table.c         |    2 
 apps/codecs/libspeex/exc_5_64_table.c          |    2 
 apps/codecs/libspeex/exc_10_16_table.c         |    2 
 firmware/export/audio.h                        |   14 
 firmware/export/config.h                       |    2 
 firmware/SOURCES                               |    3 
 firmware/target/arm/memswap128-arm.S           |   44 -
 firmware/target/coldfire/memswap128-coldfire.S |   50 -
 firmware/common/memswap128.c                   |   44 -
 29 files changed, 720 insertions(+), 1153 deletions(-)

Comment by Stephane Doyon (sdoyon) - Saturday, 17 November 2007, 03:45 GMT+2
Tried on my x5 and had no voice. Do I need particular tools, other
than rbspeexenc?

Would it be possible to summarize what it is rbspeexenc does differently
vs the standard speexenc?

There probably needs to be a special case when the voice is generated
with espeak: it's 22.05KHz, and speexenc appears to prefer it resampled
to 16KHz.
Comment by harry tu (bookshare) - Saturday, 17 November 2007, 06:33 GMT+2
Can I still use my mp3 talk clips?
Comment by Nils Wallménius (nls) - Saturday, 17 November 2007, 10:52 GMT+2
harry tu, no.
Comment by Michael Sevakis (MikeS) - Saturday, 17 November 2007, 11:38 GMT+2
Stephane,

The voice files I was using were made with eSpeak + rbspeexenc. rbspeexenc outputs raw speex data with no ogg or other container and is required for encoding. It will also be able to resample it to the proper rate (but won't convert stereo to mono). I recorded some talk clips at 44kHz, encoded them with it and had no trouble with them playing in the file browser.

By the way, which patch did you use? I've tested on four of my targets and, well, it's the same code for all of them. Basically a sure shot to it have work if everything was encoded properly.

Loading...