From 94537f954e67d44fdd9703c062c4ee53599e0e74 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 8 Feb 2009 22:32:41 +0000 Subject: Gigabeat S: Implement an SDMA API and use it in the PCM driver. Some other miscellaneous adjustments to recording and PCM buffer to accomodate use of physical addresses and cache coherency. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19949 a1c6a512-1295-4272-9138-f99709370657 --- apps/pcmbuf.c | 5 +++++ apps/recorder/pcm_record.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index 99e56d160d..6e2234880e 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c @@ -1001,6 +1001,11 @@ void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude) /* Give 5ms clearance. */ bufstart += NATIVE_FREQUENCY * 4 / 200; +#ifdef HAVE_PCM_DMA_ADDRESS + /* Returned peak addresses are DMA addresses */ + bufend = pcm_dma_addr(bufend); +#endif + /* Wrapped above? */ if (bufstart >= bufend) bufstart -= pcmbuf_size; diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c index 8642150b18..8657aee1ba 100644 --- a/apps/recorder/pcm_record.c +++ b/apps/recorder/pcm_record.c @@ -1148,8 +1148,8 @@ static void pcmrec_init(void) buffer = audio_get_recording_buffer(&rec_buffer_size); - /* Line align pcm_buffer 2^4=16 bytes */ - pcm_buffer = (unsigned char *)ALIGN_UP_P2((uintptr_t)buffer, 4); + /* Line align pcm_buffer 2^5=32 bytes */ + pcm_buffer = (unsigned char *)ALIGN_UP_P2((uintptr_t)buffer, 5); enc_buffer = pcm_buffer + ALIGN_UP_P2(PCM_NUM_CHUNKS*PCM_CHUNK_SIZE + PCM_MAX_FEED_SIZE, 2); /* Adjust available buffer for possible align advancement */ -- cgit v1.2.3