diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-01-21 08:31:40 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-01-21 08:31:40 +0000 |
commit | 485aecd923b4a984c8697fa6c6b773db338b5ab3 (patch) | |
tree | 4f2d534943368b83e8560e48bdce3d69162fb43e | |
parent | 863c03f2ae08e8fa431f3d40a167605fae726a15 (diff) | |
download | rockbox-485aecd923b4a984c8697fa6c6b773db338b5ab3.tar.gz rockbox-485aecd923b4a984c8697fa6c6b773db338b5ab3.zip |
WM8978: sound.c weirdness strikes again. Prescaler values have to be in centibels.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29100 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/audio/wm8978.c | 12 | ||||
-rw-r--r-- | firmware/sound.c | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/firmware/drivers/audio/wm8978.c b/firmware/drivers/audio/wm8978.c index 2a19e22df3..f83a832854 100644 --- a/firmware/drivers/audio/wm8978.c +++ b/firmware/drivers/audio/wm8978.c | |||
@@ -217,6 +217,14 @@ int sound_val2phys(int setting, int value) | |||
217 | break; | 217 | break; |
218 | #endif | 218 | #endif |
219 | 219 | ||
220 | case SOUND_EQ_BAND1_GAIN+0x10000: | ||
221 | case SOUND_EQ_BAND2_GAIN+0x10000: | ||
222 | case SOUND_EQ_BAND3_GAIN+0x10000: | ||
223 | case SOUND_EQ_BAND4_GAIN+0x10000: | ||
224 | case SOUND_EQ_BAND5_GAIN+0x10000: | ||
225 | result = value * 10; | ||
226 | break; | ||
227 | |||
220 | case SOUND_DEPTH_3D: | 228 | case SOUND_DEPTH_3D: |
221 | result = (100 * value + 8) / 15; | 229 | result = (100 * value + 8) / 15; |
222 | break; | 230 | break; |
@@ -330,7 +338,7 @@ static void sync_prescaler(void) | |||
330 | 338 | ||
331 | /* Combine all prescaling into a single DAC attenuation */ | 339 | /* Combine all prescaling into a single DAC attenuation */ |
332 | if (wmc_vol.eq_on) | 340 | if (wmc_vol.eq_on) |
333 | prescaler = wmc_vol.prescaler * 2; | 341 | prescaler = wmc_vol.prescaler; |
334 | 342 | ||
335 | if (wmc_vol.enh_3d_on) | 343 | if (wmc_vol.enh_3d_on) |
336 | prescaler += wmc_vol.enh_3d_prescaler; | 344 | prescaler += wmc_vol.enh_3d_prescaler; |
@@ -460,7 +468,7 @@ void audiohw_set_eq_band_width(unsigned int band, int val) | |||
460 | * gain to EQ bands. */ | 468 | * gain to EQ bands. */ |
461 | void audiohw_set_prescaler(int val) | 469 | void audiohw_set_prescaler(int val) |
462 | { | 470 | { |
463 | wmc_vol.prescaler = val; | 471 | wmc_vol.prescaler = val / 5; /* centibels->semi-decibels */ |
464 | sync_prescaler(); | 472 | sync_prescaler(); |
465 | } | 473 | } |
466 | 474 | ||
diff --git a/firmware/sound.c b/firmware/sound.c index de96360198..4dea2b8a84 100644 --- a/firmware/sound.c +++ b/firmware/sound.c | |||
@@ -477,10 +477,14 @@ int sound_enum_hw_eq_band_setting(unsigned int band, | |||
477 | 477 | ||
478 | static void sound_set_hw_eq_band_gain(unsigned int band, int value) | 478 | static void sound_set_hw_eq_band_gain(unsigned int band, int value) |
479 | { | 479 | { |
480 | int setting; | ||
481 | |||
480 | if(!audio_is_initialized) | 482 | if(!audio_is_initialized) |
481 | return; | 483 | return; |
482 | 484 | ||
483 | current_eq_band_gain[band] = value; | 485 | setting = sound_enum_hw_eq_band_setting(band, AUDIOHW_EQ_GAIN); |
486 | current_eq_band_gain[band] = sound_val2phys(setting + 0x10000, value); | ||
487 | |||
484 | audiohw_set_eq_band_gain(band, value); | 488 | audiohw_set_eq_band_gain(band, value); |
485 | set_prescaled_volume(); | 489 | set_prescaled_volume(); |
486 | } | 490 | } |