summaryrefslogtreecommitdiffstats
path: root/apps/voice_thread.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-13Remove buflib allocation names, part twoAidan MacDonald1-1/+1
Remove allocation names from the buflib API and fix up all callers. Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
2021-09-29voice_thread.c ensure cpu gets re-boosted after Q_VOICE_STOP eventWilliam Wilgus1-6/+5
when the voice system is doing queued voice clips you can get a voice_stop event which cancels the cpu boost but the quiet count was not reset to 0 next clip may play unboosted causing stuttering just boost unconditionally on Q_PLAY it'll unboost after timeout if unneeded Change-Id: Ib39df5d9f8a9e41299147a885048cf1361180dd6
2021-09-28Revert "voice_thread.c ensure cpu gets re-boosted after Q_VOICE_STOP event"William Wilgus1-1/+0
This reverts commit 4695f80230f0d3e3eb03a4d9aade5253e2d51862. Reason for revert: Something else is unboosting the thread this is a red herring Change-Id: I0e71e0065b13129bbf59d45416c15799c446dcad
2021-09-27voice_thread.c ensure cpu gets re-boosted after Q_VOICE_STOP eventWilliam Wilgus1-0/+1
reset quiet counter after Q_VOICE_STOP when the voice system is doing un-queued voice clips you can get a voice_stop event which cancels the cpu boost but the quiet count was not reset next clip will play unboosted causing stuttering Change-Id: Icaada443e2399bf146e30bebee599db5b379063a
2021-03-07voice: Allow voice prompt volume to be configurableSolomon Peachy1-1/+10
It defaults to 100%, allow it to be dialed back Change-Id: If997fb7d3057472a7fac0be4ae7d1e8fce654c49
2020-12-17voice: Fix accidental warningsSolomon Peachy1-1/+0
Change-Id: I9663b4febd60c79a533ace1bad593c543c7dcf1d
2020-12-17voice: Increase voice thread stack size on hosted targetsSolomon Peachy1-0/+4
Fixes a stack overflow on Sony NWZ players when loading the voice file Change-Id: Id545517b827e757922b4cde043763ee7316435e6
2020-09-20Add Invalid Voice Announcement to the voice system FS#13216William Wilgus1-2/+18
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
2020-09-20voice: rename mp3_play_* functions to voice_play_*Solomon Peachy1-16/+4
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
2020-08-25voice: Increase voice stack size a bit for MIPS by 256 bytes.Solomon Peachy1-1/+4
MIPS is stack hungry due to the large number of GPRs we have to save. With this extra headroom we now _idle_ at 75% stack use of a 2K stack! Change-Id: I197b730c817d948230010f18dba60747088487ba
2017-12-12Get voice event out of playback.cMichael Sevakis1-2/+2
Purpose: A step in removing all voice references from playback code and prelude to other changes. Change-Id: Ic3ad7f7a33b979693e18a3456ced37eb1d2281a4
2014-02-03Fix warnings.Thomas Martitz1-1/+1
Change-Id: If3cbcd7557797684f1b7fea8e1bb134777680dee
2014-02-02talk/voice: Reduce the size of the commit buffer.Thomas Martitz1-0/+25
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: Make talk_voice_required() local to talk.cThomas Martitz1-6/+0
Change-Id: I3a04760d550efab7f011a917597ef29c039b05bd
2014-01-05Do not include kernel.h in system.h.Thomas Martitz1-0/+2
system.h doesn't need it on its own and this change makes it less dependant on Rockbox internals. Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
2013-07-06Enable setting of global output samplerate on certain targets.Michael Sevakis1-5/+6
Replaces the NATIVE_FREQUENCY constant with a configurable frequency. The user may select 48000Hz if the hardware supports it. The default is still 44100Hz and the minimum is 44100Hz. The setting is located in the playback settings, under "Frequency". "Frequency" was duplicated in english.lang for now to avoid having to fix every .lang file for the moment and throwing everything out of sync because of the new play_frequency feature in features.txt. The next cleanup should combine it with the one included for recording and generalize the ID label. If the hardware doesn't support 48000Hz, no setting will be available. On particular hardware where very high rates are practical and desireable, the upper bound can be extended by patching. The PCM mixer can be configured to play at the full hardware frequency range. The DSP core can configure to the hardware minimum up to the maximum playback setting (some buffers must be reserved according to the maximum rate). If only 44100Hz is supported or possible on a given target for playback, using the DSP and mixer at other samperates is possible if the hardware offers them. Change-Id: I6023cf0c0baa8bc6292b6919b4dd3618a6a25622 Reviewed-on: http://gerrit.rockbox.org/479 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2013-05-31Argh, move a comment to the (now) proper location. :)Michael Sevakis1-2/+0
Change-Id: I13847b99d9aeaa05efa5b22a8e4842f193f01a3c
2013-05-31Have voice fire an event when it starts and stops playing.Michael Sevakis1-15/+18
Further decouples voice_thread.c from other playback areas. Also allows other audio sources, such as FM radio, to be attenuated when voice is playing by implementing a callback. Defined as another playback event rather than a new event class: PLAYBACK_EVENT_VOICE_PLAYING Change-Id: I2e3e218be6cd6bebbf39e7883a8c0e4ed42b62bb
2012-09-11Fix FS#12743 - 'Data Abort' on USB connectionThomas Martitz1-0/+1
Because a pointer was uninitialized the move_callback() corrupted memory by derefencing it and moving stuff to uninitialized value. This reverts part of 8bbd4d9, where the offending line was removed. I can only guess it was removed by accident. Change-Id: I83cee5b396cf3cc99b000e5284fac72fb8ca8db2
2012-05-30Get voice PCM queue indexes updating in right order...Michael Sevakis1-5/+10
...from the compiled code standpoint anyway. frame_out was being incremented before updating size...sometimes...depending on what GCC was up to. This seems to help. Change-Id: Ie4ee3337a2937bd2c26f0a9c4a1a00467954821b
2012-05-17Zero out voice buffer memory immediately after allocation.Michael Sevakis1-8/+14
Can't wait for the voice thread to initialize it since it concievably could be moved before the voice thread actually does so and the move callback accesses data that must be first set up in the voice thread function. Change-Id: Ia0d09539854db85e132e09d26cb129f02f5d93ff
2012-05-02Oops, need to init the voice_buf indexes too. :-)Michael Sevakis1-0/+1
Change-Id: I12e48e9e7d70e779511aac05be6e6145d30f456a
2012-05-02Use buflib for the allocation of voice PCM resources.Michael Sevakis1-39/+114
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-04-29Make rbcodec/dsp includes more specific.Michael Sevakis1-1/+1
Change-Id: Idb6af40df26f5b8499a40e8b98602261ef227044
2012-04-29Fundamentally rewrite much of the audio DSP.Michael Sevakis1-14/+23
Creates a standard buffer passing, local data passing and messaging system for processing stages. Stages can be moved to their own source files to reduce clutter and ease assimilation of new ones. dsp.c becomes dsp_core.c which supports an engine and framework for effects. Formats and change notifications are passed along with the buffer so that they arrive at the correct time at each stage in the chain regardless of the internal delays of a particular one. Removes restrictions on the number of samples that can be processed at a time and it pays attention to destination buffer size restrictions without having to limit input count, which also allows pcmbuf to remain fuller and safely set its own buffer limits as it sees fit. There is no longer a need to query input/output counts given a certain number of input samples; just give it the sizes of the source and destination buffers. Works in harmony with stages that are not deterministic in terms of sample input/output ratio (like both resamplers but most notably the timestretch). As a result it fixes quirks with timestretch hanging up with certain settings and it now operates properly throughout its full settings range. Change-Id: Ib206ec78f6f6c79259c5af9009fe021d68be9734 Reviewed-on: http://gerrit.rockbox.org/200 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2012-04-26Oops, Shoulda been "int16_t" not "uint16_t".Michael Sevakis1-1/+1
Change-Id: Ic2a54e9f283acb1c362857a3f1422ed3c532249f
2012-04-26Adjust some typing in voice_thread.c. Constants are also counts, not sizes.Michael Sevakis1-16/+20
Change-Id: I05700f6c87c775e98f05323d2ab0550fad8befd7
2012-03-04Tweak paramters of mp3_play_data and callback.Michael Sevakis1-9/+11
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
2012-03-03Revise the PCM callback system after adding multichannel audio.Michael Sevakis1-7/+10
Additional status callback is added to pcm_play/rec_data instead of using a special function to set it. Status includes DMA error reporting to the status callback. Playback and recording callback become more alike except playback uses "const void **addr" (because the data should not be altered) and recording uses "void **addr". "const" is put in place throughout where appropriate. Most changes are fairly trivial. One that should be checked in particular because it isn't so much is telechips, if anyone cares to bother. PP5002 is not so trivial either but that tested as working. Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2 Reviewed-on: http://gerrit.rockbox.org/166 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
2011-09-01Remove obsolete init cruft from audio system because of diminished ↵Michael Sevakis1-18/+2
dependencies. All talk/voice dependency in playback.c should be imminently removable. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30401 a1c6a512-1295-4272-9138-f99709370657
2011-08-30Clean up and simplify the voice thread code.Michael Sevakis1-171/+148
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30386 a1c6a512-1295-4272-9138-f99709370657
2011-07-08Voice doesn't have to consume 100% CPU while waiting for an output buffer to ↵Michael Sevakis1-1/+1
be available. Use 'sleep(0)' instead of 'yield()' while polling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30132 a1c6a512-1295-4272-9138-f99709370657
2011-06-29Commit FS#12150 - Fully-functional audio mixer - and finally whip old ↵Michael Sevakis1-117/+162
limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657
2010-12-10Base voice thread stack size on DEFAULT_STACK_SIZE, it's otherwise likely to ↵Thomas Martitz1-1/+1
overflow on app targets. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28783 a1c6a512-1295-4272-9138-f99709370657
2010-05-28Voice buffer can be much, much smaller. Code cleanup, logf fixJeffrey Goode1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26354 a1c6a512-1295-4272-9138-f99709370657
2010-05-24Make PCM->driver interface about as simple as it will get. Registered ↵Michael Sevakis1-2/+2
callback, zero data, alignment and stops are handled entirely inside pcm.c; driver merely calls fixed pcm.c callback. Remove pcm_record_more and do it just like playback; the original reason behind it isn't very practical in general. Everything checks out on supported targets. There wer some compat changes I can't check out on many unsupoorted but if there's a problem it will be a minor oops. Plugins become incompatible due to recording tweak-- full update. Sorted API. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26253 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Move c/h files implementing/defining standard library stuff into a new libc ↵Thomas Martitz1-0/+1
directory, also standard'ify some parts of the code base (almost entirely #include fixes). This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
2010-05-05Another logf fix in voice_thread.cJeffrey Goode1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25832 a1c6a512-1295-4272-9138-f99709370657
2010-05-04Fix logf behavior in voice_thread.cJeffrey Goode1-2/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25810 a1c6a512-1295-4272-9138-f99709370657
2008-12-10Use cookies for thread identification instead of pointers directly which ↵Michael Sevakis1-5/+5
gives a buffer against wrongly identifying a thread when the slot is recycled (which has been nagging me for awhile). A slot gets 255 uses before it repeats. Everything gets incompatible so a full update is required. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19377 a1c6a512-1295-4272-9138-f99709370657
2008-10-23Remove the event object in the kernel since it's rather extraneous at the ↵Michael Sevakis1-6/+6
moment. This makes the codecs and the plugins incompatible, so update fully. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18867 a1c6a512-1295-4272-9138-f99709370657
2008-07-15Accept FS#8918: Voice multiple thumbnails and talk race fixes.Stéphane Doyon1-8/+13
-Allows loading multiple thumbnails back-to-back in the one thumbnail buffer. -Mutex to prevent race conditions with talk queue indices and thumbnail buffer state. -Synchronous shutup. -Shutup is a noop if no voice is queued. -mp3_play_stop() does nothing until the audio thread is ready. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18046 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg1-2/+4
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-04-06Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now ↵Michael Sevakis1-5/+5
with shared variables in DRAM (it seems swp(b) is at least partially broken on all PP or I'm doing something very wrong here :\). For core-shared data use SHAREDBSS/DATA_ATTR. NOCACHEBSS/DATA_ATTR is available whether or not single core is forced for static peripheral-DMA buffer allocation without use of the UNCACHED_ADDR macro in code and is likely useful on a non-PP target with a data cache (although not actually enabled in config.h and the .lds's in this commit). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16981 a1c6a512-1295-4272-9138-f99709370657
2008-03-29Correct some windows line endings back to unix.Nicolas Pennequin1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16877 a1c6a512-1295-4272-9138-f99709370657
2008-03-28The const police raid playback.c, should be no change to behaviour.Steve Bavin1-1/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16860 a1c6a512-1295-4272-9138-f99709370657
2008-03-25Add a complete priority inheritance implementation to the scheduler (all ↵Michael Sevakis1-1/+3
mutex ownership and queue_send calls are inheritable). Priorities are differential so that dispatch depends on the runnable range of priorities. Codec priority can therefore be raised in small steps (pcmbuf updated to enable). Simplify the kernel functions to ease implementation and use the same kernel.c for both sim and target (I'm tired of maintaining two ;_). 1) Not sure if a minor audio break at first buffering issue will exist on large-sector disks (the main mutex speed issue was genuinely resolved earlier). At this point it's best dealt with at the buffering level. It seems a larger filechunk could be used again. 2) Perhaps 64-bit sims will have some minor issues (finicky) but a backroll of the code of concern there is a 5-minute job. All kernel objects become incompatible so a full rebuild and update is needed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16791 a1c6a512-1295-4272-9138-f99709370657
2007-12-11A final queue_post in voice_stop via. talk_force_shutup can try stopping PCM ↵Michael Sevakis1-0/+4
too late and interfere PCM playback after plugins init IRAM or calling audio_get_buffer. Send the NULL message to the voice thread to ensure all messages are done. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15911 a1c6a512-1295-4272-9138-f99709370657
2007-12-04Attempt at fixing the statusbar showing up late in some screens and ↵Thom Johansen1-3/+5
circumstances. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15872 a1c6a512-1295-4272-9138-f99709370657
2007-11-24Have voice_wait wait for the PCM buffer to drain. It can only do this ifStéphane Doyon1-0/+3
playback is NOT in progress, but that is indeed the case for the only caller (shutting down message). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15790 a1c6a512-1295-4272-9138-f99709370657