summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 cdbc170..da0a4a9 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 ea444a3..2d9c65a 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);