summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/pcm-alsa.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-02-23 08:14:46 -0500
committerMichael Sevakis <jethead71@rockbox.org>2012-03-03 07:23:38 +0100
commit286a4c5caa1945c8d1cb365a3d90fb09d5700cb2 (patch)
tree4835f46d16ec78d035ec9f49333079fe618384c1 /firmware/target/hosted/pcm-alsa.c
parent3f82f3aca14eb954e55f761721ffdd2684f0e812 (diff)
downloadrockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.tar.gz
rockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.zip
Revise the PCM callback system after adding multichannel audio.
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>
Diffstat (limited to 'firmware/target/hosted/pcm-alsa.c')
-rw-r--r--firmware/target/hosted/pcm-alsa.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/firmware/target/hosted/pcm-alsa.c b/firmware/target/hosted/pcm-alsa.c
index b78993dd0a..1385f75b34 100644
--- a/firmware/target/hosted/pcm-alsa.c
+++ b/firmware/target/hosted/pcm-alsa.c
@@ -223,9 +223,11 @@ static bool fill_frames(void)
223 if (!pcm_size) 223 if (!pcm_size)
224 { 224 {
225 new_buffer = true; 225 new_buffer = true;
226 pcm_play_get_more_callback((void **)&pcm_data, &pcm_size); 226 if (!pcm_play_dma_complete_callback(PCM_DMAST_OK,
227 if (!pcm_size || !pcm_data) 227 (const void **)&pcm_data, &pcm_size))
228 {
228 return false; 229 return false;
230 }
229 } 231 }
230 copy_n = MIN((ssize_t)pcm_size, frames_left*4); 232 copy_n = MIN((ssize_t)pcm_size, frames_left*4);
231 memcpy(&frames[2*(period_size-frames_left)], pcm_data, copy_n); 233 memcpy(&frames[2*(period_size-frames_left)], pcm_data, copy_n);
@@ -237,7 +239,7 @@ static bool fill_frames(void)
237 if (new_buffer) 239 if (new_buffer)
238 { 240 {
239 new_buffer = false; 241 new_buffer = false;
240 pcm_play_dma_started_callback(); 242 pcm_play_dma_status_callback(PCM_DMAST_STARTED);
241 } 243 }
242 } 244 }
243 return true; 245 return true;