summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Gotthardt <gotthardt@rockbox.org>2007-07-13 04:18:31 +0000
committerSteve Gotthardt <gotthardt@rockbox.org>2007-07-13 04:18:31 +0000
commit828d719ac1180d9d0862d3ada7f9a7afc65c1035 (patch)
tree5dcc07006d86dd4b3249c8c41ac50a54ec985576
parent4f9bffe18e0c8bc546f03612052803134497114b (diff)
downloadrockbox-828d719ac1180d9d0862d3ada7f9a7afc65c1035.tar.gz
rockbox-828d719ac1180d9d0862d3ada7f9a7afc65c1035.zip
Changes bass setting to use adaptive bass instead of linear bass. The datasheet recommends it and it should stop clipping on bass.
Steve Gotthardt. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13867 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/audio/wm8751.c25
-rw-r--r--firmware/export/config-gigabeat.h3
2 files changed, 28 insertions, 0 deletions
diff --git a/firmware/drivers/audio/wm8751.c b/firmware/drivers/audio/wm8751.c
index 426036aab0..4a17496111 100644
--- a/firmware/drivers/audio/wm8751.c
+++ b/firmware/drivers/audio/wm8751.c
@@ -31,7 +31,11 @@
31 31
32const struct sound_settings_info audiohw_settings[] = { 32const struct sound_settings_info audiohw_settings[] = {
33 [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25}, 33 [SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25},
34#ifdef USE_ADAPTIVE_BASS
35 [SOUND_BASS] = {"", 0, 1, 0, 15, 0},
36#else
34 [SOUND_BASS] = {"dB", 1, 15, -60, 90, 0}, 37 [SOUND_BASS] = {"dB", 1, 15, -60, 90, 0},
38#endif
35 [SOUND_TREBLE] = {"dB", 1, 15, -60, 90, 0}, 39 [SOUND_TREBLE] = {"dB", 1, 15, -60, 90, 0},
36 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0}, 40 [SOUND_BALANCE] = {"%", 0, 1,-100, 100, 0},
37 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0}, 41 [SOUND_CHANNELS] = {"", 0, 1, 0, 5, 0},
@@ -47,7 +51,11 @@ const struct sound_settings_info audiohw_settings[] = {
47#define LOUT2_BITS (LOUT2_LO2ZC) 51#define LOUT2_BITS (LOUT2_LO2ZC)
48#define ROUT2_BITS (ROUT2_RO2ZC | ROUT2_RO2VU) 52#define ROUT2_BITS (ROUT2_RO2ZC | ROUT2_RO2VU)
49/* We use linear bass control with 200 Hz cutoff */ 53/* We use linear bass control with 200 Hz cutoff */
54#ifdef USE_ADAPTIVE_BASE
55#define BASSCTRL_BITS (BASSCTRL_BC | BASSCTRL_BB)
56#else
50#define BASSCTRL_BITS (BASSCTRL_BC) 57#define BASSCTRL_BITS (BASSCTRL_BC)
58#endif
51/* We use linear treble control with 4 kHz cutoff */ 59/* We use linear treble control with 4 kHz cutoff */
52#define TREBCTRL_BITS (TREBCTRL_TC) 60#define TREBCTRL_BITS (TREBCTRL_TC)
53 61
@@ -85,6 +93,18 @@ static int tone_tenthdb2hw(int value)
85 return value; 93 return value;
86} 94}
87 95
96
97#ifdef USE_ADAPTIVE_BASS
98static int adaptivebass2hw(int value)
99{
100 /* 0 to 15 step 1 - step -1 0 = off is a 15 in the register */
101 value = 15 - value;
102
103 return value;
104}
105#endif
106
107
88void audiohw_reset(void); 108void audiohw_reset(void);
89 109
90/* Reset and power up the WM8751 */ 110/* Reset and power up the WM8751 */
@@ -162,7 +182,12 @@ int audiohw_set_mixer_vol(int channel1, int channel2)
162void audiohw_set_bass(int value) 182void audiohw_set_bass(int value)
163{ 183{
164 wmcodec_write(BASSCTRL, BASSCTRL_BITS | 184 wmcodec_write(BASSCTRL, BASSCTRL_BITS |
185
186#ifdef USE_ADAPTIVE_BASS
187 BASSCTRL_BASS(adaptivebass2hw(value)));
188#else
165 BASSCTRL_BASS(tone_tenthdb2hw(value))); 189 BASSCTRL_BASS(tone_tenthdb2hw(value)));
190#endif
166} 191}
167 192
168void audiohw_set_treble(int value) 193void audiohw_set_treble(int value)
diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h
index 5f45bdbff0..6264ab5087 100644
--- a/firmware/export/config-gigabeat.h
+++ b/firmware/export/config-gigabeat.h
@@ -70,6 +70,9 @@
70/* Define this if you have the WM8975 audio codec */ 70/* Define this if you have the WM8975 audio codec */
71#define HAVE_WM8751 71#define HAVE_WM8751
72 72
73/* Define this if you want to use the adaptive bass capibility of the 8751 */
74#define USE_ADAPTIVE_BASS
75
73#define BATTERY_CAPACITY_DEFAULT 2000 /* default battery capacity */ 76#define BATTERY_CAPACITY_DEFAULT 2000 /* default battery capacity */
74 77
75#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \ 78#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | \