pcm: Get rid of pcm_play_pause() and associated APIs
Nothing in the core has used it for some time. It's exported to the plugin API but the last plugins to use it were switched to the mixer API back in 2011. This allows us to get rid of pcm_play_dma_pause() from all audio drivers Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
This commit is contained in:
parent
2d85c72151
commit
fe2d52cc7d
35 changed files with 20 additions and 388 deletions
|
@ -602,8 +602,6 @@ static const struct plugin_api rockbox_api = {
|
|||
pcm_play_stop,
|
||||
pcm_set_frequency,
|
||||
pcm_is_playing,
|
||||
pcm_is_paused,
|
||||
pcm_play_pause,
|
||||
pcm_get_bytes_waiting,
|
||||
pcm_calculate_peaks,
|
||||
pcm_get_peak_buffer,
|
||||
|
|
|
@ -677,8 +677,6 @@ struct plugin_api {
|
|||
void (*pcm_play_stop)(void);
|
||||
void (*pcm_set_frequency)(unsigned int frequency);
|
||||
bool (*pcm_is_playing)(void);
|
||||
bool (*pcm_is_paused)(void);
|
||||
void (*pcm_play_pause)(bool play);
|
||||
size_t (*pcm_get_bytes_waiting)(void);
|
||||
void (*pcm_calculate_peaks)(int *left, int *right);
|
||||
const void* (*pcm_get_peak_buffer)(int *count);
|
||||
|
|
|
@ -26,11 +26,9 @@ if not rb.pcm then rb.splash(rb.HZ, "No Support!") return nil end
|
|||
|
||||
rb.pcm_apply_settings = function() rb.pcm("apply_settings") end
|
||||
rb.pcm_set_frequency = function(freq) rb.pcm("set_frequency", freq) end
|
||||
rb.pcm_play_pause = function(bplay) rb.pcm("play_pause", bplay) end
|
||||
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_is_paused = function() return rb.pcm("is_paused") 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
|
||||
|
|
|
@ -519,12 +519,12 @@ RB_WRAP(sound)
|
|||
|
||||
RB_WRAP(pcm)
|
||||
{
|
||||
enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING, PCM_ISPAUSED,
|
||||
PCM_PLAYSTOP, PCM_PLAYPAUSE, PCM_PLAYLOCK, PCM_PLAYUNLOCK,
|
||||
enum e_pcm {PCM_APPLYSETTINGS = 0, PCM_ISPLAYING,
|
||||
PCM_PLAYSTOP, PCM_PLAYLOCK, PCM_PLAYUNLOCK,
|
||||
PCM_CALCULATEPEAKS, PCM_SETFREQUENCY, PCM_GETBYTESWAITING, PCM_ECOUNT};
|
||||
|
||||
const char *pcm_option[] = {"apply_settings", "is_playing", "is_paused",
|
||||
"play_stop", "play_pause", "play_lock", "play_unlock",
|
||||
const char *pcm_option[] = {"apply_settings", "is_playing",
|
||||
"play_stop", "play_lock", "play_unlock",
|
||||
"calculate_peaks", "set_frequency", "get_bytes_waiting", NULL};
|
||||
bool b_result;
|
||||
int left, right;
|
||||
|
@ -542,13 +542,6 @@ RB_WRAP(pcm)
|
|||
b_result = rb->pcm_is_playing();
|
||||
lua_pushboolean(L, b_result);
|
||||
break;
|
||||
case PCM_ISPAUSED:
|
||||
b_result = rb->pcm_is_paused();
|
||||
lua_pushboolean(L, b_result);
|
||||
break;
|
||||
case PCM_PLAYPAUSE:
|
||||
rb->pcm_play_pause(luaL_checkboolean(L, 2));
|
||||
break;
|
||||
case PCM_PLAYSTOP:
|
||||
rb->pcm_play_stop();
|
||||
break;
|
||||
|
|
|
@ -1430,11 +1430,6 @@ void pcm_init_recording(void)
|
|||
\conditions defined(HAVE_RECORDING)
|
||||
\description
|
||||
|
||||
bool pcm_is_paused(void)
|
||||
\group sound
|
||||
\return true if playback is paused, else false
|
||||
\description
|
||||
|
||||
bool pcm_is_playing(void)
|
||||
\group sound
|
||||
\return true unless playback is paused
|
||||
|
@ -1451,14 +1446,9 @@ void pcm_play_lock(void)
|
|||
\group sound
|
||||
\description
|
||||
|
||||
void pcm_play_pause(bool play)
|
||||
\group sound
|
||||
\param play
|
||||
\description Pauses or unpauses the playback depending on the truth value of =play=
|
||||
|
||||
void pcm_play_stop(void)
|
||||
\group sound
|
||||
\description Stops the playback and empties the audio buffer unlike [F[pcm_play_pause]]
|
||||
\description Stops the playback and empties the audio buffer.
|
||||
|
||||
void pcm_play_unlock(void)
|
||||
\group sound
|
||||
|
|
|
@ -71,7 +71,7 @@ void audiohw_preinit(void)
|
|||
{
|
||||
alsa_controls_init();
|
||||
hw_open();
|
||||
#if defined(AUDIOHW_MUTE_ON_PAUSE) || defined (AUDIOHW_NEEDS_INITIAL_UNMUTE)
|
||||
#if defined(AUDIOHW_MUTE_ON_STOP) || defined(AUDIOHW_NEEDS_INITIAL_UNMUTE)
|
||||
audiohw_mute(true); /* Start muted to avoid the POP */
|
||||
#else
|
||||
audiohw_mute(false);
|
||||
|
|
|
@ -7,6 +7,6 @@ AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -100, 0, -30)
|
|||
AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 4, 0)
|
||||
#endif
|
||||
|
||||
#define AUDIOHW_MUTE_ON_PAUSE
|
||||
#define AUDIOHW_MUTE_ON_STOP
|
||||
|
||||
void audiohw_mute(int mute);
|
||||
|
|
|
@ -119,7 +119,6 @@ pcm_play_dma_status_callback(enum pcm_dma_status status)
|
|||
|
||||
#if defined(HAVE_SW_VOLUME_CONTROL) && !defined(PCM_SW_VOLUME_UNBUFFERED)
|
||||
void pcm_play_dma_start_int(const void *addr, size_t size);
|
||||
void pcm_play_dma_pause_int(bool pause);
|
||||
void pcm_play_dma_stop_int(void);
|
||||
void pcm_play_stop_int(void);
|
||||
const void *pcm_play_dma_get_peak_buffer_int(int *count);
|
||||
|
@ -139,7 +138,6 @@ void * pcm_dma_addr(void *addr);
|
|||
#endif
|
||||
|
||||
extern volatile bool pcm_playing;
|
||||
extern volatile bool pcm_paused;
|
||||
|
||||
void pcm_play_dma_lock(void);
|
||||
void pcm_play_dma_unlock(void);
|
||||
|
@ -147,7 +145,6 @@ void pcm_play_dma_init(void) INIT_ATTR;
|
|||
void pcm_play_dma_postinit(void);
|
||||
void pcm_play_dma_start(const void *addr, size_t size);
|
||||
void pcm_play_dma_stop(void);
|
||||
void pcm_play_dma_pause(bool pause);
|
||||
const void * pcm_play_dma_get_peak_buffer(int *count);
|
||||
|
||||
void pcm_dma_apply_settings(void);
|
||||
|
|
|
@ -90,8 +90,6 @@ const void* pcm_get_peak_buffer(int* count);
|
|||
size_t pcm_get_bytes_waiting(void);
|
||||
|
||||
void pcm_play_stop(void);
|
||||
void pcm_play_pause(bool play);
|
||||
bool pcm_is_paused(void);
|
||||
bool pcm_is_playing(void);
|
||||
|
||||
#ifdef HAVE_RECORDING
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
AUDIOHW_SETTING(VOLUME, "dB", 1, 5, -115*10, 0, -30*10)
|
||||
#endif
|
||||
|
||||
//#define AUDIOHW_MUTE_ON_PAUSE
|
||||
//#define AUDIOHW_MUTE_ON_STOP
|
||||
//#define AUDIOHW_NEEDS_INITIAL_UNMUTE
|
||||
|
||||
/* Note: Due to Kernel bug, we can't use MUTE_ON_PAUSE with backlight fading */
|
||||
|
|
|
@ -7,7 +7,7 @@ AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 4, 0)
|
|||
#endif
|
||||
|
||||
// We want this, but the codec takes over a second to unmute!
|
||||
//#define AUDIOHW_MUTE_ON_PAUSE
|
||||
//#define AUDIOHW_MUTE_ON_STOP
|
||||
|
||||
#if defined(XDUOO_X3II)
|
||||
/* The AK4490 glitches when switching sample rates */
|
||||
|
|
|
@ -47,14 +47,12 @@
|
|||
* pcm_play_dma_postinit
|
||||
* pcm_play_dma_start
|
||||
* pcm_play_dma_stop
|
||||
* pcm_play_dma_pause
|
||||
* pcm_play_dma_get_peak_buffer
|
||||
* Data Read/Written within TSP -
|
||||
* pcm_sampr (R)
|
||||
* pcm_fsel (R)
|
||||
* pcm_curr_sampr (R)
|
||||
* pcm_playing (R)
|
||||
* pcm_paused (R)
|
||||
*
|
||||
* ==Playback/Recording==
|
||||
* Public -
|
||||
|
@ -93,8 +91,6 @@ volatile pcm_status_callback_type
|
|||
pcm_play_status_callback SHAREDBSS_ATTR = NULL;
|
||||
/* PCM playback state */
|
||||
volatile bool pcm_playing SHAREDBSS_ATTR = false;
|
||||
/* PCM paused state. paused implies playing */
|
||||
volatile bool pcm_paused SHAREDBSS_ATTR = false;
|
||||
/* samplerate of currently playing audio - undefined if stopped */
|
||||
unsigned long pcm_curr_sampr SHAREDBSS_ATTR = 0;
|
||||
/* samplerate waiting to be set */
|
||||
|
@ -103,7 +99,6 @@ unsigned long pcm_sampr SHAREDBSS_ATTR = HW_SAMPR_DEFAULT;
|
|||
int pcm_fsel SHAREDBSS_ATTR = HW_FREQ_DEFAULT;
|
||||
|
||||
static void pcm_play_data_start_int(const void *addr, size_t size);
|
||||
static void pcm_play_pause_int(bool play);
|
||||
void pcm_play_stop_int(void);
|
||||
|
||||
#if !defined(HAVE_SW_VOLUME_CONTROL) || defined(PCM_SW_VOLUME_UNBUFFERED)
|
||||
|
@ -118,19 +113,6 @@ static inline void pcm_play_dma_start_int(const void *addr, size_t size)
|
|||
pcm_play_dma_start(addr, size);
|
||||
}
|
||||
|
||||
static inline void pcm_play_dma_pause_int(bool pause)
|
||||
{
|
||||
if (pause || pcm_get_bytes_waiting() > 0)
|
||||
{
|
||||
pcm_play_dma_pause(pause);
|
||||
}
|
||||
else
|
||||
{
|
||||
logf(" no data");
|
||||
pcm_play_data_start_int(NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void pcm_play_dma_stop_int(void)
|
||||
{
|
||||
pcm_play_dma_stop();
|
||||
|
@ -167,7 +149,6 @@ static void pcm_play_data_start_int(const void *addr, size_t size)
|
|||
logf(" pcm_play_dma_start_int");
|
||||
pcm_play_dma_start_int(addr, size);
|
||||
pcm_playing = true;
|
||||
pcm_paused = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -177,22 +158,11 @@ static void pcm_play_data_start_int(const void *addr, size_t size)
|
|||
}
|
||||
}
|
||||
|
||||
static void pcm_play_pause_int(bool play)
|
||||
{
|
||||
if (play)
|
||||
pcm_apply_settings();
|
||||
|
||||
logf(" pcm_play_dma_pause_int");
|
||||
pcm_play_dma_pause_int(!play);
|
||||
pcm_paused = !play && pcm_playing;
|
||||
}
|
||||
|
||||
void pcm_play_stop_int(void)
|
||||
{
|
||||
pcm_play_dma_stop_int();
|
||||
pcm_callback_for_more = NULL;
|
||||
pcm_play_status_callback = NULL;
|
||||
pcm_paused = false;
|
||||
pcm_playing = false;
|
||||
}
|
||||
|
||||
|
@ -282,8 +252,7 @@ void pcm_calculate_peaks(int *left, int *right)
|
|||
int count;
|
||||
const void *addr = pcm_play_dma_get_peak_buffer_int(&count);
|
||||
|
||||
pcm_do_peak_calculation(&peaks, pcm_playing && !pcm_paused,
|
||||
addr, count);
|
||||
pcm_do_peak_calculation(&peaks, pcm_playing, addr, count);
|
||||
|
||||
if (left)
|
||||
*left = peaks.left;
|
||||
|
@ -302,11 +271,6 @@ bool pcm_is_playing(void)
|
|||
return pcm_playing;
|
||||
}
|
||||
|
||||
bool pcm_is_paused(void)
|
||||
{
|
||||
return pcm_paused;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Functions that do not require targeted implementation but only a targeted
|
||||
* interface
|
||||
|
@ -358,21 +322,6 @@ void pcm_play_data(pcm_play_callback_type get_more,
|
|||
pcm_play_unlock();
|
||||
}
|
||||
|
||||
void pcm_play_pause(bool play)
|
||||
{
|
||||
logf("pcm_play_pause: %s", play ? "play" : "pause");
|
||||
|
||||
pcm_play_lock();
|
||||
|
||||
if (play == pcm_paused && pcm_playing)
|
||||
{
|
||||
logf(" pcm_play_pause_int");
|
||||
pcm_play_pause_int(play);
|
||||
}
|
||||
|
||||
pcm_play_unlock();
|
||||
}
|
||||
|
||||
void pcm_play_stop(void)
|
||||
{
|
||||
logf("pcm_play_stop");
|
||||
|
|
|
@ -278,16 +278,6 @@ void pcm_play_dma_start_int(const void *addr, size_t size)
|
|||
start_pcm(true);
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause_int(bool pause)
|
||||
{
|
||||
if (pause)
|
||||
pcm_play_dma_pause(true);
|
||||
else if (src_buf_rem)
|
||||
start_pcm(false); /* Reprocess in case volume level changed */
|
||||
else
|
||||
pcm_play_stop_int(); /* Playing frame was last frame */
|
||||
}
|
||||
|
||||
void pcm_play_dma_stop_int(void)
|
||||
{
|
||||
pcm_play_dma_stop();
|
||||
|
|
|
@ -152,26 +152,6 @@ void pcm_play_dma_stop(void)
|
|||
play_callback_pending = false;
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
is_playing = !pause;
|
||||
|
||||
if(pause)
|
||||
{
|
||||
dma_pause_channel(0);
|
||||
|
||||
/* if producer's buffer finished, upper layer starts anew */
|
||||
if (dma_rem_size == 0)
|
||||
play_callback_pending = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (play_sub_size != 0)
|
||||
dma_resume_channel(0);
|
||||
/* else unlock calls the callback if sub buffers remain */
|
||||
}
|
||||
}
|
||||
|
||||
void pcm_play_dma_init(void)
|
||||
{
|
||||
bitset32(&CGU_PERI, CGU_I2SOUT_APB_CLOCK_ENABLE);
|
||||
|
|
|
@ -149,12 +149,6 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
|||
pcm_play_unlock();
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
imx233_dma_freeze_channel(APB_AUDIO_DAC, pause);
|
||||
dac_freezed = pause;
|
||||
}
|
||||
|
||||
void pcm_play_dma_init(void)
|
||||
{
|
||||
audiohw_preinit();
|
||||
|
|
|
@ -224,20 +224,6 @@ void pcm_play_dma_stop(void)
|
|||
play_stop_pcm();
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause)
|
||||
{
|
||||
sdma_channel_pause(DMA_PLAY_CH_NUM);
|
||||
play_stop_pcm();
|
||||
}
|
||||
else
|
||||
{
|
||||
play_start_pcm();
|
||||
sdma_channel_run(DMA_PLAY_CH_NUM);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the number of bytes waiting - full L-R sample pairs only */
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
|
|
|
@ -194,15 +194,6 @@ void pcm_play_unlock(void)
|
|||
restore_fiq(status);
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause) {
|
||||
play_stop_pcm();
|
||||
} else {
|
||||
play_start_pcm();
|
||||
}
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return dma_play_data.size & ~3;
|
||||
|
|
|
@ -49,11 +49,6 @@ void pcm_play_dma_stop(void)
|
|||
{
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
(void)pause;
|
||||
}
|
||||
|
||||
static inline void fill_dma_buf(int offset)
|
||||
{
|
||||
short *l, *r, *lend;
|
||||
|
@ -62,7 +57,7 @@ static inline void fill_dma_buf(int offset)
|
|||
lend = l + DMA_BUF_SAMPLES / 2;
|
||||
r = dma_buf_right + offset;
|
||||
|
||||
if (pcm_playing && !pcm_paused)
|
||||
if (pcm_playing)
|
||||
{
|
||||
bool new_buffer =false;
|
||||
|
||||
|
|
|
@ -497,15 +497,6 @@ void pcm_play_dma_stop(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause) {
|
||||
play_stop_pcm();
|
||||
} else {
|
||||
play_start_pcm();
|
||||
}
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return dma_play_data.size & ~3;
|
||||
|
|
|
@ -114,21 +114,6 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
|||
hdma_i2s_transfer(addr, size);
|
||||
}
|
||||
|
||||
/* pause DMA transfer by disabling clock to DMA module */
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if(pause)
|
||||
{
|
||||
SCU_CLKCFG |= CLKCFG_HDMA;
|
||||
locked = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
SCU_CLKCFG &= ~CLKCFG_HDMA;
|
||||
locked = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void i2s_init(void)
|
||||
{
|
||||
#if defined(HAVE_RK27XX_CODEC)
|
||||
|
|
|
@ -195,24 +195,6 @@ void pcm_play_dma_stop(void)
|
|||
bitclr32(&CLKCON, 1<<17);
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause)
|
||||
{
|
||||
/* pause playback on current buffer */
|
||||
play_stop_pcm();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* restart playback on current buffer */
|
||||
/* make sure we're aligned on left channel - skip any right
|
||||
channel sample left waiting */
|
||||
DISRC2 = (DCSRC2 + 2) & ~0x3;
|
||||
DCON2 = DMA_CONTROL_SETUP | (DSTAT2 & 0xFFFFE);
|
||||
play_start_pcm();
|
||||
}
|
||||
}
|
||||
|
||||
void fiq_handler(void)
|
||||
{
|
||||
static const void *start;
|
||||
|
|
|
@ -235,24 +235,6 @@ void pcm_play_dma_stop(void)
|
|||
bitclr32(&CLKCON, 1<<17);
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause)
|
||||
{
|
||||
/* pause playback on current buffer */
|
||||
play_stop_pcm();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* restart playback on current buffer */
|
||||
/* make sure we're aligned on left channel - skip any right
|
||||
channel sample left waiting */
|
||||
DISRC2 = (DCSRC2 + 2) & ~0x3;
|
||||
DCON2 = DMA_CONTROL_SETUP | (DSTAT2 & 0xFFFFE);
|
||||
play_start_pcm();
|
||||
}
|
||||
}
|
||||
|
||||
void fiq_handler(void)
|
||||
{
|
||||
static const void *start;
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
/* Driver for the IIS/PCM part of the s5l8700 using DMA
|
||||
|
||||
Notes:
|
||||
- pcm_play_dma_pause is untested, not sure if implemented the right way
|
||||
- pcm_play_dma_stop is untested, not sure if implemented the right way
|
||||
- recording is not implemented
|
||||
*/
|
||||
|
@ -173,17 +172,6 @@ void pcm_play_dma_stop(void)
|
|||
(0 << 0); /* 0 = LRCK on */
|
||||
}
|
||||
|
||||
/* pause playback by disabling the I2S interface */
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause) {
|
||||
I2STXCOM |= (1 << 0); /* LRCK off */
|
||||
}
|
||||
else {
|
||||
I2STXCOM &= ~(1 << 0); /* LRCK on */
|
||||
}
|
||||
}
|
||||
|
||||
static void pcm_dma_set_freq(enum hw_freq_indexes idx)
|
||||
{
|
||||
struct div_entry div = div_table[idx];
|
||||
|
|
|
@ -157,13 +157,6 @@ void pcm_play_dma_stop(void)
|
|||
I2STXCOM = 0xa;
|
||||
}
|
||||
|
||||
/* pause playback by disabling LRCK */
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause) I2STXCOM |= 1;
|
||||
else I2STXCOM &= ~1;
|
||||
}
|
||||
|
||||
/* MCLK = 12MHz (MCLKDIV2=1), [CS42L55 DS, s4.8] */
|
||||
#define MCLK_FREQ 12000000
|
||||
|
||||
|
|
|
@ -85,11 +85,6 @@ void pcm_play_unlock(void)
|
|||
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
(void) pause;
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -120,20 +120,6 @@ void pcm_play_unlock(void)
|
|||
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause)
|
||||
{
|
||||
DSP_(_dma0_stopped)=2;
|
||||
dsp_wake();
|
||||
}
|
||||
else
|
||||
{
|
||||
DSP_(_dma0_stopped)=0;
|
||||
dsp_wake();
|
||||
}
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return DSP_(_sdem_dsp_size)-DSP_(_sdem_level);
|
||||
|
|
|
@ -127,20 +127,6 @@ void pcm_play_unlock(void)
|
|||
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause)
|
||||
{
|
||||
DSP_(_dma0_stopped)=2;
|
||||
dsp_wake();
|
||||
}
|
||||
else
|
||||
{
|
||||
DSP_(_dma0_stopped)=0;
|
||||
dsp_wake();
|
||||
}
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return DSP_(_sdem_dsp_size)-DSP_(_sdem_level);
|
||||
|
|
|
@ -264,25 +264,6 @@ void pcm_play_dma_stop(void)
|
|||
dma_play_lock.state = (1 << 14);
|
||||
} /* pcm_play_dma_stop */
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause)
|
||||
{
|
||||
/* pause playback on current buffer */
|
||||
and_l(~(DMA_EEXT | DMA_INT), &DCR0); /* per request and int OFF */
|
||||
DSR0 = 1; /* stop channel */
|
||||
iis_play_reset_if_playback(true);
|
||||
dma_play_lock.state = (1 << 14);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* restart playback on current buffer */
|
||||
iis_play_reset_if_playback(true);
|
||||
or_l(DMA_INT | DMA_EEXT | DMA_START, &DCR0); /* everything ON */
|
||||
dma_play_lock.state = (0 << 14);
|
||||
}
|
||||
} /* pcm_play_dma_pause */
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return BCR0 & 0xffffff;
|
||||
|
|
|
@ -153,8 +153,11 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
|||
{
|
||||
pcm_data_start = addr;
|
||||
pcm_data_size = size;
|
||||
|
||||
pcm_play_dma_pause(false);
|
||||
|
||||
(*env_ptr)->CallVoidMethod(env_ptr,
|
||||
RockboxPCM_instance,
|
||||
play_pause_method,
|
||||
(int)pause);
|
||||
}
|
||||
|
||||
void pcm_play_dma_stop(void)
|
||||
|
@ -168,14 +171,6 @@ void pcm_play_dma_stop(void)
|
|||
stop_method);
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
(*env_ptr)->CallVoidMethod(env_ptr,
|
||||
RockboxPCM_instance,
|
||||
play_pause_method,
|
||||
(int)pause);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return pcm_data_size;
|
||||
|
|
|
@ -364,22 +364,6 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
|||
pthread_mutex_unlock(&_dma_suspended_mtx);
|
||||
}
|
||||
|
||||
|
||||
/* TODO: Why is this in the API if it gets never called? */
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
TRACE;
|
||||
|
||||
pthread_mutex_lock(&_dma_suspended_mtx);
|
||||
_dma_stopped = pause ? 1 : 0;
|
||||
if(_dma_stopped == 0)
|
||||
{
|
||||
pthread_cond_signal(&_dma_suspended_cond);
|
||||
}
|
||||
pthread_mutex_unlock(&_dma_suspended_mtx);
|
||||
}
|
||||
|
||||
|
||||
void pcm_play_dma_stop(void)
|
||||
{
|
||||
TRACE;
|
||||
|
|
|
@ -154,23 +154,6 @@ void pcm_play_dma_stop(void)
|
|||
gst_element_set_state (GST_ELEMENT(gst_pipeline), GST_STATE_NULL);
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (inside_feed_data)
|
||||
{
|
||||
if (pause)
|
||||
g_signal_emit_by_name (gst_appsrc, "end-of-stream", NULL);
|
||||
else
|
||||
DEBUGF("ERROR: Called dma_pause(0) while inside feed_data\n");
|
||||
} else
|
||||
{
|
||||
if (pause)
|
||||
gst_element_set_state (GST_ELEMENT(gst_pipeline), GST_STATE_NULL);
|
||||
else
|
||||
gst_element_set_state (GST_ELEMENT(gst_pipeline), GST_STATE_PLAYING);
|
||||
}
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return pcm_data_size;
|
||||
|
|
|
@ -489,7 +489,7 @@ static void close_hwdev(void)
|
|||
|
||||
if (handle) {
|
||||
snd_pcm_drain(handle);
|
||||
#ifdef AUDIOHW_MUTE_ON_PAUSE
|
||||
#ifdef AUDIOHW_MUTE_ON_STOP
|
||||
audiohw_mute(true);
|
||||
#endif
|
||||
if (ahandler) {
|
||||
|
@ -634,20 +634,6 @@ void pcm_dma_apply_settings(void)
|
|||
pcm_play_unlock();
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
logf("PCM DMA pause %d", pause);
|
||||
if (!handle) return;
|
||||
|
||||
#ifdef AUDIOHW_MUTE_ON_PAUSE
|
||||
if (pause) audiohw_mute(true);
|
||||
#endif
|
||||
snd_pcm_pause(handle, pause);
|
||||
#ifdef AUDIOHW_MUTE_ON_PAUSE
|
||||
if (!pause) audiohw_mute(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
void pcm_play_dma_stop(void)
|
||||
{
|
||||
logf("PCM DMA stop (%d)", snd_pcm_state(handle));
|
||||
|
@ -656,7 +642,7 @@ void pcm_play_dma_stop(void)
|
|||
if (err < 0)
|
||||
if (err < 0)
|
||||
logf("Drain failed: %s", snd_strerror(err));
|
||||
#ifdef AUDIOHW_MUTE_ON_PAUSE
|
||||
#ifdef AUDIOHW_MUTE_ON_STOP
|
||||
audiohw_mute(true);
|
||||
#endif
|
||||
}
|
||||
|
@ -669,7 +655,7 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
|||
pcm_data = addr;
|
||||
pcm_size = size;
|
||||
|
||||
#if !defined(AUDIOHW_MUTE_ON_PAUSE) && defined(AUDIOHW_MUTE_ON_SRATE_CHANGE)
|
||||
#if !defined(AUDIOHW_MUTE_ON_STOP) && defined(AUDIOHW_MUTE_ON_SRATE_CHANGE)
|
||||
audiohw_mute(false);
|
||||
#endif
|
||||
|
||||
|
@ -681,7 +667,7 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
|||
switch (state)
|
||||
{
|
||||
case SND_PCM_STATE_RUNNING:
|
||||
#if defined(AUDIOHW_MUTE_ON_PAUSE)
|
||||
#if defined(AUDIOHW_MUTE_ON_STOP)
|
||||
audiohw_mute(false);
|
||||
#endif
|
||||
return;
|
||||
|
@ -740,11 +726,6 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
|||
|
||||
break;
|
||||
}
|
||||
case SND_PCM_STATE_PAUSED:
|
||||
{ /* paused, simply resume */
|
||||
pcm_play_dma_pause(0);
|
||||
return;
|
||||
}
|
||||
case SND_PCM_STATE_DRAINING:
|
||||
/* run until drained */
|
||||
continue;
|
||||
|
@ -850,11 +831,6 @@ void pcm_rec_dma_start(void *start, size_t size)
|
|||
panicf("Start error: %s", snd_strerror(err));
|
||||
return;
|
||||
}
|
||||
case SND_PCM_STATE_PAUSED:
|
||||
{ /* paused, simply resume */
|
||||
pcm_play_dma_pause(0);
|
||||
return;
|
||||
}
|
||||
case SND_PCM_STATE_DRAINING:
|
||||
/* run until drained */
|
||||
continue;
|
||||
|
|
|
@ -124,14 +124,6 @@ void pcm_play_dma_stop(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
if (pause)
|
||||
SDL_PauseAudio(1);
|
||||
else
|
||||
SDL_PauseAudio(0);
|
||||
}
|
||||
|
||||
size_t pcm_get_bytes_waiting(void)
|
||||
{
|
||||
return pcm_data_size;
|
||||
|
|
|
@ -184,18 +184,6 @@ void pcm_play_unlock(void)
|
|||
restore_irq(flags);
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
int flags = disable_irq_save();
|
||||
|
||||
if(pause)
|
||||
REG_DMAC_DCCSR(DMA_AIC_TX_CHANNEL) &= ~DMAC_DCCSR_EN;
|
||||
else
|
||||
REG_DMAC_DCCSR(DMA_AIC_TX_CHANNEL) |= DMAC_DCCSR_EN;
|
||||
|
||||
restore_irq(flags);
|
||||
}
|
||||
|
||||
static int get_dma_count(void)
|
||||
{
|
||||
int count = REG_DMAC_DTCR(DMA_AIC_TX_CHANNEL);
|
||||
|
|
|
@ -173,18 +173,6 @@ void pcm_play_unlock(void)
|
|||
restore_irq(flags);
|
||||
}
|
||||
|
||||
void pcm_play_dma_pause(bool pause)
|
||||
{
|
||||
int flags = disable_irq_save();
|
||||
|
||||
if(pause)
|
||||
REG_DMAC_DCCSR(DMA_AIC_TX_CHANNEL) &= ~DMAC_DCCSR_EN;
|
||||
else
|
||||
REG_DMAC_DCCSR(DMA_AIC_TX_CHANNEL) |= DMAC_DCCSR_EN;
|
||||
|
||||
restore_irq(flags);
|
||||
}
|
||||
|
||||
static int get_dma_count(void)
|
||||
{
|
||||
int count = REG_DMAC_DTCR(DMA_AIC_TX_CHANNEL);
|
||||
|
|
Loading…
Reference in a new issue