summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2006-06-30 21:24:20 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2006-06-30 21:24:20 +0000
commite8558e228a2fdef5d8c262e04db677e88704254f (patch)
tree0516bf786b6cdfcc4314694d2bc54ac2623ae0e4
parentf5c319b305da5baf069c98bf76a455d564fb18c8 (diff)
For iriver recording: do not boost while recording unless source is spdif. When saving to disk, boost if needed. Decreased max file size a bit for safety. Increases runtime while recording analog sources.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10159 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/recorder/recording.c12
-rw-r--r--firmware/pcm_record.c11
2 files changed, 22 insertions, 1 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index cdbc170b03..da0a4a9e4a 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -137,7 +137,7 @@ bool f3_rec_screen(void);
#define REC_FILE_ENDING ".mp3"
#endif
-#define MAX_FILE_SIZE 0x7FF00000 /* 2 GB - 1 MB */
+#define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */
const char* const freq_str[6] =
{
@@ -359,7 +359,12 @@ bool recording_screen(void)
audio_stop();
/* Set peak meter to recording mode */
peak_meter_playback(false);
+
+#ifdef HAVE_SPDIF_IN
+if (global_settings.rec_source == SOURCE_SPDIF)
cpu_boost(true);
+#endif
+
#else
/* Yes, we use the D/A for monitoring */
peak_meter_playback(true);
@@ -1007,7 +1012,12 @@ bool recording_screen(void)
#if CONFIG_CODEC == SWCODEC
audio_stop_recording();
audio_close_recording();
+
+#ifdef HAVE_SPDIF_IN
+if (global_settings.rec_source == SOURCE_SPDIF)
cpu_boost(false);
+#endif
+
#else
audio_init_playback();
#endif
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c
index ea444a31e1..2d9c65a7e4 100644
--- a/firmware/pcm_record.c
+++ b/firmware/pcm_record.c
@@ -47,6 +47,7 @@
#include "pcm_playback.h"
#include "pcm_record.h"
+extern int boost_counter; /* used for boost check */
/***************************************************************************/
@@ -552,12 +553,19 @@ static void pcmrec_callback(bool flush)
if (num_free <= WRITE_THRESHOLD || flush)
{
+ bool must_boost = (boost_counter ? false : true);
+
logf("writing: %d (%d)", num_ready, flush);
+ if(must_boost)
+ cpu_boost(true);
+
for (i=0; i<num_ready; i++)
{
if (write(wav_file, GET_CHUNK(read_index), CHUNK_SIZE) != CHUNK_SIZE)
{
+ if(must_boost)
+ cpu_boost(false);
logf("pcmrec: write err");
pcmrec_dma_stop();
return;
@@ -571,6 +579,9 @@ static void pcmrec_callback(bool flush)
yield();
}
+ if(must_boost)
+ cpu_boost(false);
+
/* sync file */
fsync(wav_file);