summaryrefslogtreecommitdiffstats
path: root/apps/talk.c
AgeCommit message (Collapse)AuthorFilesLines
2020-07-24[3/4] Completely remove HWCODEC supportSolomon Peachy1-99/+6
'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
2020-07-24[1/4] Remove SH support and all archos targetsSolomon Peachy1-31/+2
This removes all code specific to SH targets Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24talk: Force-shutdown the voice system before loading a new voiceSolomon Peachy1-0/+3
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
2020-07-21build: Tweaks to better support non-English as primary languageSolomon Peachy1-0/+2
* 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
2020-07-21genlang: More voice-related fixes.Solomon Peachy1-1/+1
* 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
2020-07-15talk: only show the "failed reading .voice" splash if talking is enabledSolomon Peachy1-1/+2
Change-Id: I4046294e39c621ddeeceeb6f21eab05a1e687cb5
2020-07-09voice file not loadingPeter Sealy1-1/+1
> > 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
2020-05-22talk.h add failed to load splashWilliam Wilgus1-1/+4
Change-Id: Ie355a52bb6c687d302dc3e39693b9ab40e2dd699
2020-05-22talk.h add init status to debug menuWilliam Wilgus1-3/+21
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
2020-04-17talk.h make voice files check for proper number of entries on loadWilliam Wilgus1-1/+8
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
2019-08-06Respect age when freeing thumbnails from clip cache.Solomon Peachy1-6/+16
Otherwise they could get freed while queued. Patch by Igor Poretsky Change-Id: I436b074d81a85cfeb68a07a17320a3c9c0a43e1e
2019-08-05Improved robustness in talk codeSolomon Peachy1-7/+18
Patch by Igor Poretsky Change-Id: I5c0dcc693b647c7573379e33406a7b9d4b192725
2019-07-20FS#7704 - Talk support for pluginsSolomon Peachy1-3/+0
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
2018-12-22Auto-Ranging Time Formatting For Menus (hh:mm:ss:mss)William Wilgus1-16/+55
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
2018-12-15Fix HWCODEC builds.Solomon Peachy1-2/+0
Change-Id: I7abed5dab9b4d0d053c274404dc4dc06864aa060
2018-12-15FS#6323: Speech for ID3 viewer, playlist catalog and playlist viewerSolomon Peachy1-4/+52
Modified from original ticket, Taken from Igor Poretsky's tree, and further modified by myself to incorporate feedback. Change-Id: Ibc2180e52af76890b1448d23f79386fd0f88f709
2018-12-09Fix possible truncation misc.c->output_dyn_value + use KibytesWilliam Wilgus1-1/+1
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
2014-02-03talk: On hwcodec disabling DMA interrupt is required during buflib moveThomas Martitz1-1/+9
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
2014-02-03Fix warnings.Thomas Martitz1-0/+2
Change-Id: If3cbcd7557797684f1b7fea8e1bb134777680dee
2014-02-02talk/voice: Reduce the size of the commit buffer.Thomas Martitz1-6/+11
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
2014-02-02talk.c: The new cache management is good enough to use it for .talk clips as ↵Thomas Martitz1-165/+104
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
2014-02-02talk.c: The new cache management is good enough to use it on all targets.Thomas Martitz1-183/+189
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
2014-02-02talk: Smarter cache management for TALK_PARTIAL_LOAD.Thomas Martitz1-282/+373
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
2014-02-02talk: Add debug menu entry to view statistics about talk engine.Thomas Martitz1-2/+59
This engine includes voicefile, memory usage and cache hits/misses for TALK_PARTIAL_LOAD. Change-Id: I331981ddda39ea30c57b4b74504accb3c556c3b9
2014-02-02talk: Make talk_voice_required() local to talk.cThomas Martitz1-13/+13
Change-Id: I3a04760d550efab7f011a917597ef29c039b05bd
2014-02-02talk/hwcodec: Do always free the clip buffer in shrink_callback().Thomas Martitz1-1/+10
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
2014-01-27talk: When no voice file is loaded don't even attempt to load the clip, it's ↵Thomas Martitz1-1/+3
hopeless. Change-Id: I420155d7f01ca0ea301c0678ac7245d251d365b0
2014-01-26hwcodec/talk.c: Give the thumbnail buffer regardless of the talk buffer policy.Thomas Martitz1-20/+30
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
2013-12-24hwcodec: core_alloc_maximum() returned 0 bytes if talk.c controls the audio ↵Thomas Martitz1-0/+6
buffer. 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
2013-12-23Fix yellow.Thomas Martitz1-0/+1
Change-Id: Ib46e4d0896de4227a508abf5806c00ec3d59db51
2013-12-23playback,talk: Share audiobuffer via core_alloc_maximum().Thomas Martitz1-331/+430
This fixes the radioart crash that was the result of buffering.c working on a freed buffer at the same time as buflib (radioart uses buffering.c for the images). With this change the buffer is owned by buflib exclusively so this cannot happen. As a result, audio_get_buffer() doesn't exist anymore. Callers should call core_alloc_maximum() directly. This buffer needs to be protected as usual against movement if necessary (previously it was not protected at all which cased the radioart crash), To get most of it they can adjust the willingness of the talk engine to give its buffer away (at the expense of disabling voice interface) with the new talk_buffer_set_policy() function. Change-Id: I52123012208d04967876a304451d634e2bef3a33
2012-06-05Add comment to clarify calculation.Dominik Riebeling1-1/+3
Change-Id: Ie0eaa2bb1c672c974246b3e97b5d5f3b9e1f9925
2012-05-24More snafu fix. Need a couple more patchups for now.Michael Sevakis1-0/+1
Must restore talk buffer explicitly when not taking it and promote the buffer state. Change-Id: Ia0341ede05837e6e94885a9ad62460c415ec6f00
2012-05-24Correct snafu in talk.cMichael Sevakis1-1/+1
When allocating the voice buffer, it's supposed to start at the beginning of the audio buffer, not at the end of the voice buffer. ;-D Might clear up a thing or two. Change-Id: I94796ff21090bcc56813cdc569957a1a9178abcd
2012-05-02Use buflib for the allocation of voice PCM resources.Michael Sevakis1-17/+41
Buffers are not allocated and thread is not created until the first call where voice is required. Adds a different callback (sync_callback) to buflib so that other sorts of synchonization are possible, such as briefly locking-out the PCM callback for a buffer move. It's sort of a messy addition but it is needed so voice decoding won't have to be stopped when its buffer is moved. Change-Id: I4d4d8c35eed5dd15fb7ee7df9323af3d036e92b3
2012-03-04Tweak paramters of mp3_play_data and callback.Michael Sevakis1-2/+2
Use generic void * and size_t and make mp3_play_data and its callback agree on types. Use mp3_play_callback_t instead of prototyping right in the function call (so it's not so messy to look at). Change doesn't appear to require plugin API version increment. Change-Id: Idcab2740ee316a2beb6e0a87b8f4934d9d6b3dd8
2011-12-15Add conditionals for functions only needed on SWCODEC targets.Boris Gjenero1-0/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31296 a1c6a512-1295-4272-9138-f99709370657
2011-11-06Make usage of TALK_PARTIAL_LOAD actually Ondio specific. MMC is not always slow.Jens Arnold1-2/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30917 a1c6a512-1295-4272-9138-f99709370657
2011-11-06Voice related fixes and cleaupJens Arnold1-42/+18
* Fix .talk clips on hwcodec. Voice does have the entire audio buffer available there. * Get rid of the separate TALK_PROGRESSIVE_LOAD in favour of the more advanced TALK_PARTIAL_LOAD i.e. use the latter on the Ondios as well. This gets rid of quite some ifdefing, and has the advantage that the voice file can be larger than the buffer (at a slight binsize cost). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30916 a1c6a512-1295-4272-9138-f99709370657
2011-11-06Fix warning and typos.Thomas Martitz1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30912 a1c6a512-1295-4272-9138-f99709370657
2011-11-06Fix broken voice when .talk files are used and voice buffer calculation.Thomas Martitz1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30909 a1c6a512-1295-4272-9138-f99709370657
2011-11-03Properly initialize variable to get voice going again. GCC didn't catch this ↵Thomas Martitz1-1/+1
one introduced r30840. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30894 a1c6a512-1295-4272-9138-f99709370657
2011-10-26Fix FS#12241. Voice stopped working after audio_get_buffer() calls.Thomas Martitz1-1/+6
Since r30308 the talk buffer was set to NULL if e.g. a plugin called audio_get_buffer() to steal the talk buffer. Since there's no audio_release_buffer() kind of function the talk buffer was never set back again. When trying to talk try to get the audio buffer with audio_get_buffer() as well, which works until the audio buffer gets properly reinitialized. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30840 a1c6a512-1295-4272-9138-f99709370657
2011-10-12Make a few local functions staticBertrik Sikken1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30744 a1c6a512-1295-4272-9138-f99709370657
2011-08-30GSoC/Buflib: Add buflib memory alocator to the core.Thomas Martitz1-2/+1
The buflib memory allocator is handle based and can free and compact, move or resize memory on demand. This allows to effeciently allocate memory dynamically without an MMU, by avoiding fragmentation through memory compaction. This patch adds the buflib library to the core, along with convinience wrappers to omit the context parameter. Compaction is not yet enabled, but will be in a later patch. Therefore, this acts as a replacement for buffer_alloc/buffer_get_buffer() with the benifit of a debug menu. See buflib.h for some API documentation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30380 a1c6a512-1295-4272-9138-f99709370657
2011-08-22Move stuff a bit down to fix red on TALK_PARTIAL_LOAD.Thomas Martitz1-8/+15
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30339 a1c6a512-1295-4272-9138-f99709370657
2011-08-22Fix red on hwcodec.Thomas Martitz1-2/+10
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30338 a1c6a512-1295-4272-9138-f99709370657
2011-08-21Talk: Unify hwcodec and swcodec handling.Thomas Martitz1-23/+16
Do it the hwcodec way which doesn't need a buffer_alloc(). The buffer for the .talk files is now allocated together with the voicefile buffer. Should also fix a panic when the .talk file buffer was allocated late at runtime. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30335 a1c6a512-1295-4272-9138-f99709370657
2011-08-14Add change that got lost somehow in r30308.Thomas Martitz1-4/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30312 a1c6a512-1295-4272-9138-f99709370657
2011-08-14Fix remaining problems.Thomas Martitz1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30311 a1c6a512-1295-4272-9138-f99709370657