VIA AC'97: Restore the 0x47 back (turns out it was *NOT* a mix-up), but divide by 208925 instead of by 32767, in order to keep the maximum in the -32768 to 32767 range even at +12 dB gain.

This commit is contained in:
OBattler
2025-04-01 06:42:14 +02:00
parent bc0d1884e8
commit 4c0f0ddd24
2 changed files with 6 additions and 1 deletions

View File

@@ -537,7 +537,7 @@ ac97_codec_getattn(void *priv, uint8_t reg, int *l, int *r)
uint8_t r_val = val;
if (reg <= 0x06) { /* 6-bit level */
*l = codec_attn[0x3f - (l_val & 0x3f)];
*r = codec_attn[0x3f - (r_val & 0x3f)];
*r = codec_attn[0x47 - (r_val & 0x3f)];
} else { /* 5-bit gain */
/* Yes, 0x3f is correct, the 0x47 was most likely a decimal-hex mix-up. */
*l = codec_attn[0x3f - (l_val & 0x1f)];