1
0
Fork 0
forked from len0rd/rockbox

as3514: mute headphones at the lowest volume

change lowest step from -74dB to -73dB, as it really is -73.5dB and is
rounded to -73
fix FS#11237

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26010 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-05-14 08:35:53 +00:00
parent 39e4b84e64
commit 8cce39bb9f

View file

@ -64,7 +64,7 @@
#endif #endif
const struct sound_settings_info audiohw_settings[] = { const struct sound_settings_info audiohw_settings[] = {
[SOUND_VOLUME] = {"dB", 0, 1, -74, 6, -25}, [SOUND_VOLUME] = {"dB", 0, 1, -73, 6, -25},
/* HAVE_SW_TONE_CONTROLS */ /* HAVE_SW_TONE_CONTROLS */
[SOUND_BASS] = {"dB", 0, 1, -24, 24, 0}, [SOUND_BASS] = {"dB", 0, 1, -24, 24, 0},
[SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0}, [SOUND_TREBLE] = {"dB", 0, 1, -24, 24, 0},
@ -240,7 +240,6 @@ static void audiohw_mute(bool mute)
{ {
if (mute) { if (mute) {
as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE); as3514_set(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
} else { } else {
as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE); as3514_clear(AS3514_HPH_OUT_L, HPH_OUT_L_HP_MUTE);
} }
@ -263,6 +262,12 @@ void audiohw_set_master_vol(int vol_l, int vol_r)
unsigned int hph_r, hph_l; unsigned int hph_r, hph_l;
unsigned int mix_l, mix_r; unsigned int mix_l, mix_r;
if(vol_l == 0 && vol_r == 0)
{
audiohw_mute(true);
return;
}
/* We combine the mixer channel volume range with the headphone volume /* We combine the mixer channel volume range with the headphone volume
range - keep first stage as loud as possible */ range - keep first stage as loud as possible */
if (vol_r <= 0x16) { if (vol_r <= 0x16) {
@ -289,6 +294,8 @@ void audiohw_set_master_vol(int vol_l, int vol_r)
#endif #endif
as3514_write_masked(AS3514_HPH_OUT_R, hph_r, AS3514_VOL_MASK); as3514_write_masked(AS3514_HPH_OUT_R, hph_r, AS3514_VOL_MASK);
as3514_write_masked(AS3514_HPH_OUT_L, hph_l, AS3514_VOL_MASK); as3514_write_masked(AS3514_HPH_OUT_L, hph_l, AS3514_VOL_MASK);
audiohw_mute(false);
} }
void audiohw_set_lineout_vol(int vol_l, int vol_r) void audiohw_set_lineout_vol(int vol_l, int vol_r)