pcm: Remove unused function pcm_play_dma_get_peak_buffer()
Change-Id: Ifd20fb14a22489cdb99154c01f69809a1e70d0c5
This commit is contained in:
parent
77ec752248
commit
e532714d1f
23 changed files with 0 additions and 269 deletions
|
@ -121,7 +121,6 @@ pcm_play_dma_status_callback(enum pcm_dma_status status)
|
||||||
void pcm_play_dma_start_int(const void *addr, size_t size);
|
void pcm_play_dma_start_int(const void *addr, size_t size);
|
||||||
void pcm_play_dma_stop_int(void);
|
void pcm_play_dma_stop_int(void);
|
||||||
void pcm_play_stop_int(void);
|
void pcm_play_stop_int(void);
|
||||||
const void *pcm_play_dma_get_peak_buffer_int(int *count);
|
|
||||||
#endif /* HAVE_SW_VOLUME_CONTROL && !PCM_SW_VOLUME_UNBUFFERED */
|
#endif /* HAVE_SW_VOLUME_CONTROL && !PCM_SW_VOLUME_UNBUFFERED */
|
||||||
|
|
||||||
/* Called by the bottom layer ISR when more data is needed. Returns true
|
/* Called by the bottom layer ISR when more data is needed. Returns true
|
||||||
|
@ -145,7 +144,6 @@ void pcm_play_dma_init(void) INIT_ATTR;
|
||||||
void pcm_play_dma_postinit(void);
|
void pcm_play_dma_postinit(void);
|
||||||
void pcm_play_dma_start(const void *addr, size_t size);
|
void pcm_play_dma_start(const void *addr, size_t size);
|
||||||
void pcm_play_dma_stop(void);
|
void pcm_play_dma_stop(void);
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count);
|
|
||||||
|
|
||||||
void pcm_dma_apply_settings(void);
|
void pcm_dma_apply_settings(void);
|
||||||
|
|
||||||
|
|
|
@ -285,23 +285,6 @@ void pcm_play_dma_stop_int(void)
|
||||||
src_buf_rem = 0;
|
src_buf_rem = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return playing buffer from the source buffer */
|
|
||||||
const void * pcm_play_dma_get_peak_buffer_int(int *count)
|
|
||||||
{
|
|
||||||
const void *addr = src_buf_addr;
|
|
||||||
size_t size = src_buf_rem;
|
|
||||||
const void *addr2 = src_buf_addr;
|
|
||||||
|
|
||||||
if (addr == addr2 && size)
|
|
||||||
{
|
|
||||||
*count = size / PCM_SAMPLE_SIZE;
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
*count = 0;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* PCM_SW_VOLUME_UNBUFFERED */
|
#endif /* PCM_SW_VOLUME_UNBUFFERED */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -200,18 +200,6 @@ void pcm_dma_apply_settings(void)
|
||||||
0x01ffffff);
|
0x01ffffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
int oldstatus = disable_irq_save();
|
|
||||||
size_t addr = DMAC_CH_SRC_ADDR(0);
|
|
||||||
size_t start_addr = (size_t)dma_start_addr;
|
|
||||||
size_t start_size = dma_start_size;
|
|
||||||
restore_interrupt(oldstatus);
|
|
||||||
|
|
||||||
*count = (start_size - addr + start_addr) >> 2;
|
|
||||||
return (void*)AS3525_UNCACHED_ADDR(addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_PCM_DMA_ADDRESS
|
#ifdef HAVE_PCM_DMA_ADDRESS
|
||||||
void * pcm_dma_addr(void *addr)
|
void * pcm_dma_addr(void *addr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -175,17 +175,6 @@ void pcm_dma_apply_settings(void)
|
||||||
pcm_play_unlock();
|
pcm_play_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
if(!dac_freezed)
|
|
||||||
imx233_dma_freeze_channel(APB_AUDIO_DAC, true);
|
|
||||||
struct imx233_dma_info_t info = imx233_dma_get_info(APB_AUDIO_DAC, DMA_INFO_AHB_BYTES | DMA_INFO_BAR);
|
|
||||||
if(!dac_freezed)
|
|
||||||
imx233_dma_freeze_channel(APB_AUDIO_DAC, false);
|
|
||||||
*count = info.ahb_bytes;
|
|
||||||
return (void *)info.bar;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Recording
|
* Recording
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -224,34 +224,6 @@ void pcm_play_dma_stop(void)
|
||||||
play_stop_pcm();
|
play_stop_pcm();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return a pointer to the samples and the number of them in *count */
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
static unsigned long dsa NOCACHEBSS_ATTR;
|
|
||||||
unsigned long addr;
|
|
||||||
long offs, size;
|
|
||||||
int oldstatus;
|
|
||||||
|
|
||||||
/* read burst dma source address register in channel context */
|
|
||||||
sdma_read_words(&dsa, CHANNEL_CONTEXT_ADDR(DMA_PLAY_CH_NUM)+0x0b, 1);
|
|
||||||
|
|
||||||
oldstatus = disable_irq_save();
|
|
||||||
addr = dsa;
|
|
||||||
offs = addr - (unsigned long)dma_play_bd.buf_addr;
|
|
||||||
size = dma_play_bd.mode.count;
|
|
||||||
restore_irq(oldstatus);
|
|
||||||
|
|
||||||
/* Be addresses are coherent (no buffer change during read) */
|
|
||||||
if (offs >= 0 && offs < size)
|
|
||||||
{
|
|
||||||
*count = (size - offs) >> 2;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
*count = 0;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void * pcm_dma_addr(void *addr)
|
void * pcm_dma_addr(void *addr)
|
||||||
{
|
{
|
||||||
return (void *)addr_virt_to_phys((unsigned long)addr);
|
return (void *)addr_virt_to_phys((unsigned long)addr);
|
||||||
|
|
|
@ -62,14 +62,6 @@ struct dma_data dma_play_data SHAREDBSS_ATTR =
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
unsigned long addr = (unsigned long)dma_play_data.p;
|
|
||||||
size_t cnt = dma_play_data.size;
|
|
||||||
*count = cnt >> 2;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pcm_play_dma_init(void)
|
void pcm_play_dma_init(void)
|
||||||
{
|
{
|
||||||
DAVC = 0x0; /* Digital Volume = max */
|
DAVC = 0x0; /* Digital Volume = max */
|
||||||
|
|
|
@ -512,19 +512,6 @@ void pcm_play_dma_postinit(void)
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
unsigned long addr, size;
|
|
||||||
|
|
||||||
int status = disable_fiq_save();
|
|
||||||
addr = dma_play_data.addr;
|
|
||||||
size = dma_play_data.size;
|
|
||||||
restore_fiq(status);
|
|
||||||
|
|
||||||
*count = size >> 2;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Recording DMA transfer
|
** Recording DMA transfer
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -263,18 +263,6 @@ void INT_HDMA(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
uint32_t addr;
|
|
||||||
|
|
||||||
int old = disable_irq_save();
|
|
||||||
addr = HDMA_CSRC0;
|
|
||||||
*count = ((HDMA_CCNT0 & 0xffff)<<2);
|
|
||||||
restore_interrupt(old);
|
|
||||||
|
|
||||||
return (void*)addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Recording DMA transfer
|
** Recording DMA transfer
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -219,11 +219,3 @@ void fiq_handler(void)
|
||||||
|
|
||||||
pcm_play_dma_status_callback(PCM_DMAST_STARTED);
|
pcm_play_dma_status_callback(PCM_DMAST_STARTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
unsigned long addr = DCSRC2;
|
|
||||||
int cnt = DSTAT2;
|
|
||||||
*count = (cnt & 0xFFFFF) >> 1;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
}
|
|
||||||
|
|
|
@ -259,11 +259,3 @@ void fiq_handler(void)
|
||||||
|
|
||||||
pcm_play_dma_status_callback(PCM_DMAST_STARTED);
|
pcm_play_dma_status_callback(PCM_DMAST_STARTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
unsigned long addr = DCSRC2;
|
|
||||||
int cnt = DSTAT2;
|
|
||||||
*count = (cnt & 0xFFFFF) >> 1;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
}
|
|
||||||
|
|
|
@ -262,12 +262,6 @@ void pcm_dma_apply_settings(void)
|
||||||
pcm_dma_set_freq(pcm_fsel);
|
pcm_dma_set_freq(pcm_fsel);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
*count = DMACTCNT0 >> 1;
|
|
||||||
return (void *)(((DMACADDR0 + 2) & ~3) | 0x40000000);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_PCM_DMA_ADDRESS
|
#ifdef HAVE_PCM_DMA_ADDRESS
|
||||||
void * pcm_dma_addr(void *addr)
|
void * pcm_dma_addr(void *addr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -216,13 +216,6 @@ void pcm_play_dma_postinit(void)
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
const void* pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
void *addr = dmac_ch_get_info(&dma_play_ch, count, NULL);
|
|
||||||
*count >>= 2; /* bytes to samples */
|
|
||||||
return addr; /* aligned to dest burst */
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_PCM_DMA_ADDRESS
|
#ifdef HAVE_PCM_DMA_ADDRESS
|
||||||
void * pcm_dma_addr(void *addr)
|
void * pcm_dma_addr(void *addr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,12 +52,6 @@ void pcm_play_dma_postinit(void)
|
||||||
// dsp_wake();
|
// dsp_wake();
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
(void) count;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void pcm_dma_apply_settings(void)
|
void pcm_dma_apply_settings(void)
|
||||||
{
|
{
|
||||||
audiohw_set_frequency(pcm_fsel);
|
audiohw_set_frequency(pcm_fsel);
|
||||||
|
|
|
@ -46,22 +46,6 @@ void pcm_play_dma_postinit(void)
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the current location in the SDRAM to SARAM transfer along with the
|
|
||||||
* number of bytes read in the current buffer (count). There is latency with
|
|
||||||
* this method equivalent to ~ the size of the SARAM buffer since there is
|
|
||||||
* another buffer between your ears and this calculation, but this works for
|
|
||||||
* key clicks and an approximate peak meter.
|
|
||||||
*/
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
int cnt = DSP_(_sdem_level);
|
|
||||||
|
|
||||||
unsigned long addr = (unsigned long) start + cnt;
|
|
||||||
|
|
||||||
*count = (cnt & 0xFFFFF) >> 1;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pcm_play_dma_init(void)
|
void pcm_play_dma_init(void)
|
||||||
{
|
{
|
||||||
IO_INTC_IRQ0 = INTR_IRQ0_IMGBUF;
|
IO_INTC_IRQ0 = INTR_IRQ0_IMGBUF;
|
||||||
|
|
|
@ -42,22 +42,6 @@ void pcm_play_dma_postinit(void)
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the current location in the SDRAM to SARAM transfer along with the
|
|
||||||
* number of bytes read in the current buffer (count). There is latency with
|
|
||||||
* this method equivalent to ~ the size of the SARAM buffer since there is
|
|
||||||
* another buffer between your ears and this calculation, but this works for
|
|
||||||
* key clicks and an approximate peak meter.
|
|
||||||
*/
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
int cnt = DSP_(_sdem_level);
|
|
||||||
|
|
||||||
unsigned long addr = (unsigned long) start + cnt;
|
|
||||||
|
|
||||||
*count = (cnt & 0xFFFFF) >> 1;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pcm_play_dma_init(void)
|
void pcm_play_dma_init(void)
|
||||||
{
|
{
|
||||||
/* GIO16 is DSP/AIC3X CLK */
|
/* GIO16 is DSP/AIC3X CLK */
|
||||||
|
|
|
@ -301,21 +301,6 @@ void DMA0(void)
|
||||||
/* else inished playing */
|
/* else inished playing */
|
||||||
} /* DMA0 */
|
} /* DMA0 */
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
unsigned long addr, cnt;
|
|
||||||
|
|
||||||
/* Make sure interrupt doesn't change the second value after we read the
|
|
||||||
* first value. */
|
|
||||||
int level = set_irq_level(DMA_IRQ_LEVEL);
|
|
||||||
addr = SAR0;
|
|
||||||
cnt = BCR0;
|
|
||||||
restore_irq(level);
|
|
||||||
|
|
||||||
*count = (cnt & 0xffffff) >> 2;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
} /* pcm_play_dma_get_peak_buffer */
|
|
||||||
|
|
||||||
#ifdef HAVE_RECORDING
|
#ifdef HAVE_RECORDING
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Recording DMA transfer
|
** Recording DMA transfer
|
||||||
|
|
|
@ -171,13 +171,6 @@ void pcm_play_dma_stop(void)
|
||||||
stop_method);
|
stop_method);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
uintptr_t addr = (uintptr_t)pcm_data_start;
|
|
||||||
*count = pcm_data_size / 4;
|
|
||||||
return (void *)((addr + 3) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pcm_play_dma_init(void)
|
void pcm_play_dma_init(void)
|
||||||
{
|
{
|
||||||
/* in order to have background music playing after leaving the activity,
|
/* in order to have background music playing after leaving the activity,
|
||||||
|
|
|
@ -439,17 +439,6 @@ void pcm_dma_apply_settings(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: WTF */
|
|
||||||
const void* pcm_play_dma_get_peak_buffer(int* count)
|
|
||||||
{
|
|
||||||
TRACE;
|
|
||||||
|
|
||||||
uintptr_t addr = (uintptr_t) _pcm_buffer;
|
|
||||||
*count = _pcm_buffer_size / 4;
|
|
||||||
return (void*) ((addr + 3) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void pcm_close_device(void)
|
void pcm_close_device(void)
|
||||||
{
|
{
|
||||||
TRACE;
|
TRACE;
|
||||||
|
|
|
@ -191,14 +191,6 @@ static void feed_data(GstElement * appsrc, guint size_hint, void *unused)
|
||||||
unlock_audio();
|
unlock_audio();
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
uintptr_t addr = (uintptr_t)pcm_data;
|
|
||||||
*count = pcm_data_size / 4;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_bus_message (GstBus * bus, GstMessage * message, void *unused)
|
gst_bus_message (GstBus * bus, GstMessage * message, void *unused)
|
||||||
{
|
{
|
||||||
|
|
|
@ -775,13 +775,6 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
uintptr_t addr = (uintptr_t)pcm_data;
|
|
||||||
*count = pcm_size / 4;
|
|
||||||
return (void *)((addr + 3) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pcm_play_dma_postinit(void)
|
void pcm_play_dma_postinit(void)
|
||||||
{
|
{
|
||||||
audiohw_postinit();
|
audiohw_postinit();
|
||||||
|
|
|
@ -276,13 +276,6 @@ static void sdl_audio_callback(struct pcm_udata *udata, Uint8 *stream, int len)
|
||||||
SDL_UnlockMutex(audio_lock);
|
SDL_UnlockMutex(audio_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
uintptr_t addr = (uintptr_t)pcm_data;
|
|
||||||
*count = pcm_data_size / 4;
|
|
||||||
return (void *)((addr + 2) & ~3);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_RECORDING
|
#ifdef HAVE_RECORDING
|
||||||
void pcm_rec_lock(void)
|
void pcm_rec_lock(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -203,28 +203,6 @@ static int get_dma_count(void)
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
int flags = disable_irq_save();
|
|
||||||
|
|
||||||
const void* addr;
|
|
||||||
if(REG_DMAC_DCCSR(DMA_AIC_TX_CHANNEL) & DMAC_DCCSR_EN)
|
|
||||||
{
|
|
||||||
int bytes = get_dma_count();
|
|
||||||
*count = bytes >> 2;
|
|
||||||
addr = (const void*)((int)(playback_address + bytes + 2) & ~3);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*count = 0;
|
|
||||||
addr = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
restore_irq(flags);
|
|
||||||
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void audiohw_close(void)
|
void audiohw_close(void)
|
||||||
{
|
{
|
||||||
/* TODO: prevent pop */
|
/* TODO: prevent pop */
|
||||||
|
|
|
@ -191,25 +191,3 @@ static int get_dma_count(void)
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
|
||||||
{
|
|
||||||
int flags = disable_irq_save();
|
|
||||||
|
|
||||||
const void* addr;
|
|
||||||
if(REG_DMAC_DCCSR(DMA_AIC_TX_CHANNEL) & DMAC_DCCSR_EN)
|
|
||||||
{
|
|
||||||
int bytes = get_dma_count();
|
|
||||||
*count = bytes >> 2;
|
|
||||||
addr = (const void*)((int)(playback_address + bytes + 2) & ~3);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
*count = 0;
|
|
||||||
addr = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
restore_irq(flags);
|
|
||||||
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue