1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Peter D'Hoye 2006-06-30 21:24:20 +00:00
parent f5c319b305
commit e8558e228a
2 changed files with 22 additions and 1 deletions

View file

@ -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

View file

@ -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);