diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2007-10-06 22:27:27 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2007-10-06 22:27:27 +0000 |
commit | 6077e5b7c85c0d6f5963e4aadb215faf2c4d10d2 (patch) | |
tree | a6bc91ee4168e83617e942eeaea46e5523e82420 /apps | |
parent | f6de0d4083a4fcb6da57f271e1f8ccaf715e571d (diff) |
Unify PCM interface just above the hardware driver level for all targets including the sims. Perform lockout of audio callback when changing states. Weird new playback or recording trouble? Check before and after this revision first though things seem quite sound.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15006 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 1 | ||||
-rw-r--r-- | apps/main.c | 3 | ||||
-rw-r--r-- | apps/pcmbuf.c | 17 | ||||
-rw-r--r-- | apps/plugins/SOURCES | 1 | ||||
-rw-r--r-- | apps/recorder/peakmeter.c | 2 | ||||
-rw-r--r-- | apps/recorder/recording.c | 1 | ||||
-rw-r--r-- | apps/settings.c | 1 |
7 files changed, 14 insertions, 12 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 15c2c93d62..b3b6fe3eca 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -75,7 +75,6 @@ #include "logfdisp.h" #if CONFIG_CODEC == SWCODEC #include "pcmbuf.h" -#include "pcm_playback.h" #if defined(HAVE_SPDIF_OUT) || defined(HAVE_SPDIF_IN) #include "spdif.h" #endif diff --git a/apps/main.c b/apps/main.c index bc8a12dd4e..e4fd6bc614 100644 --- a/apps/main.c +++ b/apps/main.c @@ -353,6 +353,9 @@ static void init(void) power_init(); set_irq_level(0); +#ifdef CPU_ARM + set_fiq_status(FIQ_ENABLED); +#endif lcd_init(); #ifdef HAVE_REMOTE_LCD lcd_remote_init(); diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index 7e6954c280..a6b82baf25 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c @@ -24,7 +24,7 @@ #include "panic.h" #include <kernel.h> #include "pcmbuf.h" -#include "pcm_playback.h" +#include "pcm.h" #include "logf.h" #ifndef SIMULATOR #include "cpu.h" @@ -154,7 +154,6 @@ static void pcmbuf_callback(unsigned char** start, size_t* size) crossfade_chunk = pcmbuf_read; } -process_new_buffer: { /* Send the new buffer to the pcm */ struct pcmbufdesc *pcmbuf_new = pcmbuf_read; @@ -171,10 +170,6 @@ process_new_buffer: } else { - /* There may be more data waiting to flush, try to use it */ - if (pcmbuf_flush_fillpos()) - goto process_new_buffer; - /* No more buffers */ last_chunksize = 0; *realsize = 0; @@ -487,7 +482,12 @@ void pcmbuf_pause(bool pause) if (pause) pcm_mute(true); #endif - pcm_play_pause(!pause); + + if (pcm_is_playing()) + pcm_play_pause(!pause); + else if (!pause) + pcmbuf_play_start(); + #ifdef PCMBUF_MUTING if (!pause) pcm_mute(false); @@ -823,7 +823,8 @@ static bool prepare_insert(size_t length) #endif { logf("pcm starting"); - pcmbuf_play_start(); + if (!(audio_status() & AUDIO_STATUS_PAUSE)) + pcmbuf_play_start(); } } else if (pcmbuf_unplayed_bytes <= pcmbuf_watermark) diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index b725e7f0e5..1bed2b1e3a 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -20,6 +20,7 @@ stopwatch.c vbrfix.c viewer.c + #if CONFIG_CODEC == SWCODEC metronome.c #endif diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 00591de657..c4bf07146d 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c @@ -43,7 +43,7 @@ #include "action.h" #if CONFIG_CODEC == SWCODEC -#include "pcm_playback.h" +#include "pcm.h" #ifdef HAVE_RECORDING #include "pcm_record.h" diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index fed2e6767e..ac06c93cf9 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -31,7 +31,6 @@ #include "audio.h" #if CONFIG_CODEC == SWCODEC #include "thread.h" -#include "pcm_playback.h" #include "playback.h" #include "enc_config.h" #if defined(HAVE_SPDIF_IN) || defined(HAVE_SPDIF_OUT) diff --git a/apps/settings.c b/apps/settings.c index cacf3e5854..26036c8948 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -79,7 +79,6 @@ struct system_status global_status; #if CONFIG_CODEC == SWCODEC #include "pcmbuf.h" -#include "pcm_playback.h" #include "dsp.h" #ifdef HAVE_RECORDING #include "enc_config.h" |