mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
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>
This commit is contained in:
parent
3f82f3aca1
commit
286a4c5caa
48 changed files with 799 additions and 752 deletions
|
|
@ -28,7 +28,7 @@
|
|||
short __attribute__((section(".dmabuf"))) dma_buf_left[DMA_BUF_SAMPLES];
|
||||
short __attribute__((section(".dmabuf"))) dma_buf_right[DMA_BUF_SAMPLES];
|
||||
|
||||
unsigned short* p IBSS_ATTR;
|
||||
const int16_t* p IBSS_ATTR;
|
||||
size_t p_size IBSS_ATTR;
|
||||
|
||||
void pcm_play_lock(void)
|
||||
|
|
@ -41,7 +41,7 @@ void pcm_play_unlock(void)
|
|||
|
||||
void pcm_play_dma_start(const void *addr, size_t size)
|
||||
{
|
||||
p = (unsigned short*)addr;
|
||||
p = addr;
|
||||
p_size = size;
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ static inline void fill_dma_buf(int offset)
|
|||
do
|
||||
{
|
||||
int count;
|
||||
unsigned short *tmp_p;
|
||||
const int16_t *tmp_p;
|
||||
count = MIN(p_size / 4, (size_t)(lend - l));
|
||||
tmp_p = p;
|
||||
p_size -= count * 4;
|
||||
|
|
@ -109,16 +109,14 @@ static inline void fill_dma_buf(int offset)
|
|||
if (new_buffer)
|
||||
{
|
||||
new_buffer = false;
|
||||
pcm_play_dma_started_callback();
|
||||
pcm_play_dma_status_callback(PCM_DMAST_STARTED);
|
||||
}
|
||||
|
||||
if (l >= lend)
|
||||
return;
|
||||
|
||||
pcm_play_get_more_callback((void**)&p, &p_size);
|
||||
|
||||
if (p_size)
|
||||
new_buffer = true;
|
||||
new_buffer = pcm_play_dma_complete_callback(PCM_DMAST_OK,
|
||||
&p, &p_size);
|
||||
}
|
||||
while (p_size);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue