summaryrefslogtreecommitdiff
path: root/firmware/target/arm/sandisk
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-12-08 19:20:00 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-12-08 19:20:00 +0000
commite42a3194de3b4fb9cd3e7cbd2e0ff17fea804b72 (patch)
tree71ddb9c8a927ac4b4a2ba962cd92f935eb1ba445 /firmware/target/arm/sandisk
parent2c7379757cb20ac9731c98847c6f6309d32607f3 (diff)
AS3525v1/v2:
Fix problems with volume of recorded material by converting 14-bit samples to 16-bit. Remove duplicate samples from recorded data and support proper samplerate since ADC runs 1/2 the codec clock. Support monitoring mono on both output channels by feeding data manually to I2SOUT under the right conditions. DMA is no longer used for recording since frames must be processed as described above but it does allow full-duplex audio. Miscellaneous change includes a proper constant (HW_SAMPR_DEFAULT) to reset the hardware samplerate when recording is closed. PP5024 and AS3525 have different default recording rates (22kHz and 44kHz respectively) but both have half-speed ADC. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31180 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/sandisk')
-rw-r--r--firmware/target/arm/sandisk/audio-c200_e200.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/firmware/target/arm/sandisk/audio-c200_e200.c b/firmware/target/arm/sandisk/audio-c200_e200.c
index 2f6bde1b98..4de7aa62c3 100644
--- a/firmware/target/arm/sandisk/audio-c200_e200.c
+++ b/firmware/target/arm/sandisk/audio-c200_e200.c
@@ -186,16 +186,25 @@ void audiohw_set_sampr_dividers(int fsel)
IISDIV = (IISDIV & ~0xc000003f) | regvals[fsel].iisdiv;
}
-#ifdef HAVE_RECORDING
-unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate)
+#ifdef CONFIG_SAMPR_TYPES
+unsigned int pcm_sampr_to_hw_sampr(unsigned int samplerate,
+ unsigned int type)
{
- /* Check if the samplerate is in the list of recordable rates.
- * Fail to default if not */
- int index = round_value_to_list32(samplerate, rec_freq_sampr,
- REC_NUM_FREQ, false);
- if (samplerate != rec_freq_sampr[index])
- return HW_SAMPR_DEFAULT;
-
- return samplerate * 2; /* Recording rates are 1/2 the codec clock */
+#ifdef HAVE_RECORDING
+ if (samplerate != HW_SAMPR_RESET && type == SAMPR_TYPE_REC)
+ {
+ /* Check if the samplerate is in the list of recordable rates.
+ * Fail to default if not */
+ int index = round_value_to_list32(samplerate, rec_freq_sampr,
+ REC_NUM_FREQ, false);
+ if (samplerate != rec_freq_sampr[index])
+ samplerate = REC_SAMPR_DEFAULT;
+
+ samplerate *= 2; /* Recording rates are 1/2 the codec clock */
+ }
+#endif /* HAVE_RECORDING */
+
+ return samplerate;
+ (void)type;
}
-#endif
+#endif /* CONFIG_SAMPR_TYPES */