summaryrefslogtreecommitdiff
path: root/firmware/export/pcm_record.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-12-10 14:21:31 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-12-10 14:21:31 +0000
commiteca9f7fd6023a2b7acde89692812d1ecbd8964e6 (patch)
treef434bcc02db8245b27de67fda4977f19a723815f /firmware/export/pcm_record.h
parent0a8d88228baf68c3bc515ca4a1add44aac7e5617 (diff)
downloadrockbox-eca9f7fd6023a2b7acde89692812d1ecbd8964e6.tar.gz
rockbox-eca9f7fd6023a2b7acde89692812d1ecbd8964e6.zip
Place all recording functionality on pcmrec thread to serialize all recording operations. Button mash problems should be ruled out of pcm_record.c. Add additional lightweight checks by default and display any warnings that occurred during recording in first line of recording screen when they occur by blinking back and forth from warning display to normal line (Warning: <hex bitmask>). Warnings are cleared when beginning a new recording so write the number down if you see it and file a report. Add heavier checks when PCMREC_PARANOID is defined in the player config header (encoders and pcm_record must be aware of the define since it changes the chunk header format). These checks are mainly concerned with things that may cause skipping but also add unwanted overhead for normal operation. Best used with logf enabled.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11705 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/pcm_record.h')
-rw-r--r--firmware/export/pcm_record.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/firmware/export/pcm_record.h b/firmware/export/pcm_record.h
index f6dddb3424..865a37fc70 100644
--- a/firmware/export/pcm_record.h
+++ b/firmware/export/pcm_record.h
@@ -25,6 +25,37 @@
25#define DMA_REC_ERROR_SPDIF (-2) 25#define DMA_REC_ERROR_SPDIF (-2)
26#endif 26#endif
27 27
28/** Warnings **/
29/* pcm (dma) buffer has overflowed */
30#define PCMREC_W_PCM_BUFFER_OVF 0x00000001
31/* encoder output buffer has overflowed */
32#define PCMREC_W_ENC_BUFFER_OVF 0x00000002
33#ifdef PCMREC_PARANOID
34/* dma write position alignment incorrect */
35#define PCMREC_W_DMA_WR_POS_ALIGN 0x00000004
36/* pcm read position changed at some point not under control of recording */
37#define PCMREC_W_PCM_RD_POS_TRASHED 0x00000008
38/* dma write position changed at some point not under control of recording */
39#define PCMREC_W_DMA_WR_POS_TRASHED 0x00000010
40#endif /* PCMREC_PARANOID */
41/** Errors **/
42/* failed to load encoder */
43#define PCMREC_E_LOAD_ENCODER 0x80001000
44/* error originating in encoder */
45#define PCMREC_E_ENCODER 0x80002000
46/* filename queue has desynced from stream markers */
47#define PCMREC_E_FNQ_DESYNC 0x80004000
48#ifdef PCMREC_PARANOID
49/* encoder has written past end of allotted space */
50#define PCMREC_E_CHUNK_OVF 0x80008000
51/* chunk header incorrect */
52#define PCMREC_E_BAD_CHUNK 0x80010000
53/* encoder read position changed outside of recording control */
54#define PCMREC_E_ENC_RD_INDEX_TRASHED 0x80020000
55/* encoder write position changed outside of recording control */
56#define PCMREC_E_ENC_WR_INDEX_TRASHED 0x80040000
57#endif /* PCMREC_PARANOID */
58
28/** 59/**
29 * RAW pcm data recording 60 * RAW pcm data recording
30 * These calls are nescessary only when using the raw pcm apis directly. 61 * These calls are nescessary only when using the raw pcm apis directly.
@@ -54,6 +85,7 @@ void pcm_rec_error_clear(void);
54/* pcm_rec_status is deprecated for general use. audio_status merges the 85/* pcm_rec_status is deprecated for general use. audio_status merges the
55 results for consistency with the hardware codec version */ 86 results for consistency with the hardware codec version */
56unsigned long pcm_rec_status(void); 87unsigned long pcm_rec_status(void);
88unsigned long pcm_rec_get_warnings(void);
57void pcm_rec_init(void); 89void pcm_rec_init(void);
58int pcm_rec_current_bitrate(void); 90int pcm_rec_current_bitrate(void);
59int pcm_rec_encoder_afmt(void); /* AFMT_* value, AFMT_UNKNOWN if none */ 91int pcm_rec_encoder_afmt(void); /* AFMT_* value, AFMT_UNKNOWN if none */