VirtualBox

Changeset 88193 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 18, 2021 2:21:20 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143351
Message:

DevHDA: Reset while running fix. A few todos. bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

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

    r88186 r88193  
    13741374    if (fInReset)
    13751375    {
    1376         Assert(!fReset);
    1377         Assert(!fInRun && !fRun);
     1376        ASSERT_GUEST(!fReset);
     1377        ASSERT_GUEST(!fInRun && !fRun);
    13781378
    13791379        /* Exit reset state. */
     
    13881388    {
    13891389        /* ICH6 datasheet 18.2.33 says that RUN bit should be cleared before initiation of reset. */
    1390         Assert(!fInRun && !fRun);
     1390        ASSERT_GUEST(!fInRun && !fRun);
    13911391
    13921392        LogFunc(("[SD%RU8] Reset enter\n", uSD));
     
    13971397        hdaR3StreamAsyncIOLock(pStreamR3);
    13981398# endif
     1399        /* Deal with reset while running. */
     1400        if (pStreamShared->State.fRunning)
     1401        {
     1402            hdaR3StreamEnable(pStreamShared, pStreamR3, false /* fEnable */);
     1403            ASMAtomicWriteBool(&pStreamShared->State.fRunning, false);
     1404            if (pThisCC->cStreamsActive > 0)
     1405                pThisCC->cStreamsActive++;
     1406        }
     1407
    13991408        /* Make sure to remove the run bit before doing the actual stream reset. */
    14001409        HDA_STREAM_REG(pThis, CTL, uSD) &= ~HDA_SDCTL_RUN;
    1401 
    14021410        hdaR3StreamReset(pThis, pThisCC, pStreamShared, pStreamR3, uSD);
    14031411
     
    14141422        if (fInRun != fRun)
    14151423        {
    1416             Assert(!fReset && !fInReset);
     1424            Assert(!fReset && !fInReset); /* (code change paranoia, currently impossible ) */
    14171425            LogFunc(("[SD%RU8] State changed (fRun=%RTbool)\n", uSD, fRun));
    14181426
     
    14561464                    /* Any vital stream change occurred so that we need to (re-)add the stream to our setup?
    14571465                     * Otherwise just skip this, as this costs a lot of performance. */
     1466                    /** @todo r=bird: hdaR3StreamSetUp does not return VINF_NO_CHANGE since r142810. */
    14581467                    && rc2 != VINF_NO_CHANGE)
    14591468                {
     
    29422951    for (size_t idxStream = 0; idxStream < RT_ELEMENTS(pThis->aStreams); idxStream++)
    29432952    {
     2953/** @todo r=bird: insufficient locking here, I think... May race stream timer
     2954 *        and AIO threads. We should probably do this a lot earlier too. */
    29442955        int rc2 = hdaR3StreamEnable(&pThis->aStreams[idxStream], &pThisCC->aStreams[idxStream], false /* fEnable */);
    29452956        if (RT_SUCCESS(rc2))
  • trunk/src/VBox/Devices/Audio/DevHDA.h

    r88170 r88193  
    231231    /** Mapping table between stream tags and stream states. */
    232232    HDATAG                  aTags[HDA_MAX_TAGS];
    233     /** Number of active (running) SDn streams. */
     233    /** Number of active (running) SDn streams.
     234     * @todo pointless, not used for anything at all.  */
    234235    uint8_t                 cStreamsActive;
    235236    uint8_t                 abPadding0[7];
Note: See TracChangeset for help on using the changeset viewer.

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