VirtualBox

Ignore:
Timestamp:
Jan 7, 2016 6:02:33 PM (9 years ago)
Author:
vboxsync
Message:

Audio/HDA: Yet another fix for SSM handling.

File:
1 edited

Legend:

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

    r59275 r59280  
    5555#define VBOX_WITH_INTEL_HDA
    5656
    57 #if (defined(DEBUG) && defined(DEBUG_andy))
     57#ifdef DEBUG_andy
    5858/* Enables experimental support for separate mic-in handling.
    5959   Do not enable this yet for regular builds, as this needs more testing first! */
    60 # define VBOX_WITH_HDA_MIC_IN
     60//# define VBOX_WITH_HDA_MIC_IN
    6161#endif
    6262
     
    36303630
    36313631    /* Save number of streams. */
     3632#ifdef VBOX_WITH_HDA_MIC_IN
    36323633    SSMR3PutU32(pSSM, 3);
     3634#else
     3635    SSMR3PutU32(pSSM, 2);
     3636#endif
    36333637
    36343638    /* Save stream states. */
    36353639    int rc = hdaSaveStream(pDevIns, pSSM, &pThis->StrmStOut);
    36363640    AssertRCReturn(rc, rc);
     3641#ifdef VBOX_WITH_HDA_MIC_IN
    36373642    rc = hdaSaveStream(pDevIns, pSSM, &pThis->StrmStMicIn);
    36383643    AssertRCReturn(rc, rc);
     3644#endif
    36393645    rc = hdaSaveStream(pDevIns, pSSM, &pThis->StrmStLineIn);
    36403646    AssertRCReturn(rc, rc);
     
    38083814                switch (uStreamID)
    38093815                {
    3810                     case 0: /** @todo Use a define. */
     3816                    case 0: /** @todo Implement dynamic stream IDs. */
    38113817                        pStrm = &pThis->StrmStLineIn;
    38123818                        break;
    3813 
    3814                     case 2: /** @todo Use a define. */
     3819#ifdef VBOX_WITH_HDA_MIC_IN
     3820                    case 2: /** @todo Implement dynamic stream IDs. */
    38153821                        pStrm = &pThis->StrmStMicIn;
    38163822                        break;
    3817 
    3818                     case 4: /** @todo Use a define. */
     3823#endif
     3824                    case 4: /** @todo Implement dynamic stream IDs. */
    38193825                        pStrm = &pThis->StrmStOut;
    38203826                        break;
     
    38293835                if (RT_FAILURE(rc))
    38303836                    break;
    3831 
     3837#ifdef DEBUG
     3838                uint32_t cBDLE = pStrm->State.cBDLE;
     3839                LogFlowFunc(("Stream #%RU32: ID=%RU8, cBDLE=%RU32\n", i, uStreamID, cBDLE));
     3840#endif
    38323841                rc = hdaStreamInit(pThis, pStrm, uStreamID);
    38333842                if (RT_FAILURE(rc))
     
    38363845                    break;
    38373846                }
    3838 
     3847#ifdef DEBUG
     3848                AssertMsg(cBDLE == pStrm->State.cBDLE, ("Loaded BDLE states (%RU32) vs. emulated ones (%RU32) don't match\n",
     3849                                                        cBDLE, pStrm->State.cBDLE));
     3850#endif
    38393851                /* Load BDLE states. */
    38403852                for (uint32_t a = 0; a < pStrm->State.cBDLE; a++)
     
    41684180    pThis->u64BaseTS = PDMDevHlpTMTimeVirtGetNano(pDevIns);
    41694181
     4182# ifndef VBOX_WITH_AUDIO_CALLBACKS
    41704183    /*
    41714184     * Stop the timer, if any.
     
    41774190        AssertRC(rc2);
    41784191    }
     4192# endif
    41794193
    41804194    for (uint8_t u8Strm = 0; u8Strm < 8; u8Strm++) /** @todo Use a define here. */
    41814195    {
    41824196        PHDASTREAM pStrmSt = NULL;
    4183         if (u8Strm == 0)
    4184             pStrmSt = &pThis->StrmStOut;
     4197        if (u8Strm == 0)      /** @todo Implement dynamic stream IDs. */
     4198            pStrmSt = &pThis->StrmStLineIn;
    41854199# ifdef VBOX_WITH_HDA_MIC_IN
    4186         else if (u8Strm == 2)
     4200        else if (u8Strm == 2) /** @todo Implement dynamic stream IDs. */
    41874201            pStrmSt = &pThis->StrmStMicIn;
    41884202# endif
    4189         else if (u8Strm == 4)
    4190             pStrmSt = &pThis->StrmStLineIn;
     4203        else if (u8Strm == 4) /** @todo Implement dynamic stream IDs. */
     4204            pStrmSt = &pThis->StrmStOut;
    41914205
    41924206        if (pStrmSt)
     
    42024216    HDA_REG(pThis, STATESTS) = 0x1;
    42034217
     4218# ifndef VBOX_WITH_AUDIO_CALLBACKS
    42044219    /*
    42054220     * Start timer again, if any.
     
    42104225        AssertRC(rc2);
    42114226    }
     4227# endif
    42124228
    42134229    LogRel(("HDA: Reset\n"));
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