summaryrefslogtreecommitdiffstats
path: root/apps/talk.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-02-03 12:43:05 +0100
committerThomas Martitz <kugel@rockbox.org>2014-02-03 12:43:05 +0100
commit0b7a90722a7bf9ffe5cd75eb3990c57af17098d1 (patch)
tree187cb17d0684663c699e964e9aeb8069e8efa18e /apps/talk.c
parent10b3bc78f6e55a3a442f2da1f95f158ab158e648 (diff)
downloadrockbox-0b7a90722a7bf9ffe5cd75eb3990c57af17098d1.tar.gz
rockbox-0b7a90722a7bf9ffe5cd75eb3990c57af17098d1.tar.bz2
rockbox-0b7a90722a7bf9ffe5cd75eb3990c57af17098d1.zip
talk: On hwcodec disabling DMA interrupt is required during buflib move
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
Diffstat (limited to 'apps/talk.c')
-rw-r--r--apps/talk.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/talk.c b/apps/talk.c
index 13f323f4b6..910f355ff9 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -207,6 +207,14 @@ static void sync_callback(int handle, bool sync_on)
mutex_lock(&read_buffer_mutex);
else
mutex_unlock(&read_buffer_mutex);
+#if CONFIG_CPU == SH7034
+ /* DMA must not interrupt during buffer move or commit_buffer copies
+ * from inconsistent buflib buffer */
+ if (sync_on)
+ CHCR3 &= ~0x0001; /* disable the DMA (and therefore the interrupt also) */
+ else
+ CHCR3 |= 0x0001; /* re-enable the DMA */
+#endif
}
static ssize_t read_to_handle_ex(int fd, struct buflib_context *ctx, int handle,
@@ -641,7 +649,7 @@ static bool load_voicefile_data(int fd)
/* Use a static buffer to avoid difficulties with buflib during DMA
* (hwcodec)/buffer passing to the voice_thread (swcodec). Clips
* can be played in chunks so the size is not that important */
-static unsigned char commit_buffer[1<<10];
+static unsigned char commit_buffer[2<<10];
static void* commit_transfer(struct queue_entry *qe, size_t *size)
{