Amachronic raised concern about open() blocking causing a static buf
to get overwritten in multiple calls its prudent to just have the caller
supply the buffer to minimize stack issues later
Change-Id: Iae27c7d063adb1a65688f920f6aa5c395fa5694a
save some space by allowing printf formatting directly rather than
having a buffer and using sprintf
Change-Id: I049c8f898fb4a68a26ad0f0646250c242647ba12
replace applicable calls to strlcpy with calls to strmemccpy
which null terminates on truncation
in theory the strmemccpy calls should be slightly faster since they
don't traverse the rest of the source string on truncation
but I seriously doubt there is too much of that going on in the code base
Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
allow buflib_free to check for invalid or already freed handles
within the function -- remove all the invalid handle guards thru core_free
Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
This adds LANG_VOICED_DATE_FORMAT, a format string with these tokens:
Y 4-digit year
A Month name
m numeric month
d numeric day of month
The default (english) is '23 January 2013'
In comparison, english-us is 'January 23 2013'
Change-Id: I055a3287c104260dec63bba58d36fdae9df1ed16
For example, English would say "231" as "two hundred thirty one" but
many other languages would say "two hundred one and thirty"
So, if VOICE_NUMERIC_TENS_SWAP_SEPARATOR is not an empty string, swap
the tens and ones position and use that string ("and" in the above
example) as the voiced separator.
Change-Id: I69f8064d44b3995827327cabae6ad352bf257d04
talk.c potential division by zero warrants a check
desowin pointed out multiple fd leaks
announce_status.c dumb typo
Change-Id: Iae99bd64696afdd9585952245a7a04cdc9f88ef1
load_voicefile_data wasn't checked for success leading
to a use after free situation
get_clip now checks for valid index_handle before using it
Change-Id: Id66dba6dbd6becfc9e0fe922fbc1d0adec1f0393
When a voice file is invalid or fails to load the voice system splash a
message 'Invalid Voice'
Now we supply a single voice file (currently only english is used)
the support for other languages is in but I haven't set it up to
look for anything but InvalidVoice_english.talk
Also adds a one time kill voice thread function
ie. it doesn't allow re-init after killing the voice thread & queue
Change-Id: I7b43f340c3cc65c65110190f0e0075b31218a7ac
Remove mp3_is_playing() entirely, in favor of pcm_is_playing()
Remove mp3_play_pause() entirely, as it's a dummy/no-op call
Remoce some archos-specific comments
Change-Id: I4e9ff323490a93add00809efd19e0d4e3f198b2d
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.
Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
Otherwise we might actually be talking when we try to switch, or
otherwise trash the state of the running talk thread, leading to
memory corruption or an outright crash
(This fixes a panic observed on the xDuoo X3)
Change-Id: I78e4232085c5c160c9ee4f18167dad8dad2b9287
* get rid of $(LANGUAGE) in top-level makefile (and configure script)
* un-hardcode English-as-primary-language in a couple more places
* allow DEFAULT_VOICE_LANG to be overriden
To actually change the primary from English, one must change:
* $english in voice.pl
* hardcoded 'english' in rbutil
* $ENGLISH in apps/lang/lang.make
* DEFAULT_VOICE_LANG in apps/talk.c
* configure script (default prompt)
Of course, if one wants to change the default UI language, it's simpler
to change the default language setting variable at compile time, or
perhaps by adding a configuration file with the desired value into the
.rockbox directory when the .zip is assembled.
Change-Id: If5cf76019d416e838628a2eccd4ec7d6cbaeeb74
* Use consistent ID numbering
* Use consistent logic for voicelist and voicebin files
* Fix situations where English <-> English would fail in strange ways
* Delete leftover tmpfile.
* Off-by-one error in voice validation code
* Off-by-one error in voicelist generation
Change-Id: Ib3cea2c6612138b1cbe614dacbe51000199cc9ad
>
> I ran into an issue where my voice file would only load if I changed language while playing music. It seems to happen because when no other file is open, file.c alloc_filestr returns the first free handle which is 0. In talk.c this is treated as an invalid handle, so the voice file is not loaded.
Change-Id: I42db40b10cc7a900bdd72012d99265300e783e44
g#2272 adds checks for incompatible version & proper number of clips
Currently incompatible talk files will logf when failure to load occurs
Adds a message to Debug > Talk engine stats
'Talk Status: OK'
'Talk Status: ERR Incompatible voice file'
'Talk Status: ERR (#)' -- OOM, Alloc Error
Change-Id: Ifd2c1f38f710541c9cd929b8abf67bba4363ca53
In addition to version and target also check id1_max & id2_max
for proper length before allowing voice file to be loaded
Change-Id: I36016059d07781b0bb43dd9873bbb6e565298d76
Original patch by Mario Lang
Heavily updated by Igor Poretsky
Further updated by myself
This patch breaks binary API compatibility by placing the new
functions where they make the most logical sense. IMO this is
the better approach to take given the scope of the changes needed
for talk support.
Since binary API is changing, the patch also moves some other
functions around to more logical locations.
As well as voice support in plugins, this patch voice-enables several
simple plugins. There will be follow-up patches for many plugins that
build on this one.
Change-Id: I18070c06e77e8a3c016c2eb6b6c5dbe6633b9b54
Unifies time formatting in settings_list.c allows time format to
display as HH:MM:SS.MSS or any consecutive combination thereof
(hh:mm:ss, mm:ss, mm:ss.mss, ss.mss, hh, mm, ss ,mss)
works in INT and TABLE settings with the addition of flag 'F_TIME_SETTING'
Time is auto-ranged dependent on value
Adds talk_time_intervals to allow time values to be spoken similar to
display format: x Hours, x Minutes, x Seconds, x Milliseconds
Table lookups merged or removed from recording, clip meter and lcd timeout
-String_Choice replaced with TABLE_SETTING or INT_SETTING for these
functions as well, cleaned-up cfg_vals that get saved to cfgfile
RTL Languages ARE supported
Negative values ARE supported
Backlight on/off are now Always and Never to share formatter with LCD
Timeout
Added flag to allow ranged units to be locked to a minimum index
Added flag to allow leading zero to be supressed from the largest unit
merged talk_time_unit() and talk_time_intervals()
optimized time_split()
optimized format_time_auto()
Backlight time-out list same as original
Change-Id: I59027c62d3f2956bd16fdcc1a48b2ac32c084abd
Modified from original ticket, Taken from Igor Poretsky's tree, and
further modified by myself to incorporate feedback.
Change-Id: Ibc2180e52af76890b1448d23f79386fd0f88f709
output_dyn_value now requires the count for number of units
Binary scale now shows Kibibytes instead of kilobytes (g#1742)
Fixes output for negative values as well
Change-Id: I8aa896860e97d2453fa35069e2dfe1caac60109f
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
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
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
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
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
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
On hwcodec talk.c has the entire audio buffer (not just parts of it), therefore
it must give up everything and cannot count on core_alloc_maximum() to return
the remaining space. This is equivalent to it was handled before 22e802e.
You could probaby do smarter and shrink for example the .talk clip buffer
but is it really worth it?
Change-Id: Idc3431c59fb41b05338559c615093358c5d8ed9b