Merge branch 'master' into lab-general
Update manual to match 1b53f448.

Change-Id: Ide61bc37462b0aeb938f17dbcfd9e96bcd9e86d1
rk27utils: improve command line parsing, allow arbitrary USB ids in rkusbtool

Change-Id: I884fe29c10dede7823721c2cac5dc627d6ab25c6
Reviewed-on: http://gerrit.rockbox.org/731
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
sim/sdlapp: Do not quit immediately on panicf, but wait for quit.

Change-Id: I2f0b4b560f00a43ad4b240911e4c30a162deb6e3
hosted: Substract more than 256K from total memory pool.

These 256K are intended to account for the binary size which reduces the total
available RAM on native targets. 256K is really outdated though, 768K should be
more accurate (for the majority of targets).

Change-Id: Iab3ee51d42ae15b1b7efb8588881579cf1948ae7
buflib: Abstract panicf() into buflib_panic().

Change-Id: I4968a9bc290e10e30a77c36c19f694e286e7ef22
buflib: Check the validity of of handles passed to buflib_get_data() in DEBUG builds.

Change-Id: Ic274bfb4a8e1a1a10f9a54186b9173dbc0faa4c8
buflib: Properly support allocations without any name, to avoid wasting space
in micro-allocation scenarios.

Change-Id: I97a065bcfba8e0fda9b1670445e839e267c769c8
buflib: Add a define telling the per-alloc overhead.

This allows buflib clients to more accurately estimate the total memory usage.
It's still not 100% accurate because the handle table grows in blocks, thus
buflib might use more memory that caused by allocations directly.

Change-Id: I68338bb94f510ad188fcb588aebf895b5f9197c5
talk: Remove superflous call to talk_init().

talk_init() is called by settings_apply() already which is called on boot.
Doing it again means loading the voicefile a second time which isn't necessary.

Change-Id: I4decd16401e63bf87338d3163c99d06d69fe3a3c
talk/hwcodec: Do always free the clip buffer in shrink_callback().

This is necessary because when voice is active audio is disabled. But only
audio was able to shrink it's buffer to let other memory allocs succeed.
talk needs to be able to do this too when it owns the audio buffer exclusively.

Change-Id: Idea8ab90da7169f977c0c766cccb42c4fe6d6e81
talk: Make talk_voice_required() local to talk.c

Change-Id: I3a04760d550efab7f011a917597ef29c039b05bd
talk: Add debug menu entry to view statistics about talk engine.

This engine includes voicefile, memory usage and cache
hits/misses for TALK_PARTIAL_LOAD.

Change-Id: I331981ddda39ea30c57b4b74504accb3c556c3b9
talk: Smarter cache management for TALK_PARTIAL_LOAD.

Previously the clip cache of TALK_PARTIAL_LOAD reserved space N clips, each slot
was as big as the maximum sized clip which was necessary to replace clips
in-memory in MRU-style.

The cache management now uses buflib to allocate and free each clip, using the
clip's real size. This allows the clip cache to be much more compact, because
no space is wasted for the max. sized clip. This makes use of buflib's ability
to easily manage differently-sized memory chunks by moving them to make free
space.

As an example: for english.voice TALK_PARTIAL_LOAD allocated 288k in advance.
for just 64 clips. With this patch ~70 clips can be stored in a 100k buffer.
This, the memory usage is cut by 2/3 and almost optimal (there's still the
buflib per-alloc cookie overhead).

As a result the TALK_PARTIAL_LOAD buffer is restricted to 100k which still
allows for more clips than previously, on average.

Change-Id: I257654071e9a95770cd6db2c2765f020befce412
talk.c: The new cache management is good enough to use it on all targets.

This unifies the talk.c for all targets. The only separation is left is
TALK_PROGRESSIVE_LOAD: When this is defined the talk buffer will not be
initially prefilled. This is useful for super slow storage or when the buffer
is not large enough to prefill it with useful clips (the prefill code could
be made smarter too).

The buffer size can be adjusted. By default lowmem uses 100k while
other targets load the entire file. The bigger the more clips can be cached
but with diminishing returns.

Change-Id: Ife38fb101c53093117e6638c40c65f7d177a31d4
talk.c: The new cache management is good enough to use it for .talk clips as well.

This unifies the talk.c for all possible voice payload. .talk clips are placed
onto the same unified clip cache, along with normal clips. This allows for more
effecient memory usage.

The cache handling makes a slight difference between normal clips and .talk
ones: .talk clips can be cached multiple and are always freed first.The extra
logic to avoid loading multiple copies of .talks is not necessary because the
will be freed first anyway.

Change-Id: I88d056a0a613b129f5875f50fdb757b58bac0a42
talk/voice: Reduce the size of the commit buffer.

The voice engine can now request more voice data during decoding, it does
not require the entire clip to be available before start of decoding anymore.
Therefore the commit buffer does not need to hold an entire voice clip anymore,
and can be made greatly smaller.

Change-Id: I3eca9026448e725b9b8d0dae1efca0ad185371da
Fix warnings.

Change-Id: If3cbcd7557797684f1b7fea8e1bb134777680dee
talk: On hwcodec disabling DMA interrupt is required during buflib move

Even though the DMA buffer itself does not move the ISR copies from a movable
buffer into the static commit buffer. To ensure this copying yields consistent
data it must not be interrupted by this ISR..

Also bump the commit buffer size to 2k, this should reduce the overhead
considerably because many clips are smaller than that (especially on
swcodec/speex).

Change-Id: I4e1ab83074f31fc91b51a58baa1df55ce659ac73
Slight change to line positioning in 128x128x16 Cabbie

Change-Id: Iaa7ce5bc2702854da661a77069c74637a64e4be7