Right, a lot of development, some unclear points in terms of direction
I strayed a bit from my proposed schedule (in a good way!) and went on to
investigate a few aspects that were *really* bothering me.
Before that, a brief summary: flite compiles as a plugin, both on target and
in sim, with increased PLUGIN_RAM (naturally, the binary is about 7 MB - 4
for the voice, 3 for tlsf). With the floating-point math intact (this sounds
worse than it is - much of the actual synthesis is actually fixed-point,
only one or two steps are floating-point and those are quite quick), I get
~2-3x realtime on target.
Now, that's all very good if it weren't for my detour deep into the flite
1) allocation consolidation - I was trying to track where the allocations
come from and if I could remove the need for malloc. Short answer - no. Long
answer - flite works on an utterance-per-utterance basis in the sense that
it looks up values for the current phoneme and builds a tree out of them.
Only then does it actually synthesize anything (this is a simplification but
not overly so). This is bad because a) the longer the text, the more memory
required, b) malloc()s are sprinkled all over the place and you can't really
predict the final size. Even if you could predict the size, there are about
~220 allocations in the code, split among all submodules. The best solution
would be to synthesize on the go and remove unneeded data at the same time -
however, that would probably break clustergen voices (which are excluded
from the build at the moment). I *think* I know how to do it but I'm not
really confident in my understanding of the engine.
2) floating-point - this is one is a bit better than 1). The use of floats
is disputable in a few places where floats and doubles basically store
integers but that's another story. I've started converting some parts that
don't need floats at all but so far no real speed-up.
3) freezes - this one is rather bizarre - on target, the whole player
freezes when I try to synthesize long text. I think I have figured it out
but for some reason the fix broke another part of the engine. Hopefully,
I'll figure it out today.
Really, the only real issue is malloc (and I realise it's quite the issue).
I'll see if I can attack the problem in a different way.
Received on 2010-05-24