VirtualBox

Changeset 33749 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Nov 3, 2010 7:41:12 PM (14 years ago)
Author:
vboxsync
Message:

Audio/HDA: verbID(F00[0xA]) clarification and some clean up.

File:
1 edited

Legend:

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

    r33748 r33749  
    124124#define CODEC_F00_09_CAP_LSB                RT_BIT(0)
    125125
     126/* Supported PCM size, rates (7.3.4.7) */
     127#define CODEC_F00_0A_32_BIT             RT_BIT(20)
     128#define CODEC_F00_0A_24_BIT             RT_BIT(19)
     129#define CODEC_F00_0A_16_BIT             RT_BIT(18)
     130#define CODEC_F00_0A_8_BIT              RT_BIT(17)
     131
     132#define CODEC_F00_0A_48KHZ_MULT_8X      RT_BIT(11)
     133#define CODEC_F00_0A_48KHZ_MULT_4X      RT_BIT(10)
     134#define CODEC_F00_0A_44_1KHZ_MULT_4X    RT_BIT(9)
     135#define CODEC_F00_0A_48KHZ_MULT_2X      RT_BIT(8)
     136#define CODEC_F00_0A_44_1KHZ_MULT_2X    RT_BIT(7)
     137#define CODEC_F00_0A_48KHZ              RT_BIT(6)
     138#define CODEC_F00_0A_44_1KHZ            RT_BIT(5)
     139/* 2/3 * 48kHz */
     140#define CODEC_F00_0A_48KHZ_2_3X         RT_BIT(4)
     141/* 1/2 * 44.1kHz */
     142#define CODEC_F00_0A_44_1KHZ_1_2X       RT_BIT(3)
     143/* 1/3 * 48kHz */
     144#define CODEC_F00_0A_48KHZ_1_3X         RT_BIT(2)
     145/* 1/4 * 44.1kHz */
     146#define CODEC_F00_0A_44_1KHZ_1_4X       RT_BIT(1)
     147/* 1/6 * 48kHz */
     148#define CODEC_F00_0A_48KHZ_1_6X         RT_BIT(0)
     149
    126150/* Pin Capabilities (7.3.4.9)*/
    127151#define CODEC_MAKE_F00_0C(vref_ctrl) (((vref_ctrl) & 0xFF) << 8)
     
    137161#define CODEC_F00_0C_CAP_TRIGGER_REQUIRED       RT_BIT(1)
    138162#define CODEC_F00_0C_CAP_IMPENDANCE_SENSE       RT_BIT(0)
     163
    139164
    140165/* HDA spec 7.3.3.31 defines layout of configuration registers/verbs (0xF1C) */
     
    21942219            AssertMsgFailed(("Unsupported Codec"));
    21952220    }
    2196     uint8_t i;
    2197     Assert(pState->pNodes);
    2198     Assert(pState->pfnCodecNodeReset);
    2199     for (i = 0; i < pState->cTotalNodes; ++i)
    2200     {
    2201         pState->pfnCodecNodeReset(pState, i, &pState->pNodes[i]);
    2202     }
    22032221    /* common root node initializers */
    22042222    pState->pNodes[0].node.au32F00_param[0] = CODEC_MAKE_F00_00(pState->u16VendorId, pState->u16DeviceId);
     
    22302248        && AUDIO_FORMAT_SELECTOR((pState), In, (base), (mult), (div)))
    22312249
    2232     pState->pNodes[1].node.au32F00_param[0xA] = RT_BIT(17); /* 16-bit samples */
     2250    pState->pNodes[1].node.au32F00_param[0xA] = CODEC_F00_0A_16_BIT;
    22332251    SETUP_AUDIO_FORMAT(pState, AFMT_HZ_44_1K, AFMT_MULT_X1, AFMT_DIV_X1, "hda44_1", as, pi_callback, po_callback);
    2234     pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_44_1K, AFMT_MULT_X1, AFMT_DIV_X1) ? RT_BIT(5) : 0;
     2252    pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_44_1K, AFMT_MULT_X1, AFMT_DIV_X1) ? CODEC_F00_0A_44_1KHZ : 0;
    22352253
    22362254#ifdef VBOX_WITH_AUDIO_FLEXIBLE_FORMAT
    22372255    as.freq *= 2; /* 2 * 44.1kHz */
    22382256    SETUP_AUDIO_FORMAT(pState, AFMT_HZ_44_1K, AFMT_MULT_X2, AFMT_DIV_X1, "hda44_1_2x", as, pi_callback, po_callback);
    2239     pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_44_1K, AFMT_MULT_X2, AFMT_DIV_X1) ? RT_BIT(7) : 0;
     2257    pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_44_1K, AFMT_MULT_X2, AFMT_DIV_X1) ? CODEC_F00_0A_44_1KHZ_MULT_2X : 0;
    22402258
    22412259    as.freq *= 2; /* 4 * 44.1kHz */
    22422260    SETUP_AUDIO_FORMAT(pState, AFMT_HZ_44_1K, AFMT_MULT_X4, AFMT_DIV_X1, "hda44_1_4x", as, pi_callback, po_callback);
    2243     pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_44_1K, AFMT_MULT_X4, AFMT_DIV_X1) ? RT_BIT(9) : 0;
     2261    pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_44_1K, AFMT_MULT_X4, AFMT_DIV_X1) ? CODEC_F00_0A_44_1KHZ_MULT_4X : 0;
    22442262
    22452263    as.freq = 48000;
    22462264    SETUP_AUDIO_FORMAT(pState, AFMT_HZ_48K, AFMT_MULT_X1, AFMT_DIV_X1, "hda48", as, pi_callback, po_callback);
    2247     pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_48K, AFMT_MULT_X1, AFMT_DIV_X1) ? RT_BIT(6) : 0;
     2265    pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_48K, AFMT_MULT_X1, AFMT_DIV_X1) ? CODEC_F00_0A_48KHZ : 0;
    22482266
    22492267# if 0
    22502268    as.freq *= 2; /* 2 * 48kHz */
    22512269    SETUP_AUDIO_FORMAT(pState, AFMT_HZ_48K, AFMT_MULT_X2, AFMT_DIV_X1, "hda48_2x", as, pi_callback, po_callback);
    2252     pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_48K, AFMT_MULT_X2, AFMT_DIV_X1) ? RT_BIT(8) : 0;
     2270    pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_48K, AFMT_MULT_X2, AFMT_DIV_X1) ? CODEC_F00_0A_48KHZ_MULT_2X : 0;
    22532271
    22542272    as.freq *= 2; /* 4 * 48kHz */
    22552273    SETUP_AUDIO_FORMAT(pState, AFMT_HZ_48K, AFMT_MULT_X4, AFMT_DIV_X1, "hda48_4x", as, pi_callback, po_callback);
    2256     pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_48K, AFMT_MULT_X4, AFMT_DIV_X1) ? RT_BIT(10) : 0;
     2274    pState->pNodes[1].node.au32F00_param[0xA] |= IS_FORMAT_SUPPORTED_BY_HOST(pState, AFMT_HZ_48K, AFMT_MULT_X4, AFMT_DIV_X1) ? CODEC_F00_0A_48KHZ_MULT_4X : 0;
    22572275# endif
    22582276#endif
    22592277    #undef SETUP_AUDIO_FORMAT
    22602278    #undef IS_FORMAT_SUPPORTED_BY_HOST
     2279
     2280    uint8_t i;
     2281    Assert(pState->pNodes);
     2282    Assert(pState->pfnCodecNodeReset);
     2283    for (i = 0; i < pState->cTotalNodes; ++i)
     2284    {
     2285        pState->pfnCodecNodeReset(pState, i, &pState->pNodes[i]);
     2286    }
    22612287
    22622288    codecToAudVolume(&pState->pNodes[pState->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME);
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