VirtualBox

Ignore:
Timestamp:
Apr 22, 2015 4:55:56 PM (10 years ago)
Author:
vboxsync
Message:

HDA: Volume handling improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchHdaCodec.cpp

    r55364 r55388  
    12041204    uint8_t rVol = AMPLIFIER_REGISTER(*pAmp, dir, AMPLIFIER_RIGHT, 0) & 0x7f;
    12051205
     1206    /* The STAC9220 volume controls have 0 to -96dB attenuation range in 128 steps.
     1207     * We have 0 to -48dB range in 256 steps. HDA volume setting of 127 must map
     1208     * to 255 internally (0dB), while HDA volume setting of 63 (-48dB) and below
     1209     * should map  to 1 (rather than zero) internally.
     1210     */
     1211    if (lVol > 63)
     1212        lVol = (lVol - 63) * (4 * 255) / 256;
     1213    else
     1214        lVol = 1;   /* Not quite zero. */
     1215
     1216    if (rVol > 63)
     1217        rVol = (rVol - 63) * (4 * 255) / 256;
     1218    else
     1219        rVol = 1;   /* Not quite zero. */
     1220
    12061221#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
    12071222    /** @todo In SetVolume no passing audmixerctl_in as its not used in DrvAudio.cpp. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette