summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-30 20:30:27 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-31 01:18:27 +0000
commitfe2d52cc7d0180acff26349f2904fba854de6fbc (patch)
tree62dbbe9a6e6ebc011e8e02f7428b8f620a83f698 /firmware/target/hosted
parent2d85c7215169780168032617603e9e7b06d7ba25 (diff)
downloadrockbox-fe2d52cc7d.tar.gz
rockbox-fe2d52cc7d.tar.bz2
rockbox-fe2d52cc7d.zip
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
Diffstat (limited to 'firmware/target/hosted')
-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
5 files changed, 9 insertions, 79 deletions
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;