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
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
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
* 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
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
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
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
The buffer_offset paramter of audio_init_recording() is removed as it
was unused in both implementations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30310 a1c6a512-1295-4272-9138-f99709370657
Namely, introduce buffer_get_buffer() and buffer_release_buffer().
buffer_get_buffer() aquires all available and grabs a lock, attempting to
call buffer_alloc() or buffer_get_buffer() while this lock is locked will cause
a panicf() (doesn't actually happen, but is for debugging purpose).
buffer_release_buffer() unlocks that lock and can additionally increment the
audiobuf buffer to make an allocation. Pass 0 to only unlock if buffer was
used temporarily only.
buffer_available() is a replacement function to query audiobuflen, i.e. what's
left in the buffer.
Buffer init is moved up in the init chain and handles ipodvideo64mb internally.
Further changes happened to mp3data.c and talk.c as to not call the above API
functions, but get the buffer from callers. The caller is the audio system
which has the buffer lock while mp3data.c and talk mess with the buffer.
mpeg.c now implements some buffer related functions of playback.h, especially
audio_get_buffer(), allowing to reduce #ifdef hell a tiny bit.
audiobuf and audiobufend are local to buffer.c now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30308 a1c6a512-1295-4272-9138-f99709370657
On these targets the full voice file can't be loaded so only load 64
clips at a time (the size of the queue)
Voice now works on clipv1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27962 a1c6a512-1295-4272-9138-f99709370657
now playback still works if voicing is enabled on the clipv1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26047 a1c6a512-1295-4272-9138-f99709370657
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
* Move strncpy() from core to the pluginlib
* Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins
* Drop strncpy() from the codec api as no codec used it
* Bump codec and plugin api versions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
than from tree.c
Voice a file or dir's thumbnail from path components,
or spell last path component. Ability to prefix the thumbnail or
spelling with some talk ids.
This is the talk_file patch from FS#6323, just refactored a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18048 a1c6a512-1295-4272-9138-f99709370657
-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