1
0
Fork 0
forked from len0rd/rockbox

Accept FS #9394 by Christian Lees and extend it to all PP targets with a WM8731: More samplerates for playback and recording. Only tested on H10 but should work on the others too.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18662 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Peter D'Hoye 2008-09-28 23:25:07 +00:00
parent aa8a76b659
commit 11ef4ce1f9
10 changed files with 78 additions and 9 deletions

View file

@ -418,6 +418,7 @@ Florin Popescu
Volker Mische
Vitja Makarov
Francisco Vila
Christian Lees
The libmad team
The wavpack team

View file

@ -223,8 +223,30 @@ void audiohw_set_nsorder(int order)
void audiohw_set_sample_rate(int sampling_control)
{
int rate = 0;
switch(sampling_control)
{
case SAMPR_96:
rate = WM8731_USB24_96000HZ;
break;
case SAMPR_88:
rate = WM8731_USB24_88200HZ;
break;
case SAMPR_48:
rate = WM8731_USB24_48000HZ;
break;
case SAMPR_44:
rate = WM8731_USB24_44100HZ;
break;
case SAMPR_32:
rate = WM8731_USB24_32000HZ;
break;
case SAMPR_8:
rate = WM8731_USB24_8000HZ;
break;
}
codec_set_active(false);
wmcodec_write(SAMPCTRL, sampling_control);
wmcodec_write(SAMPCTRL, rate);
codec_set_active(true);
}

View file

@ -18,10 +18,12 @@
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_44)
#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define the bitmask of recording sample rates */
#define REC_SAMPR_CAPS (SAMPR_CAP_44)
#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP

View file

@ -18,10 +18,12 @@
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_44)
#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define the bitmask of recording sample rates */
#define REC_SAMPR_CAPS (SAMPR_CAP_44)
#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP

View file

@ -19,10 +19,12 @@
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_44)
#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define the bitmask of recording sample rates */
#define REC_SAMPR_CAPS (SAMPR_CAP_44)
#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP

View file

@ -17,6 +17,14 @@
/* define this if you have recording possibility */
/*#define HAVE_RECORDING*/
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define the bitmask of recording sample rates
#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) */
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP

View file

@ -16,6 +16,14 @@
/* define this if you have recording possibility */
/*#define HAVE_RECORDING*/
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define the bitmask of recording sample rates
#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) */
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP

View file

@ -16,6 +16,14 @@
/* define this if you have recording possibility */
/*#define HAVE_RECORDING*/
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define the bitmask of recording sample rates
#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) */
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP

View file

@ -15,6 +15,14 @@
/* define this if you have recording possibility */
/*#define HAVE_RECORDING*/ /* TODO: add support for this */
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
/* define the bitmask of recording sample rates
#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) */
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP

View file

@ -94,9 +94,13 @@ static int sr_ctrl = MROBE100_44100HZ;
#endif
void pcm_set_frequency(unsigned int frequency)
{
(void)frequency;
{
#ifdef HAVE_WM8731
pcm_freq = frequency;
#else
(void)frequency;
pcm_freq = HW_SAMPR_DEFAULT;
#endif
#ifdef HAVE_WM8751
sr_ctrl = MROBE100_44100HZ;
#endif
@ -107,6 +111,10 @@ void pcm_apply_settings(void)
#ifdef HAVE_WM8751
audiohw_set_frequency(sr_ctrl);
#endif
#ifdef HAVE_WM8731
audiohw_set_sample_rate(pcm_freq);
#endif
pcm_curr_sampr = pcm_freq;
}