summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2008-09-28 23:25:07 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2008-09-28 23:25:07 +0000
commit11ef4ce1f9500ca1bd5651bc0e0dc49bf0dfbd2d (patch)
tree8cc9f49bcf015f1e06840179a29a6f2c1107000d
parentaa8a76b65971e3bad38fa30e39a0ad46f50ff77c (diff)
downloadrockbox-11ef4ce1f9500ca1bd5651bc0e0dc49bf0dfbd2d.tar.gz
rockbox-11ef4ce1f9500ca1bd5651bc0e0dc49bf0dfbd2d.zip
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
-rw-r--r--docs/CREDITS1
-rw-r--r--firmware/drivers/audio/wm8731.c24
-rw-r--r--firmware/export/config-h10.h6
-rw-r--r--firmware/export/config-h10_5gb.h6
-rwxr-xr-xfirmware/export/config-hdd1630.h6
-rw-r--r--firmware/export/config-ipod3g.h8
-rw-r--r--firmware/export/config-ipodmini.h8
-rw-r--r--firmware/export/config-ipodmini2g.h8
-rw-r--r--firmware/export/config-tpj1022.h8
-rw-r--r--firmware/target/arm/pcm-pp.c12
10 files changed, 78 insertions, 9 deletions
diff --git a/docs/CREDITS b/docs/CREDITS
index 8571aa368a..76b86801a9 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -418,6 +418,7 @@ Florin Popescu
418Volker Mische 418Volker Mische
419Vitja Makarov 419Vitja Makarov
420Francisco Vila 420Francisco Vila
421Christian Lees
421 422
422The libmad team 423The libmad team
423The wavpack team 424The wavpack team
diff --git a/firmware/drivers/audio/wm8731.c b/firmware/drivers/audio/wm8731.c
index a1149c3d2e..a895f4fd8b 100644
--- a/firmware/drivers/audio/wm8731.c
+++ b/firmware/drivers/audio/wm8731.c
@@ -223,8 +223,30 @@ void audiohw_set_nsorder(int order)
223 223
224void audiohw_set_sample_rate(int sampling_control) 224void audiohw_set_sample_rate(int sampling_control)
225{ 225{
226 int rate = 0;
227 switch(sampling_control)
228 {
229 case SAMPR_96:
230 rate = WM8731_USB24_96000HZ;
231 break;
232 case SAMPR_88:
233 rate = WM8731_USB24_88200HZ;
234 break;
235 case SAMPR_48:
236 rate = WM8731_USB24_48000HZ;
237 break;
238 case SAMPR_44:
239 rate = WM8731_USB24_44100HZ;
240 break;
241 case SAMPR_32:
242 rate = WM8731_USB24_32000HZ;
243 break;
244 case SAMPR_8:
245 rate = WM8731_USB24_8000HZ;
246 break;
247 }
226 codec_set_active(false); 248 codec_set_active(false);
227 wmcodec_write(SAMPCTRL, sampling_control); 249 wmcodec_write(SAMPCTRL, rate);
228 codec_set_active(true); 250 codec_set_active(true);
229} 251}
230 252
diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h
index 071fb0f650..d38a5df636 100644
--- a/firmware/export/config-h10.h
+++ b/firmware/export/config-h10.h
@@ -18,10 +18,12 @@
18#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) 18#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
19 19
20/* define the bitmask of hardware sample rates */ 20/* define the bitmask of hardware sample rates */
21#define HW_SAMPR_CAPS (SAMPR_CAP_44) 21#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
22 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
22 23
23/* define the bitmask of recording sample rates */ 24/* define the bitmask of recording sample rates */
24#define REC_SAMPR_CAPS (SAMPR_CAP_44) 25#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
26 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
25 27
26/* define this if you have a bitmap LCD display */ 28/* define this if you have a bitmap LCD display */
27#define HAVE_LCD_BITMAP 29#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h
index e7c77e4f4d..56a61c8be5 100644
--- a/firmware/export/config-h10_5gb.h
+++ b/firmware/export/config-h10_5gb.h
@@ -18,10 +18,12 @@
18#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) 18#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
19 19
20/* define the bitmask of hardware sample rates */ 20/* define the bitmask of hardware sample rates */
21#define HW_SAMPR_CAPS (SAMPR_CAP_44) 21#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
22 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
22 23
23/* define the bitmask of recording sample rates */ 24/* define the bitmask of recording sample rates */
24#define REC_SAMPR_CAPS (SAMPR_CAP_44) 25#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
26 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
25 27
26/* define this if you have a bitmap LCD display */ 28/* define this if you have a bitmap LCD display */
27#define HAVE_LCD_BITMAP 29#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-hdd1630.h b/firmware/export/config-hdd1630.h
index 5b89bded21..55ad5a1340 100755
--- a/firmware/export/config-hdd1630.h
+++ b/firmware/export/config-hdd1630.h
@@ -19,10 +19,12 @@
19#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) 19#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
20 20
21/* define the bitmask of hardware sample rates */ 21/* define the bitmask of hardware sample rates */
22#define HW_SAMPR_CAPS (SAMPR_CAP_44) 22#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
23 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
23 24
24/* define the bitmask of recording sample rates */ 25/* define the bitmask of recording sample rates */
25#define REC_SAMPR_CAPS (SAMPR_CAP_44) 26#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
27 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
26 28
27/* define this if you have a bitmap LCD display */ 29/* define this if you have a bitmap LCD display */
28#define HAVE_LCD_BITMAP 30#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h
index 6c78f408bf..d5b593388e 100644
--- a/firmware/export/config-ipod3g.h
+++ b/firmware/export/config-ipod3g.h
@@ -17,6 +17,14 @@
17/* define this if you have recording possibility */ 17/* define this if you have recording possibility */
18/*#define HAVE_RECORDING*/ 18/*#define HAVE_RECORDING*/
19 19
20/* define the bitmask of hardware sample rates */
21#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
22 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
23
24/* define the bitmask of recording sample rates
25#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
26 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) */
27
20/* define this if you have a bitmap LCD display */ 28/* define this if you have a bitmap LCD display */
21#define HAVE_LCD_BITMAP 29#define HAVE_LCD_BITMAP
22 30
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h
index b5c566f4c5..eadd3a6b1d 100644
--- a/firmware/export/config-ipodmini.h
+++ b/firmware/export/config-ipodmini.h
@@ -16,6 +16,14 @@
16/* define this if you have recording possibility */ 16/* define this if you have recording possibility */
17/*#define HAVE_RECORDING*/ 17/*#define HAVE_RECORDING*/
18 18
19/* define the bitmask of hardware sample rates */
20#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
21 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
22
23/* define the bitmask of recording sample rates
24#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
25 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) */
26
19/* define this if you have a bitmap LCD display */ 27/* define this if you have a bitmap LCD display */
20#define HAVE_LCD_BITMAP 28#define HAVE_LCD_BITMAP
21 29
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h
index 6a6ab7b07a..259cb2f874 100644
--- a/firmware/export/config-ipodmini2g.h
+++ b/firmware/export/config-ipodmini2g.h
@@ -16,6 +16,14 @@
16/* define this if you have recording possibility */ 16/* define this if you have recording possibility */
17/*#define HAVE_RECORDING*/ 17/*#define HAVE_RECORDING*/
18 18
19/* define the bitmask of hardware sample rates */
20#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
21 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
22
23/* define the bitmask of recording sample rates
24#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
25 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) */
26
19/* define this if you have a bitmap LCD display */ 27/* define this if you have a bitmap LCD display */
20#define HAVE_LCD_BITMAP 28#define HAVE_LCD_BITMAP
21 29
diff --git a/firmware/export/config-tpj1022.h b/firmware/export/config-tpj1022.h
index ea235edc24..5307074aa1 100644
--- a/firmware/export/config-tpj1022.h
+++ b/firmware/export/config-tpj1022.h
@@ -15,6 +15,14 @@
15/* define this if you have recording possibility */ 15/* define this if you have recording possibility */
16/*#define HAVE_RECORDING*/ /* TODO: add support for this */ 16/*#define HAVE_RECORDING*/ /* TODO: add support for this */
17 17
18/* define the bitmask of hardware sample rates */
19#define HW_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
20 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8)
21
22/* define the bitmask of recording sample rates
23#define REC_SAMPR_CAPS (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_48 | \
24 SAMPR_CAP_44 | SAMPR_CAP_32 | SAMPR_CAP_8) */
25
18/* define this if you have a bitmap LCD display */ 26/* define this if you have a bitmap LCD display */
19#define HAVE_LCD_BITMAP 27#define HAVE_LCD_BITMAP
20 28
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c
index 38fd49165e..e37ee9aaad 100644
--- a/firmware/target/arm/pcm-pp.c
+++ b/firmware/target/arm/pcm-pp.c
@@ -94,9 +94,13 @@ static int sr_ctrl = MROBE100_44100HZ;
94#endif 94#endif
95 95
96void pcm_set_frequency(unsigned int frequency) 96void pcm_set_frequency(unsigned int frequency)
97{ 97{
98 (void)frequency; 98#ifdef HAVE_WM8731
99 pcm_freq = frequency;
100#else
101 (void)frequency;
99 pcm_freq = HW_SAMPR_DEFAULT; 102 pcm_freq = HW_SAMPR_DEFAULT;
103#endif
100#ifdef HAVE_WM8751 104#ifdef HAVE_WM8751
101 sr_ctrl = MROBE100_44100HZ; 105 sr_ctrl = MROBE100_44100HZ;
102#endif 106#endif
@@ -107,6 +111,10 @@ void pcm_apply_settings(void)
107#ifdef HAVE_WM8751 111#ifdef HAVE_WM8751
108 audiohw_set_frequency(sr_ctrl); 112 audiohw_set_frequency(sr_ctrl);
109#endif 113#endif
114
115#ifdef HAVE_WM8731
116 audiohw_set_sample_rate(pcm_freq);
117#endif
110 pcm_curr_sampr = pcm_freq; 118 pcm_curr_sampr = pcm_freq;
111} 119}
112 120