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
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_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
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
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
63cfbe0 fixed the number of codepages for bitmap targets. The same issue is
present on charcell, so update the number for that as well, fixing UTF-8
missing in the list.
Change-Id: Ib5d3494ed3d80e839ae3f59ec0a4277e5aa9d6fd
When the policy is not set, it'll by default not give the clip buffer away.
Callers of core_alloc_maximum() suffer from this. However, the thumbnail
buffer can be easily freed when needed because nothing needs to be
reloaded from disk when it is reallocated (thumbnail clips are loaded on
demand, when in the file browser). Do this to give core_alloc_maximum() callers
a better chance to succeed with the default talk buffer policy.
Change-Id: I8c0da29c520612ca903f6c930bd7c74ae97eca3b
In most of the translations strings with SYSFONT in title is
translated. This leads to displaying problem in (at least) graphical
equalizer due to the lack of non-latin character support in the
built-in font.
Change-Id: I0d27a5358e4eb539d4247c84975d8501d7668836
Reviewed-on: http://gerrit.rockbox.org/727
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
I've found this algorithm produces clearer results when rendering
some fonts at small point sizes.
Change-Id: If87d82731ad324405195b25baad78fe54e92c142
Reviewed-on: http://gerrit.rockbox.org/412
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Tested: Purling Nayuki <cyq.yzfl@gmail.com>
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
The builtin sysfont does not have an associated buflib_alloc_data
(because it's builtin right?). font_get_{width,bits} accessed a field of
it for all fonts which crashed on some systems but not on mine.
Solution: Move this field to struct font directly.
The cache size calculated was also busted.
Fixes FS#12944 and most likely FS#12938.
Change-Id: I32303c4335a12a6c421fdca34f7ece851aac12ca
The "Save Current Playlist" isnt part of the playlist viewer settings. While
at this section also add a reference to the extra playlist chapter.
Change-Id: I68e494430dc00c6172859b0b8d9edbe5b0116741
When skins use the default backdrop (via %X(-) or no %X at all) and the setting
changes it needs to be reloaded, otherwise when changing themes the new theme
could show the backdrop from the previous theme. The same needs to be
done when re-selecting the same theme after USB because the backdrop file was
potentially overwritten.
Fixes FS#12892 and FS#12942.
Change-Id: Ic2d20740cc385fa99667ce8a71507dbda2efceaf
Several devices, including the Fuze+ have great trouble recovering from
very low battery states, even in the presence of USB power. This is partly
due to buggy Sigmatel boot stubs and Rockbox bootloader doing unsafe power
operations on boot (should be fixed soon). In such a state, it is impossible
to boot either the OF and Rockbox, so only the recovery mode is available.
With this commit, mkimxboot can now create a very small stub which only
does one thing but does it well: setup charging to recover from any situation.
It does not provide a fancy charging screen or whatever, screen will just
stay black and the device will slowly charge at ~100mA. When the battery is
back to a normal level, just unplug and boot normally.
Change-Id: Ib50880af85ed1f4f64a7eed0f2221e73c889c351
Properly handle .init section in rom build and accomodate
the change in crt0.S introduced in b31c856
Change-Id: Icbf26a87162165da149232de264dc3671ca8ae96
In b31c856 startup code section was renamed but boot.lds
linker scripts were not updated accordingly.
Change-Id: I9c9893ec2e199ac2555007a1d23e109ca0daea28
2d9c0bab added a codepage but didn't increase the number of choices
for the setting, so UTF8 dropped off the list.
Change-Id: I154032bddaabcb783212370a12b2e5cdea305302
The old method simply polled the lastbtn variable in button.c. This approach
does not clear the button event queue which overflows as a result (panic
in the simulator). Use proper APIs to fix that and adopt the
method from the old read_scroll_wheel() function, which reads buttons until
the button queue is empty, for all targets.
Change-Id: Ibf198f6e597e7f51ab4ebcfcae4ebebbe8d7845c
This reclaims ~6kB of ram.
Change-Id: Iafdc661b1cf4445669c08c79205043792b8d14c3
Reviewed-on: http://gerrit.rockbox.org/718
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
According to http://http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991, since
mingw-gcc 4.7.1 -mms-bitfields is on by default, and this option breaks the
packet attribute since around 4.2.0.
We haven't set this option so I'm assuming we don't need it. Therefore a
workaround in configure can make things work again, because we rely on
the packet attribute in quite a few places.
Change-Id: I8367c16594cecfdde97c548e04607deaa92e21de
This should catch the case of buffer misuse which results
in corrupted cookie of next allocation. The check is performed
on move_block() so it may be a bit late.
There is buflib_check_valid() provided which checks the
integrity of all cookies for given context.
On DEBUG build with --sdl-thread this check is carried out
for core_ctx on every context switch to catch problems earlier.
Change-Id: I999d4576084592394e3dbd3bdf0f32935ff5f601
Reviewed-on: http://gerrit.rockbox.org/711
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
iap-core.h defines LOGF_ENABLE unconditionally but hexstring()
helper function was not compiled if logf support was not
selected in configure. The regular builds worked by accident
because logf() lines where discarded by preprocessor.
Change-Id: Id76af478e7c760d81168ebf9bf3eb973a679987c