summaryrefslogtreecommitdiff
path: root/firmware/pcm.c
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/pcm.c
parent2c7379757cb20ac9731c98847c6f6309d32607f3 (diff)
downloadrockbox-e42a3194de3b4fb9cd3e7cbd2e0ff17fea804b72.tar.gz
rockbox-e42a3194de3b4fb9cd3e7cbd2e0ff17fea804b72.zip
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/pcm.c')
-rw-r--r--firmware/pcm.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/firmware/pcm.c b/firmware/pcm.c
index f5efb4f84e..d1a897dcab 100644
--- a/firmware/pcm.c
+++ b/firmware/pcm.c
@@ -393,21 +393,14 @@ void pcm_set_frequency(unsigned int samplerate)
393 int index; 393 int index;
394 394
395#ifdef CONFIG_SAMPR_TYPES 395#ifdef CONFIG_SAMPR_TYPES
396#ifdef HAVE_RECORDING
397 unsigned int type = samplerate & SAMPR_TYPE_MASK; 396 unsigned int type = samplerate & SAMPR_TYPE_MASK;
398#endif
399 samplerate &= ~SAMPR_TYPE_MASK; 397 samplerate &= ~SAMPR_TYPE_MASK;
400 398
401#ifdef HAVE_RECORDING
402#if SAMPR_TYPE_REC != 0
403 /* For now, supported targets have direct conversion when configured with 399 /* For now, supported targets have direct conversion when configured with
404 * CONFIG_SAMPR_TYPES. 400 * CONFIG_SAMPR_TYPES.
405 * Some hypothetical target with independent rates would need slightly 401 * Some hypothetical target with independent rates would need slightly
406 * different handling throughout this source. */ 402 * different handling throughout this source. */
407 if (type == SAMPR_TYPE_REC) 403 samplerate = pcm_sampr_to_hw_sampr(samplerate, type);
408 samplerate = pcm_sampr_type_rec_to_play(samplerate);
409#endif
410#endif /* HAVE_RECORDING */
411#endif /* CONFIG_SAMPR_TYPES */ 404#endif /* CONFIG_SAMPR_TYPES */
412 405
413 index = round_value_to_list32(samplerate, hw_freq_sampr, 406 index = round_value_to_list32(samplerate, hw_freq_sampr,