summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-06-26 10:07:17 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-06-26 10:07:17 +0000
commitb15a523870d6aa45b38b92547053beb986b92d9a (patch)
tree8b75fe5f13a3418186cb11c01062ad415490036b /firmware/export
parentac622c6d673c708d48527db8a189401422a5d03c (diff)
downloadrockbox-b15a523870d6aa45b38b92547053beb986b92d9a.tar.gz
rockbox-b15a523870d6aa45b38b92547053beb986b92d9a.zip
e200v1/c200v1: Implement limited samplerate switching. Rates 24kHz and below are being a bear as far as minor crackling at higher amplitude-- leave them out for the time being since no solution is currently evident. 48, 44, 32 (rec rates 24, 22, 16) seem perfectly fine. I'm betting c200 is ok to include because it uses the same setup as e200.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27139 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/as3514.h1
-rw-r--r--firmware/export/config/sansac200.h4
-rw-r--r--firmware/export/config/sansae200.h9
-rw-r--r--firmware/export/pcm.h13
-rw-r--r--firmware/export/pcm_sampr.h20
5 files changed, 40 insertions, 7 deletions
diff --git a/firmware/export/as3514.h b/firmware/export/as3514.h
index ffcf9186e7..de975ce3c6 100644
--- a/firmware/export/as3514.h
+++ b/firmware/export/as3514.h
@@ -28,6 +28,7 @@ extern int tenthdb2master(int db);
28 28
29extern void audiohw_set_master_vol(int vol_l, int vol_r); 29extern void audiohw_set_master_vol(int vol_l, int vol_r);
30extern void audiohw_set_lineout_vol(int vol_l, int vol_r); 30extern void audiohw_set_lineout_vol(int vol_l, int vol_r);
31extern void audiohw_set_sampr_dividers(int fsel);
31 32
32/* Register Descriptions */ 33/* Register Descriptions */
33 34
diff --git a/firmware/export/config/sansac200.h b/firmware/export/config/sansac200.h
index 5905b6a3f9..6c05ba5a1c 100644
--- a/firmware/export/config/sansac200.h
+++ b/firmware/export/config/sansac200.h
@@ -7,12 +7,12 @@
7#define MODEL_NUMBER 20 7#define MODEL_NUMBER 20
8#define MODEL_NAME "Sandisk Sansa c200 series" 8#define MODEL_NAME "Sandisk Sansa c200 series"
9 9
10#define HW_SAMPR_CAPS (SAMPR_CAP_44) 10#define HW_SAMPR_CAPS (SAMPR_CAP_48 | SAMPR_CAP_44 | SAMPR_CAP_32)
11 11
12/* define this if you have recording possibility */ 12/* define this if you have recording possibility */
13#define HAVE_RECORDING 13#define HAVE_RECORDING
14 14
15#define REC_SAMPR_CAPS (SAMPR_CAP_22) 15#define REC_SAMPR_CAPS (SAMPR_CAP_24 | SAMPR_CAP_22 | SAMPR_CAP_16)
16#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ 16#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */
17#define REC_SAMPR_DEFAULT SAMPR_22 17#define REC_SAMPR_DEFAULT SAMPR_22
18 18
diff --git a/firmware/export/config/sansae200.h b/firmware/export/config/sansae200.h
index 8f4f3235dc..501e9eac37 100644
--- a/firmware/export/config/sansae200.h
+++ b/firmware/export/config/sansae200.h
@@ -7,15 +7,20 @@
7#define MODEL_NUMBER 16 7#define MODEL_NUMBER 16
8#define MODEL_NAME "Sandisk Sansa e200 series" 8#define MODEL_NAME "Sandisk Sansa e200 series"
9 9
10#define HW_SAMPR_CAPS (SAMPR_CAP_44) 10#define HW_SAMPR_CAPS (SAMPR_CAP_48 | SAMPR_CAP_44 | SAMPR_CAP_32)
11 11
12/* define this if you have recording possibility */ 12/* define this if you have recording possibility */
13#define HAVE_RECORDING 13#define HAVE_RECORDING
14 14
15#define REC_SAMPR_CAPS (SAMPR_CAP_22) 15#define REC_SAMPR_CAPS (SAMPR_CAP_24 | SAMPR_CAP_22 | SAMPR_CAP_16)
16#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */ 16#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */
17#define REC_SAMPR_DEFAULT SAMPR_22 17#define REC_SAMPR_DEFAULT SAMPR_22
18 18
19/* because the samplerates don't match at each point, we must be able to
20 * tell PCM which set of rates to use. not needed if recording rates are
21 * a simple subset of playback rates and are equal values. */
22#define CONFIG_SAMPR_TYPES
23
19/* Define bitmask of input sources - recordable bitmask can be defined 24/* Define bitmask of input sources - recordable bitmask can be defined
20 explicitly if different */ 25 explicitly if different */
21#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) 26#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
diff --git a/firmware/export/pcm.h b/firmware/export/pcm.h
index 02fa04cb7e..e388e29f0c 100644
--- a/firmware/export/pcm.h
+++ b/firmware/export/pcm.h
@@ -54,9 +54,16 @@ typedef void (*pcm_play_callback_type)(unsigned char **start,
54 size_t *size); 54 size_t *size);
55typedef void (*pcm_rec_callback_type)(int status, void **start, size_t *size); 55typedef void (*pcm_rec_callback_type)(int status, void **start, size_t *size);
56 56
57/* set the pcm frequency - use values in hw_sampr_list 57/* set the pcm frequency - use values in hw_sampr_list
58 * use -1 for the default frequency 58 * when CONFIG_SAMPR_TYPES is #defined, or-in SAMPR_TYPE_* fields with
59 */ 59 * frequency value. SAMPR_TYPE_PLAY is 0 and the default if none is
60 * specified. */
61#ifdef CONFIG_SAMPR_TYPES
62#ifdef SAMPR_TYPE_REC
63unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate);
64#endif
65#endif /* CONFIG_SAMPR_TYPES */
66
60void pcm_set_frequency(unsigned int samplerate); 67void pcm_set_frequency(unsigned int samplerate);
61/* apply settings to hardware immediately */ 68/* apply settings to hardware immediately */
62void pcm_apply_settings(void); 69void pcm_apply_settings(void);
diff --git a/firmware/export/pcm_sampr.h b/firmware/export/pcm_sampr.h
index 2204b9c059..54db8a1dfb 100644
--- a/firmware/export/pcm_sampr.h
+++ b/firmware/export/pcm_sampr.h
@@ -312,4 +312,24 @@ enum rec_freq_indexes
312extern const unsigned long rec_freq_sampr[REC_NUM_FREQ]; 312extern const unsigned long rec_freq_sampr[REC_NUM_FREQ];
313#endif /* HAVE_RECORDING */ 313#endif /* HAVE_RECORDING */
314 314
315#ifdef CONFIG_SAMPR_TYPES
316
317#define SAMPR_TYPE_MASK (0xff << 24)
318#define SAMPR_TYPE_PLAY (0x00 << 24)
319#ifdef HAVE_RECORDING
320#define SAMPR_TYPE_REC (0x01 << 24)
321#endif
322
323unsigned int sampr_type_rec_to_play(unsigned int samplerate);
324
325#else /* ndef CONFIG_SAMPR_TYPES */
326
327/* Types are ignored and == 0 */
328#define SAMPR_TYPE_PLAY 0
329#ifdef HAVE_RECORDING
330#define SAMPR_TYPE_REC 0
331#endif
332
333#endif /* CONFIG_SAMPR_TYPES */
334
315#endif /* PCM_SAMPR_H */ 335#endif /* PCM_SAMPR_H */