summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/audio/rocker_codec.c2
-rw-r--r--firmware/export/fiiolinux_codec.h2
-rw-r--r--firmware/export/pcm-internal.h3
-rw-r--r--firmware/export/pcm.h2
-rw-r--r--firmware/export/rocker_codec.h2
-rw-r--r--firmware/export/xduoolinux_codec.h2
-rw-r--r--firmware/pcm.c53
-rw-r--r--firmware/pcm_sw_volume.c10
-rw-r--r--firmware/target/arm/as3525/pcm-as3525.c20
-rw-r--r--firmware/target/arm/imx233/pcm-imx233.c6
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c14
-rw-r--r--firmware/target/arm/pcm-telechips.c9
-rw-r--r--firmware/target/arm/pnx0101/pcm-pnx0101.c7
-rw-r--r--firmware/target/arm/pp/pcm-pp.c9
-rw-r--r--firmware/target/arm/rk27xx/pcm-rk27xx.c15
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c18
-rw-r--r--firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c18
-rw-r--r--firmware/target/arm/s5l8700/pcm-s5l8700.c12
-rw-r--r--firmware/target/arm/s5l8702/pcm-s5l8702.c7
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c5
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c14
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c14
-rw-r--r--firmware/target/coldfire/pcm-coldfire.c19
-rw-r--r--firmware/target/hosted/android/pcm-android.c15
-rw-r--r--firmware/target/hosted/ibasso/pcm-ibasso.c16
-rw-r--r--firmware/target/hosted/maemo/pcm-gstreamer.c17
-rw-r--r--firmware/target/hosted/pcm-alsa.c32
-rw-r--r--firmware/target/hosted/sdl/pcm-sdl.c8
-rw-r--r--firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c12
-rw-r--r--firmware/target/mips/ingenic_jz47xx/pcm-jz4760.c12
30 files changed, 15 insertions, 360 deletions
diff --git a/firmware/drivers/audio/rocker_codec.c b/firmware/drivers/audio/rocker_codec.c
index 4beda4b572..b4ebdd7816 100644
--- a/firmware/drivers/audio/rocker_codec.c
+++ b/firmware/drivers/audio/rocker_codec.c
@@ -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);
diff --git a/firmware/export/fiiolinux_codec.h b/firmware/export/fiiolinux_codec.h
index 118a0928d7..5fa7ae2b10 100644
--- a/firmware/export/fiiolinux_codec.h
+++ b/firmware/export/fiiolinux_codec.h
@@ -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);
diff --git a/firmware/export/pcm-internal.h b/firmware/export/pcm-internal.h
index 7670f99f04..d5d46c33e1 100644
--- a/firmware/export/pcm-internal.h
+++ b/firmware/export/pcm-internal.h
@@ -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);
diff --git a/firmware/export/pcm.h b/firmware/export/pcm.h
index 23c0bd4a0b..61e11ef801 100644
--- a/firmware/export/pcm.h
+++ b/firmware/export/pcm.h
@@ -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
diff --git a/firmware/export/rocker_codec.h b/firmware/export/rocker_codec.h
index c1ee7b87bc..9eb4954f0b 100644
--- a/firmware/export/rocker_codec.h
+++ b/firmware/export/rocker_codec.h
@@ -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 */
diff --git a/firmware/export/xduoolinux_codec.h b/firmware/export/xduoolinux_codec.h
index 744be58e30..301a341f15 100644
--- a/firmware/export/xduoolinux_codec.h
+++ b/firmware/export/xduoolinux_codec.h
@@ -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 */
diff --git a/firmware/pcm.c b/firmware/pcm.c
index 640bb7830f..7a7043bef8 100644
--- a/firmware/pcm.c
+++ b/firmware/pcm.c
@@ -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");
diff --git a/firmware/pcm_sw_volume.c b/firmware/pcm_sw_volume.c
index 8b6c9220fd..e972896321 100644
--- a/firmware/pcm_sw_volume.c
+++ b/firmware/pcm_sw_volume.c
@@ -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();
diff --git a/firmware/target/arm/as3525/pcm-as3525.c b/firmware/target/arm/as3525/pcm-as3525.c
index ddb4d86bd4..90b6aabd7c 100644
--- a/firmware/target/arm/as3525/pcm-as3525.c
+++ b/firmware/target/arm/as3525/pcm-as3525.c
@@ -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);
diff --git a/firmware/target/arm/imx233/pcm-imx233.c b/firmware/target/arm/imx233/pcm-imx233.c
index de0e1aabf5..7e20a7ce68 100644
--- a/firmware/target/arm/imx233/pcm-imx233.c
+++ b/firmware/target/arm/imx233/pcm-imx233.c
@@ -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();
diff --git a/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c
index 7304bdcff3..72d8e4a021 100644
--- a/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c
+++ b/firmware/target/arm/imx31/gigabeat-s/pcm-gigabeat-s.c
@@ -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)
{
diff --git a/firmware/target/arm/pcm-telechips.c b/firmware/target/arm/pcm-telechips.c
index ddd69088cf..9c64b58594 100644
--- a/firmware/target/arm/pcm-telechips.c
+++ b/firmware/target/arm/pcm-telechips.c
@@ -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;
diff --git a/firmware/target/arm/pnx0101/pcm-pnx0101.c b/firmware/target/arm/pnx0101/pcm-pnx0101.c
index a2394bc355..01ead4723b 100644
--- a/firmware/target/arm/pnx0101/pcm-pnx0101.c
+++ b/firmware/target/arm/pnx0101/pcm-pnx0101.c
@@ -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;
diff --git a/firmware/target/arm/pp/pcm-pp.c b/firmware/target/arm/pp/pcm-pp.c
index 99d46a6096..91d567ee83 100644
--- a/firmware/target/arm/pp/pcm-pp.c
+++ b/firmware/target/arm/pp/pcm-pp.c
@@ -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;
diff --git a/firmware/target/arm/rk27xx/pcm-rk27xx.c b/firmware/target/arm/rk27xx/pcm-rk27xx.c
index 21feaf6cc4..5cfe54f9de 100644
--- a/firmware/target/arm/rk27xx/pcm-rk27xx.c
+++ b/firmware/target/arm/rk27xx/pcm-rk27xx.c
@@ -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)
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
index a1c854a0df..da5dc9cdd5 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/pcm-meg-fx.c
@@ -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;
diff --git a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c b/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
index 943cbb2ade..dbb1a06809 100644
--- a/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
+++ b/firmware/target/arm/s3c2440/mini2440/pcm-mini2440.c
@@ -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;
diff --git a/firmware/target/arm/s5l8700/pcm-s5l8700.c b/firmware/target/arm/s5l8700/pcm-s5l8700.c
index d8387c2aa5..47525611ee 100644
--- a/firmware/target/arm/s5l8700/pcm-s5l8700.c
+++ b/firmware/target/arm/s5l8700/pcm-s5l8700.c
@@ -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];
diff --git a/firmware/target/arm/s5l8702/pcm-s5l8702.c b/firmware/target/arm/s5l8702/pcm-s5l8702.c
index 86a0edd54a..a62a7243a2 100644
--- a/firmware/target/arm/s5l8702/pcm-s5l8702.c
+++ b/firmware/target/arm/s5l8702/pcm-s5l8702.c
@@ -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
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c
index 1fda5fe045..f31185c2ea 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/pcm-creativezvm.c
@@ -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;
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c
index d23c93de39..0d7bcbab37 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/pcm-mr500.c
@@ -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);
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c
index 6e640bdf12..c2932fd762 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/pcm-sansaconnect.c
@@ -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);
diff --git a/firmware/target/coldfire/pcm-coldfire.c b/firmware/target/coldfire/pcm-coldfire.c
index 8162f521f9..10f9ea931f 100644
--- a/firmware/target/coldfire/pcm-coldfire.c
+++ b/firmware/target/coldfire/pcm-coldfire.c
@@ -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;
diff --git a/firmware/target/hosted/android/pcm-android.c b/firmware/target/hosted/android/pcm-android.c
index 23a003ff73..69fd06c6f7 100644
--- a/firmware/target/hosted/android/pcm-android.c
+++ b/firmware/target/hosted/android/pcm-android.c
@@ -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;
diff --git a/firmware/target/hosted/ibasso/pcm-ibasso.c b/firmware/target/hosted/ibasso/pcm-ibasso.c
index 4721501d25..edfdc6d592 100644
--- a/firmware/target/hosted/ibasso/pcm-ibasso.c
+++ b/firmware/target/hosted/ibasso/pcm-ibasso.c
@@ -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;
diff --git a/firmware/target/hosted/maemo/pcm-gstreamer.c b/firmware/target/hosted/maemo/pcm-gstreamer.c
index bd264fe5d3..7c864738ef 100644
--- a/firmware/target/hosted/maemo/pcm-gstreamer.c
+++ b/firmware/target/hosted/maemo/pcm-gstreamer.c
@@ -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;
diff --git a/firmware/target/hosted/pcm-alsa.c b/firmware/target/hosted/pcm-alsa.c
index eb1f764791..939a0cabb5 100644
--- a/firmware/target/hosted/pcm-alsa.c
+++ b/firmware/target/hosted/pcm-alsa.c
@@ -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;
diff --git a/firmware/target/hosted/sdl/pcm-sdl.c b/firmware/target/hosted/sdl/pcm-sdl.c
index 877ca5a482..ba43ece543 100644
--- a/firmware/target/hosted/sdl/pcm-sdl.c
+++ b/firmware/target/hosted/sdl/pcm-sdl.c
@@ -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;
diff --git a/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c b/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
index ef2597ae69..1ce0b5ad5f 100644
--- a/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/pcm-jz4740.c
@@ -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);
diff --git a/firmware/target/mips/ingenic_jz47xx/pcm-jz4760.c b/firmware/target/mips/ingenic_jz47xx/pcm-jz4760.c
index 098c28ecf5..4a4f3020bb 100644
--- a/firmware/target/mips/ingenic_jz47xx/pcm-jz4760.c
+++ b/firmware/target/mips/ingenic_jz47xx/pcm-jz4760.c
@@ -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);