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:
parent
aa8a76b659
commit
11ef4ce1f9
10 changed files with 78 additions and 9 deletions
|
|
@ -418,6 +418,7 @@ Florin Popescu
|
||||||
Volker Mische
|
Volker Mische
|
||||||
Vitja Makarov
|
Vitja Makarov
|
||||||
Francisco Vila
|
Francisco Vila
|
||||||
|
Christian Lees
|
||||||
|
|
||||||
The libmad team
|
The libmad team
|
||||||
The wavpack team
|
The wavpack team
|
||||||
|
|
|
||||||
|
|
@ -223,8 +223,30 @@ void audiohw_set_nsorder(int order)
|
||||||
|
|
||||||
void audiohw_set_sample_rate(int sampling_control)
|
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);
|
codec_set_active(false);
|
||||||
wmcodec_write(SAMPCTRL, sampling_control);
|
wmcodec_write(SAMPCTRL, rate);
|
||||||
codec_set_active(true);
|
codec_set_active(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,12 @@
|
||||||
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
|
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
|
||||||
|
|
||||||
/* define the bitmask of hardware sample rates */
|
/* 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 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 this if you have a bitmap LCD display */
|
||||||
#define HAVE_LCD_BITMAP
|
#define HAVE_LCD_BITMAP
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,12 @@
|
||||||
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
|
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
|
||||||
|
|
||||||
/* define the bitmask of hardware sample rates */
|
/* 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 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 this if you have a bitmap LCD display */
|
||||||
#define HAVE_LCD_BITMAP
|
#define HAVE_LCD_BITMAP
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,12 @@
|
||||||
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
|
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
|
||||||
|
|
||||||
/* define the bitmask of hardware sample rates */
|
/* 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 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 this if you have a bitmap LCD display */
|
||||||
#define HAVE_LCD_BITMAP
|
#define HAVE_LCD_BITMAP
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,14 @@
|
||||||
/* define this if you have recording possibility */
|
/* define this if you have recording possibility */
|
||||||
/*#define HAVE_RECORDING*/
|
/*#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 this if you have a bitmap LCD display */
|
||||||
#define HAVE_LCD_BITMAP
|
#define HAVE_LCD_BITMAP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,14 @@
|
||||||
/* define this if you have recording possibility */
|
/* define this if you have recording possibility */
|
||||||
/*#define HAVE_RECORDING*/
|
/*#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 this if you have a bitmap LCD display */
|
||||||
#define HAVE_LCD_BITMAP
|
#define HAVE_LCD_BITMAP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,14 @@
|
||||||
/* define this if you have recording possibility */
|
/* define this if you have recording possibility */
|
||||||
/*#define HAVE_RECORDING*/
|
/*#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 this if you have a bitmap LCD display */
|
||||||
#define HAVE_LCD_BITMAP
|
#define HAVE_LCD_BITMAP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,14 @@
|
||||||
/* define this if you have recording possibility */
|
/* define this if you have recording possibility */
|
||||||
/*#define HAVE_RECORDING*/ /* TODO: add support for this */
|
/*#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 this if you have a bitmap LCD display */
|
||||||
#define HAVE_LCD_BITMAP
|
#define HAVE_LCD_BITMAP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,9 +94,13 @@ static int sr_ctrl = MROBE100_44100HZ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void pcm_set_frequency(unsigned int frequency)
|
void pcm_set_frequency(unsigned int frequency)
|
||||||
{
|
{
|
||||||
(void)frequency;
|
#ifdef HAVE_WM8731
|
||||||
|
pcm_freq = frequency;
|
||||||
|
#else
|
||||||
|
(void)frequency;
|
||||||
pcm_freq = HW_SAMPR_DEFAULT;
|
pcm_freq = HW_SAMPR_DEFAULT;
|
||||||
|
#endif
|
||||||
#ifdef HAVE_WM8751
|
#ifdef HAVE_WM8751
|
||||||
sr_ctrl = MROBE100_44100HZ;
|
sr_ctrl = MROBE100_44100HZ;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -107,6 +111,10 @@ void pcm_apply_settings(void)
|
||||||
#ifdef HAVE_WM8751
|
#ifdef HAVE_WM8751
|
||||||
audiohw_set_frequency(sr_ctrl);
|
audiohw_set_frequency(sr_ctrl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_WM8731
|
||||||
|
audiohw_set_sample_rate(pcm_freq);
|
||||||
|
#endif
|
||||||
pcm_curr_sampr = pcm_freq;
|
pcm_curr_sampr = pcm_freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue