summaryrefslogtreecommitdiff
path: root/apps/voice_thread.c (follow)
Commit message (Collapse)AuthorAge
* Fix warnings.Thomas Martitz2014-02-03
| | | | Change-Id: If3cbcd7557797684f1b7fea8e1bb134777680dee
* talk/voice: Reduce the size of the commit buffer.Thomas Martitz2014-02-02
| | | | | | | | | 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
* talk: Make talk_voice_required() local to talk.cThomas Martitz2014-02-02
| | | | Change-Id: I3a04760d550efab7f011a917597ef29c039b05bd
* Do not include kernel.h in system.h.Thomas Martitz2014-01-05
| | | | | | | system.h doesn't need it on its own and this change makes it less dependant on Rockbox internals. Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
* Enable setting of global output samplerate on certain targets.Michael Sevakis2013-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Argh, move a comment to the (now) proper location. :)Michael Sevakis2013-05-31
| | | | Change-Id: I13847b99d9aeaa05efa5b22a8e4842f193f01a3c
* Have voice fire an event when it starts and stops playing.Michael Sevakis2013-05-31
| | | | | | | | | | | 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
* Fix FS#12743 - 'Data Abort' on USB connectionThomas Martitz2012-09-11
| | | | | | | | | | 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
* Get voice PCM queue indexes updating in right order...Michael Sevakis2012-05-30
| | | | | | | | ...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
* Zero out voice buffer memory immediately after allocation.Michael Sevakis2012-05-17
| | | | | | | | | 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
* Oops, need to init the voice_buf indexes too. :-)Michael Sevakis2012-05-02
| | | | Change-Id: I12e48e9e7d70e779511aac05be6e6145d30f456a
* Use buflib for the allocation of voice PCM resources.Michael Sevakis2012-05-02
| | | | | | | | | | | | | 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
* Make rbcodec/dsp includes more specific.Michael Sevakis2012-04-29
| | | | Change-Id: Idb6af40df26f5b8499a40e8b98602261ef227044
* Fundamentally rewrite much of the audio DSP.Michael Sevakis2012-04-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Oops, Shoulda been "int16_t" not "uint16_t".Michael Sevakis2012-04-26
| | | | Change-Id: Ic2a54e9f283acb1c362857a3f1422ed3c532249f
* Adjust some typing in voice_thread.c. Constants are also counts, not sizes.Michael Sevakis2012-04-26
| | | | Change-Id: I05700f6c87c775e98f05323d2ab0550fad8befd7
* Tweak paramters of mp3_play_data and callback.Michael Sevakis2012-03-04
| | | | | | | | | 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
* Revise the PCM callback system after adding multichannel audio.Michael Sevakis2012-03-03
| | | | | | | | | | | | | | | | | | 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>
* Remove obsolete init cruft from audio system because of diminished ↵Michael Sevakis2011-09-01
| | | | | | 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
* Clean up and simplify the voice thread code.Michael Sevakis2011-08-30
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30386 a1c6a512-1295-4272-9138-f99709370657
* Voice doesn't have to consume 100% CPU while waiting for an output buffer to ↵Michael Sevakis2011-07-08
| | | | | | 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
* Commit FS#12150 - Fully-functional audio mixer - and finally whip old ↵Michael Sevakis2011-06-29
| | | | | | 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
* Base voice thread stack size on DEFAULT_STACK_SIZE, it's otherwise likely to ↵Thomas Martitz2010-12-10
| | | | | | overflow on app targets. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28783 a1c6a512-1295-4272-9138-f99709370657
* Voice buffer can be much, much smaller. Code cleanup, logf fixJeffrey Goode2010-05-28
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26354 a1c6a512-1295-4272-9138-f99709370657
* Make PCM->driver interface about as simple as it will get. Registered ↵Michael Sevakis2010-05-24
| | | | | | 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
* Move c/h files implementing/defining standard library stuff into a new libc ↵Thomas Martitz2010-05-06
| | | | | | | | 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
* Another logf fix in voice_thread.cJeffrey Goode2010-05-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25832 a1c6a512-1295-4272-9138-f99709370657
* Fix logf behavior in voice_thread.cJeffrey Goode2010-05-04
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25810 a1c6a512-1295-4272-9138-f99709370657
* Use cookies for thread identification instead of pointers directly which ↵Michael Sevakis2008-12-10
| | | | | | 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
* Remove the event object in the kernel since it's rather extraneous at the ↵Michael Sevakis2008-10-23
| | | | | | 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
* Accept FS#8918: Voice multiple thumbnails and talk race fixes.Stéphane Doyon2008-07-15
| | | | | | | | | | | | -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
* Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg2008-06-28
| | | | | | | | | 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
* Enable nocache sections using the linker. PP5022/4 must use SW_CORELOCK now ↵Michael Sevakis2008-04-06
| | | | | | 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
* Correct some windows line endings back to unix.Nicolas Pennequin2008-03-29
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16877 a1c6a512-1295-4272-9138-f99709370657
* The const police raid playback.c, should be no change to behaviour.Steve Bavin2008-03-28
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16860 a1c6a512-1295-4272-9138-f99709370657
* Add a complete priority inheritance implementation to the scheduler (all ↵Michael Sevakis2008-03-25
| | | | | | 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
* A final queue_post in voice_stop via. talk_force_shutup can try stopping PCM ↵Michael Sevakis2007-12-11
| | | | | | 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
* Attempt at fixing the statusbar showing up late in some screens and ↵Thom Johansen2007-12-04
| | | | | | circumstances. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15872 a1c6a512-1295-4272-9138-f99709370657
* Have voice_wait wait for the PCM buffer to drain. It can only do this ifStéphane Doyon2007-11-24
| | | | | | | | 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
* Don't do lookahead skipping when stringing voice clips together.Thom Johansen2007-11-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15740 a1c6a512-1295-4272-9138-f99709370657
* speex voice: Detect the end of a clip the right way.Michael Sevakis2007-11-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15731 a1c6a512-1295-4272-9138-f99709370657
* Make threads responsible for explicit cancellation of their own boosted ↵Michael Sevakis2007-11-20
| | | | | | status. Sleeping and timeouts will no longer cancel it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15709 a1c6a512-1295-4272-9138-f99709370657
* Make sure initial menu item is voiced at startup. Voice thread must wait for ↵Michael Sevakis2007-11-19
| | | | | | the audio thread to finish initializing hardware. A known issue at speex commit time (perhaps only by myself ;). The behavioral refinement time begins. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15682 a1c6a512-1295-4272-9138-f99709370657
* The voice thread needs a tad bit more stack.Jens Arnold2007-11-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15674 a1c6a512-1295-4272-9138-f99709370657
* Fix some sim warnings.Michael Sevakis2007-11-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15670 a1c6a512-1295-4272-9138-f99709370657
* Make speex the new voice format for SWCODEC targets (non-Archos). Remove ↵Michael Sevakis2007-11-18
codec swapping and build speex voice decoding directly into the core binary. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15668 a1c6a512-1295-4272-9138-f99709370657