diff options
author | Steve Gotthardt <gotthardt@rockbox.org> | 2007-07-13 04:18:31 +0000 |
---|---|---|
committer | Steve Gotthardt <gotthardt@rockbox.org> | 2007-07-13 04:18:31 +0000 |
commit | 828d719ac1180d9d0862d3ada7f9a7afc65c1035 (patch) | |
tree | 5dcc07006d86dd4b3249c8c41ac50a54ec985576 /firmware/drivers/audio | |
parent | 4f9bffe18e0c8bc546f03612052803134497114b (diff) | |
download | rockbox-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
Diffstat (limited to 'firmware/drivers/audio')
-rw-r--r-- | firmware/drivers/audio/wm8751.c | 25 |
1 files changed, 25 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 | ||
32 | const struct sound_settings_info audiohw_settings[] = { | 32 | const 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 | ||
98 | static 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 | |||
88 | void audiohw_reset(void); | 108 | void 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) | |||
162 | void audiohw_set_bass(int value) | 182 | void 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 | ||
168 | void audiohw_set_treble(int value) | 193 | void audiohw_set_treble(int value) |