pcm: Further cleanup of unused bits of the PCM ACPI:
* pcm_get_bytes_remaining() * pcm_calculate_peaks() * pcm_get_peak_buffer() Nothing in-tree uses these at all (except for the lua plugin wrapper) Change-Id: I971b7beed6760250c8b1ce58f401a601e1e2d585
This commit is contained in:
parent
1a68856f52
commit
388adff3cc
|
@ -602,9 +602,6 @@ static const struct plugin_api rockbox_api = {
|
|||
pcm_play_stop,
|
||||
pcm_set_frequency,
|
||||
pcm_is_playing,
|
||||
pcm_get_bytes_waiting,
|
||||
pcm_calculate_peaks,
|
||||
pcm_get_peak_buffer,
|
||||
pcm_play_lock,
|
||||
pcm_play_unlock,
|
||||
beep_play,
|
||||
|
|
|
@ -155,12 +155,12 @@ int plugin_open(char *plugin, char *parameter);
|
|||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||
|
||||
/* increase this every time the api struct changes */
|
||||
#define PLUGIN_API_VERSION 243
|
||||
#define PLUGIN_API_VERSION 244
|
||||
|
||||
/* update this to latest version if a change to the api struct breaks
|
||||
backwards compatibility (and please take the opportunity to sort in any
|
||||
new function which are "waiting" at the end of the function table) */
|
||||
#define PLUGIN_MIN_API_VERSION 243
|
||||
#define PLUGIN_MIN_API_VERSION 244
|
||||
|
||||
/* 239 Marks the removal of ARCHOS HWCODEC and CHARCELL */
|
||||
|
||||
|
@ -677,9 +677,6 @@ struct plugin_api {
|
|||
void (*pcm_play_stop)(void);
|
||||
void (*pcm_set_frequency)(unsigned int frequency);
|
||||
bool (*pcm_is_playing)(void);
|
||||
size_t (*pcm_get_bytes_waiting)(void);
|
||||
void (*pcm_calculate_peaks)(int *left, int *right);
|
||||
const void* (*pcm_get_peak_buffer)(int *count);
|
||||
void (*pcm_play_lock)(void);
|
||||
void (*pcm_play_unlock)(void);
|
||||
void (*beep_play)(unsigned int frequency, unsigned int duration,
|
||||
|
|
|
@ -30,5 +30,3 @@ rb.pcm_play_stop = function() rb.pcm("play_stop") end
|
|||
rb.pcm_play_lock = function() rb.pcm("play_lock") end
|
||||
rb.pcm_play_unlock = function() rb.pcm("play_unlock") end
|
||||
rb.pcm_is_playing = function() return rb.pcm("is_playing") end
|
||||
rb.pcm_calculate_peaks = function() return rb.pcm("calculate_peaks") end
|
||||
rb.pcm_get_bytes_waiting = function() return rb.pcm("get_bytes_waiting") end
|
||||
|
|
|
@ -521,14 +521,12 @@ RB_WRAP(pcm)
|
|||
{
|
||||
enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING,
|
||||
PCM_PLAYSTOP, PCM_PLAYLOCK, PCM_PLAYUNLOCK,
|
||||
PCM_CALCULATEPEAKS, PCM_SETFREQUENCY, PCM_GETBYTESWAITING, PCM_ECOUNT};
|
||||
PCM_SETFREQUENCY, PCM_ECOUNT};
|
||||
|
||||
const char *pcm_option[] = {"apply_settings", "is_playing",
|
||||
"play_stop", "play_lock", "play_unlock",
|
||||
"calculate_peaks", "set_frequency", "get_bytes_waiting", NULL};
|
||||
"set_frequency", NULL};
|
||||
bool b_result;
|
||||
int left, right;
|
||||
size_t byteswait;
|
||||
|
||||
lua_pushnil(L); /*push nil so options w/o return have something to return */
|
||||
|
||||
|
@ -551,18 +549,9 @@ RB_WRAP(pcm)
|
|||
case PCM_PLAYUNLOCK:
|
||||
rb->pcm_play_unlock();
|
||||
break;
|
||||
case PCM_CALCULATEPEAKS:
|
||||
rb->pcm_calculate_peaks(&left, &right);
|
||||
lua_pushinteger(L, left);
|
||||
lua_pushinteger(L, right);
|
||||
return 2;
|
||||
case PCM_SETFREQUENCY:
|
||||
rb->pcm_set_frequency((unsigned int) luaL_checkint(L, 2));
|
||||
break;
|
||||
case PCM_GETBYTESWAITING:
|
||||
byteswait = rb->pcm_get_bytes_waiting();
|
||||
lua_pushinteger(L, byteswait);
|
||||
break;
|
||||
}
|
||||
|
||||
yield();
|
||||
|
|
|
@ -1402,12 +1402,6 @@ void pcm_apply_settings(void)
|
|||
\group sound
|
||||
\description
|
||||
|
||||
void pcm_calculate_peaks(int *left, int *right)
|
||||
\group sound
|
||||
\param left
|
||||
\param right
|
||||
\description
|
||||
|
||||
void pcm_calculate_rec_peaks(int *left, int *right)
|
||||
\group sound
|
||||
\conditions defined(HAVE_RECORDING)
|
||||
|
@ -1420,11 +1414,6 @@ void pcm_close_recording(void)
|
|||
\conditions defined(HAVE_RECORDING)
|
||||
\description
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
\group sound
|
||||
\return
|
||||
\description
|
||||
|
||||
void pcm_init_recording(void)
|
||||
\group sound
|
||||
\conditions defined(HAVE_RECORDING)
|
||||
|
|
|
@ -85,10 +85,6 @@ struct pcm_peaks
|
|||
long tick; /* Last tick called */
|
||||
};
|
||||
|
||||
void pcm_calculate_peaks(int *left, int *right);
|
||||
const void* pcm_get_peak_buffer(int* count);
|
||||
size_t pcm_get_bytes_waiting(void);
|
||||
|
||||
void pcm_play_stop(void);
|
||||
bool pcm_is_playing(void);
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
* ==Playback==
|
||||
* Public -
|
||||
* pcm_postinit
|
||||
* pcm_get_bytes_waiting
|
||||
* pcm_play_lock
|
||||
* pcm_play_unlock
|
||||
* Semi-private -
|
||||
|
@ -47,7 +46,6 @@
|
|||
* pcm_play_dma_postinit
|
||||
* pcm_play_dma_start
|
||||
* pcm_play_dma_stop
|
||||
* pcm_play_dma_get_peak_buffer
|
||||
* Data Read/Written within TSP -
|
||||
* pcm_sampr (R)
|
||||
* pcm_fsel (R)
|
||||
|
@ -118,11 +116,6 @@ static inline void pcm_play_dma_stop_int(void)
|
|||
pcm_play_dma_stop();
|
||||
}
|
||||
|
||||
static inline const void * pcm_play_dma_get_peak_buffer_int(int *count)
|
||||
{
|
||||
return pcm_play_dma_get_peak_buffer(count);
|
||||
}
|
||||
|
||||
bool pcm_play_dma_complete_callback(enum pcm_dma_status status,
|
||||
const void **addr, size_t *size)
|
||||
{
|
||||
|
@ -244,28 +237,6 @@ void pcm_do_peak_calculation(struct pcm_peaks *peaks, bool active,
|
|||
}
|
||||
}
|
||||
|
||||
void pcm_calculate_peaks(int *left, int *right)
|
||||
{
|
||||
/* peak data for the global peak values - i.e. what the final output is */
|
||||
static struct pcm_peaks peaks;
|
||||
|
||||
int count;
|
||||
const void *addr = pcm_play_dma_get_peak_buffer_int(&count);
|
||||
|
||||
pcm_do_peak_calculation(&peaks, pcm_playing, addr, count);
|
||||
|
||||
if (left)
|
||||
*left = peaks.left;
|
||||
|
||||
if (right)
|
||||
*right = peaks.right;
|
||||
}
|
||||
|
||||
const void * pcm_get_peak_buffer(int *count)
|
||||
{
|
||||
return pcm_play_dma_get_peak_buffer_int(count);
|
||||
}
|
||||
|
||||
bool pcm_is_playing(void)
|
||||
{
|
||||
return pcm_playing;
|
||||
|
|
|
@ -200,17 +200,6 @@ void pcm_dma_apply_settings(void)
|
|||
0x01ffffff);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
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);
|
||||
|
||||
return start_size - addr + start_addr;
|
||||
}
|
||||
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
int oldstatus = disable_irq_save();
|
||||
|
|
|
@ -175,12 +175,6 @@ void pcm_dma_apply_settings(void)
|
|||
pcm_play_unlock();
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
struct imx233_dma_info_t info = imx233_dma_get_info(APB_AUDIO_DAC, DMA_INFO_AHB_BYTES);
|
||||
return info.ahb_bytes;
|
||||
}
|
||||
|
||||
const void *pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
if(!dac_freezed)
|
||||
|
|
|
@ -224,30 +224,6 @@ void pcm_play_dma_stop(void)
|
|||
play_stop_pcm();
|
||||
}
|
||||
|
||||
/* Return the number of bytes waiting - full L-R sample pairs only */
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
static unsigned long dsa NOCACHEBSS_ATTR;
|
||||
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();
|
||||
offs = dsa - (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)
|
||||
{
|
||||
return (size - offs) & ~3;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return a pointer to the samples and the number of them in *count */
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
|
|
|
@ -194,11 +194,6 @@ void pcm_play_unlock(void)
|
|||
restore_fiq(status);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return dma_play_data.size & ~3;
|
||||
}
|
||||
|
||||
#ifdef HAVE_RECORDING
|
||||
/* TODO: implement */
|
||||
void pcm_rec_dma_init(void)
|
||||
|
|
|
@ -192,11 +192,6 @@ void pcm_dma_apply_settings(void)
|
|||
{
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return p_size & ~3;
|
||||
}
|
||||
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
unsigned long addr = (unsigned long)p;
|
||||
|
|
|
@ -497,11 +497,6 @@ void pcm_play_dma_stop(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return dma_play_data.size & ~3;
|
||||
}
|
||||
|
||||
void pcm_play_dma_init(void)
|
||||
{
|
||||
/* Initialize default register values. */
|
||||
|
|
|
@ -250,12 +250,6 @@ void pcm_dma_apply_settings(void)
|
|||
audiohw_set_frequency(pcm_fsel);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
/* current terminate count is in transfer size units (4bytes here) */
|
||||
return (HDMA_CCNT0 & 0xffff)<<2;
|
||||
}
|
||||
|
||||
/* audio DMA ISR called when chunk from callers buffer has been transfered */
|
||||
void INT_HDMA(void)
|
||||
{
|
||||
|
|
|
@ -220,12 +220,6 @@ void fiq_handler(void)
|
|||
pcm_play_dma_status_callback(PCM_DMAST_STARTED);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
/* lie a little and only return full pairs */
|
||||
return (DSTAT2 & 0xFFFFE) * 2;
|
||||
}
|
||||
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
unsigned long addr = DCSRC2;
|
||||
|
|
|
@ -260,12 +260,6 @@ void fiq_handler(void)
|
|||
pcm_play_dma_status_callback(PCM_DMAST_STARTED);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
/* lie a little and only return full pairs */
|
||||
return (DSTAT2 & 0xFFFFE) * 2;
|
||||
}
|
||||
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
unsigned long addr = DCSRC2;
|
||||
|
|
|
@ -262,11 +262,6 @@ void pcm_dma_apply_settings(void)
|
|||
pcm_dma_set_freq(pcm_fsel);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return (nextsize + DMACTCNT0 + 2) << 1;
|
||||
}
|
||||
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
*count = DMACTCNT0 >> 1;
|
||||
|
|
|
@ -216,13 +216,6 @@ void pcm_play_dma_postinit(void)
|
|||
audiohw_postinit();
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
size_t total_bytes;
|
||||
dmac_ch_get_info(&dma_play_ch, NULL, &total_bytes);
|
||||
return total_bytes;
|
||||
}
|
||||
|
||||
const void* pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
void *addr = dmac_ch_get_info(&dma_play_ch, count, NULL);
|
||||
|
|
|
@ -84,8 +84,3 @@ void pcm_play_unlock(void)
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -120,11 +120,6 @@ void pcm_play_unlock(void)
|
|||
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return DSP_(_sdem_dsp_size)-DSP_(_sdem_level);
|
||||
}
|
||||
|
||||
/* Only used when debugging */
|
||||
static char buffer[80];
|
||||
|
||||
|
|
|
@ -127,11 +127,6 @@ void pcm_play_unlock(void)
|
|||
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return DSP_(_sdem_dsp_size)-DSP_(_sdem_level);
|
||||
}
|
||||
|
||||
/* Only used when debugging */
|
||||
static char buffer[80];
|
||||
|
||||
|
|
|
@ -264,11 +264,6 @@ void pcm_play_dma_stop(void)
|
|||
dma_play_lock.state = (1 << 14);
|
||||
} /* pcm_play_dma_stop */
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return BCR0 & 0xffffff;
|
||||
} /* pcm_get_bytes_waiting */
|
||||
|
||||
/* DMA0 Interrupt is called when the DMA has finished transfering a chunk
|
||||
from the caller's buffer */
|
||||
void DMA0(void) __attribute__ ((interrupt_handler, section(".icode")));
|
||||
|
|
|
@ -171,11 +171,6 @@ void pcm_play_dma_stop(void)
|
|||
stop_method);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return pcm_data_size;
|
||||
}
|
||||
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
uintptr_t addr = (uintptr_t)pcm_data_start;
|
||||
|
|
|
@ -439,15 +439,6 @@ void pcm_dma_apply_settings(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
TRACE;
|
||||
|
||||
return _pcm_buffer_size;
|
||||
}
|
||||
|
||||
|
||||
/* TODO: WTF */
|
||||
const void* pcm_play_dma_get_peak_buffer(int* count)
|
||||
{
|
||||
|
|
|
@ -154,11 +154,6 @@ void pcm_play_dma_stop(void)
|
|||
gst_element_set_state (GST_ELEMENT(gst_pipeline), GST_STATE_NULL);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return pcm_data_size;
|
||||
}
|
||||
|
||||
static void feed_data(GstElement * appsrc, guint size_hint, void *unused)
|
||||
{
|
||||
(void)size_hint;
|
||||
|
|
|
@ -735,11 +735,6 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
|||
}
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return pcm_size;
|
||||
}
|
||||
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
uintptr_t addr = (uintptr_t)pcm_data;
|
||||
|
|
|
@ -124,11 +124,6 @@ void pcm_play_dma_stop(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return pcm_data_size;
|
||||
}
|
||||
|
||||
static void write_to_soundcard(struct pcm_udata *udata)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -203,20 +203,6 @@ static int get_dma_count(void)
|
|||
return count;
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
int bytes, flags = disable_irq_save();
|
||||
|
||||
if(REG_DMAC_DCCSR(DMA_AIC_TX_CHANNEL) & DMAC_DCCSR_EN)
|
||||
bytes = get_dma_count() & ~3;
|
||||
else
|
||||
bytes = 0;
|
||||
|
||||
restore_irq(flags);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
int flags = disable_irq_save();
|
||||
|
|
|
@ -192,20 +192,6 @@ static int get_dma_count(void)
|
|||
return count;
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
int bytes, flags = disable_irq_save();
|
||||
|
||||
if(REG_DMAC_DCCSR(DMA_AIC_TX_CHANNEL) & DMAC_DCCSR_EN)
|
||||
bytes = get_dma_count() & ~3;
|
||||
else
|
||||
bytes = 0;
|
||||
|
||||
restore_irq(flags);
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count)
|
||||
{
|
||||
int flags = disable_irq_save();
|
||||
|
|
Loading…
Reference in New Issue