mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Get rid of some pcm_apply_settings cruft at the low level I somehow missed. Move the ones in pcm.c around to better spots. Remove a variable from pcm-pnx0101.c that should no longer be there.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19402 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4bbaef6fd5
commit
b6e78acc5e
9 changed files with 11 additions and 37 deletions
|
@ -213,6 +213,7 @@ static void pcm_play_data_start(unsigned char *start, size_t size)
|
||||||
if (start && size)
|
if (start && size)
|
||||||
{
|
{
|
||||||
logf(" pcm_play_dma_start");
|
logf(" pcm_play_dma_start");
|
||||||
|
pcm_apply_settings();
|
||||||
pcm_play_dma_start(start, size);
|
pcm_play_dma_start(start, size);
|
||||||
pcm_playing = true;
|
pcm_playing = true;
|
||||||
pcm_paused = false;
|
pcm_paused = false;
|
||||||
|
@ -234,8 +235,6 @@ void pcm_play_data(pcm_more_callback_type get_more,
|
||||||
|
|
||||||
pcm_callback_for_more = get_more;
|
pcm_callback_for_more = get_more;
|
||||||
|
|
||||||
pcm_apply_settings();
|
|
||||||
|
|
||||||
logf(" pcm_play_data_start");
|
logf(" pcm_play_data_start");
|
||||||
pcm_play_data_start(start, size);
|
pcm_play_data_start(start, size);
|
||||||
|
|
||||||
|
@ -256,21 +255,17 @@ void pcm_play_pause(bool play)
|
||||||
pcm_play_dma_pause(true);
|
pcm_play_dma_pause(true);
|
||||||
pcm_paused = true;
|
pcm_paused = true;
|
||||||
}
|
}
|
||||||
|
else if (pcm_get_bytes_waiting() > 0)
|
||||||
|
{
|
||||||
|
logf(" pcm_play_dma_pause");
|
||||||
|
pcm_apply_settings();
|
||||||
|
pcm_play_dma_pause(false);
|
||||||
|
pcm_paused = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pcm_apply_settings();
|
logf(" pcm_play_dma_start: no data");
|
||||||
|
pcm_play_data_start(NULL, 0);
|
||||||
if (pcm_get_bytes_waiting() > 0)
|
|
||||||
{
|
|
||||||
logf(" pcm_play_dma_pause");
|
|
||||||
pcm_play_dma_pause(false);
|
|
||||||
pcm_paused = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
logf(" pcm_play_dma_start: no data");
|
|
||||||
pcm_play_data_start(NULL, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -135,7 +135,6 @@ void pcm_play_dma_init(void)
|
||||||
void pcm_postinit(void)
|
void pcm_postinit(void)
|
||||||
{
|
{
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
pcm_apply_settings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pcm_dma_apply_settings(void)
|
void pcm_dma_apply_settings(void)
|
||||||
|
|
|
@ -206,9 +206,6 @@ static void play_start_pcm(void)
|
||||||
/* Stop transmission (if in progress) */
|
/* Stop transmission (if in progress) */
|
||||||
SSI_SCR1 &= ~SSI_SCR_TE;
|
SSI_SCR1 &= ~SSI_SCR_TE;
|
||||||
|
|
||||||
/* Apply new settings */
|
|
||||||
pcm_apply_settings();
|
|
||||||
|
|
||||||
/* Enable interrupt on unlock */
|
/* Enable interrupt on unlock */
|
||||||
dma_play_data.state = 1;
|
dma_play_data.state = 1;
|
||||||
|
|
||||||
|
|
|
@ -272,8 +272,6 @@ static void play_start_pcm(void)
|
||||||
{
|
{
|
||||||
fiq_function = fiq_playback;
|
fiq_function = fiq_playback;
|
||||||
|
|
||||||
pcm_apply_settings();
|
|
||||||
|
|
||||||
IISCONFIG &= ~IIS_TXFIFOEN; /* Stop transmitting */
|
IISCONFIG &= ~IIS_TXFIFOEN; /* Stop transmitting */
|
||||||
dma_play_data.state = 1;
|
dma_play_data.state = 1;
|
||||||
|
|
||||||
|
@ -379,7 +377,6 @@ void pcm_play_dma_init(void)
|
||||||
void pcm_postinit(void)
|
void pcm_postinit(void)
|
||||||
{
|
{
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
pcm_apply_settings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||||
|
|
|
@ -61,7 +61,6 @@ struct dma_data dma_play_data SHAREDBSS_ATTR =
|
||||||
void pcm_postinit(void)
|
void pcm_postinit(void)
|
||||||
{
|
{
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
pcm_apply_settings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||||
|
@ -115,8 +114,6 @@ void pcm_dma_apply_settings(void)
|
||||||
|
|
||||||
static void play_start_pcm(void)
|
static void play_start_pcm(void)
|
||||||
{
|
{
|
||||||
pcm_apply_settings();
|
|
||||||
|
|
||||||
DAMR &= ~(1<<14); /* disable tx */
|
DAMR &= ~(1<<14); /* disable tx */
|
||||||
dma_play_data.state = 1;
|
dma_play_data.state = 1;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
short __attribute__((section(".dmabuf"))) dma_buf_left[DMA_BUF_SAMPLES];
|
short __attribute__((section(".dmabuf"))) dma_buf_left[DMA_BUF_SAMPLES];
|
||||||
short __attribute__((section(".dmabuf"))) dma_buf_right[DMA_BUF_SAMPLES];
|
short __attribute__((section(".dmabuf"))) dma_buf_right[DMA_BUF_SAMPLES];
|
||||||
|
|
||||||
static int pcm_sampr = HW_SAMPR_DEFAULT; /* 44.1 is default */
|
|
||||||
|
|
||||||
unsigned short* p IBSS_ATTR;
|
unsigned short* p IBSS_ATTR;
|
||||||
size_t p_size IBSS_ATTR;
|
size_t p_size IBSS_ATTR;
|
||||||
|
|
||||||
|
@ -42,8 +40,6 @@ void pcm_play_unlock(void)
|
||||||
|
|
||||||
void pcm_play_dma_start(const void *addr, size_t size)
|
void pcm_play_dma_start(const void *addr, size_t size)
|
||||||
{
|
{
|
||||||
pcm_apply_settings();
|
|
||||||
|
|
||||||
p = (unsigned short*)addr;
|
p = (unsigned short*)addr;
|
||||||
p_size = size;
|
p_size = size;
|
||||||
}
|
}
|
||||||
|
@ -54,8 +50,7 @@ void pcm_play_dma_stop(void)
|
||||||
|
|
||||||
void pcm_play_dma_pause(bool pause)
|
void pcm_play_dma_pause(bool pause)
|
||||||
{
|
{
|
||||||
if (!pause)
|
(void)pause;
|
||||||
pcm_apply_settings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void fill_dma_buf(int offset)
|
static inline void fill_dma_buf(int offset)
|
||||||
|
|
|
@ -96,7 +96,6 @@ void pcm_play_dma_init(void)
|
||||||
void pcm_postinit(void)
|
void pcm_postinit(void)
|
||||||
{
|
{
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
pcm_apply_settings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pcm_dma_apply_settings(void)
|
void pcm_dma_apply_settings(void)
|
||||||
|
@ -110,8 +109,6 @@ static void play_start_pcm(void)
|
||||||
/* clear pending DMA interrupt */
|
/* clear pending DMA interrupt */
|
||||||
SRCPND = DMA2_MASK;
|
SRCPND = DMA2_MASK;
|
||||||
|
|
||||||
pcm_apply_settings();
|
|
||||||
|
|
||||||
/* Flush any pending writes */
|
/* Flush any pending writes */
|
||||||
clean_dcache_range((void*)DISRC2, (DCON2 & 0xFFFFF) * 2);
|
clean_dcache_range((void*)DISRC2, (DCON2 & 0xFFFFF) * 2);
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,6 @@ void pcm_play_dma_init(void)
|
||||||
void pcm_postinit(void)
|
void pcm_postinit(void)
|
||||||
{
|
{
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
pcm_apply_settings();
|
|
||||||
|
|
||||||
/* wake DSP */
|
/* wake DSP */
|
||||||
dsp_wake();
|
dsp_wake();
|
||||||
|
|
|
@ -39,8 +39,6 @@ void pcm_postinit(void)
|
||||||
/* playback sample:16 bits, burst:16 bytes */
|
/* playback sample:16 bits, burst:16 bytes */
|
||||||
__i2s_set_transmit_trigger(4);
|
__i2s_set_transmit_trigger(4);
|
||||||
__i2s_set_oss_sample_size(16);
|
__i2s_set_oss_sample_size(16);
|
||||||
|
|
||||||
pcm_apply_settings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue