From e42a3194de3b4fb9cd3e7cbd2e0ff17fea804b72 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 8 Dec 2011 19:20:00 +0000 Subject: 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 --- firmware/pcm.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'firmware/pcm.c') 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) int index; #ifdef CONFIG_SAMPR_TYPES -#ifdef HAVE_RECORDING unsigned int type = samplerate & SAMPR_TYPE_MASK; -#endif samplerate &= ~SAMPR_TYPE_MASK; -#ifdef HAVE_RECORDING -#if SAMPR_TYPE_REC != 0 /* For now, supported targets have direct conversion when configured with * CONFIG_SAMPR_TYPES. * Some hypothetical target with independent rates would need slightly * different handling throughout this source. */ - if (type == SAMPR_TYPE_REC) - samplerate = pcm_sampr_type_rec_to_play(samplerate); -#endif -#endif /* HAVE_RECORDING */ + samplerate = pcm_sampr_to_hw_sampr(samplerate, type); #endif /* CONFIG_SAMPR_TYPES */ index = round_value_to_list32(samplerate, hw_freq_sampr, -- cgit v1.2.3