summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/pcm-alsa.c
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/pcm-alsa.c
parent2d85c7215169780168032617603e9e7b06d7ba25 (diff)
downloadrockbox-fe2d52cc7d0180acff26349f2904fba854de6fbc.tar.gz
rockbox-fe2d52cc7d0180acff26349f2904fba854de6fbc.tar.bz2
rockbox-fe2d52cc7d0180acff26349f2904fba854de6fbc.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/pcm-alsa.c')
-rw-r--r--firmware/target/hosted/pcm-alsa.c32
1 files changed, 4 insertions, 28 deletions
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;