VirtualBox

Changeset 68379 in vbox for trunk


Ignore:
Timestamp:
Aug 11, 2017 9:20:23 AM (7 years ago)
Author:
vboxsync
Message:

Audio/DevHDA: Added a WALCLK stale count for strict builds and refined assertions in hdaWalClkSet().

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

Legend:

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

    r67899 r68379  
    192192    HDAMIXERSINK                       SinkMicIn;
    193193#endif
    194     /** Last updated WALCLK counter. */
     194    /** Last updated wall clock (WALCLK) counter. */
    195195    uint64_t                           u64WalClk;
     196#ifdef DEBUG
     197    /** Wall clock (WALCLK) stale count.
     198     *  This indicates the number of set wall clock
     199     *  values which do not actually move the counter forward (stale). */
     200    uint8_t                            u8WalClkStaleCnt;
     201    uint8_t                            au8Padding2[7];
     202#endif
    196203    /** Response Interrupt Count (RINTCNT). */
    197204    uint8_t                            u8RespIntCnt;
     
    199206    uint8_t                            u8IRQL;
    200207    /** Padding for alignment. */
    201     uint8_t                            au8Padding2[6];
     208    uint8_t                            au8Padding3[6];
    202209#ifdef DEBUG
    203210    HDASTATEDBGINFO                    Dbg;
  • trunk/src/VBox/Devices/Audio/DevHDACommon.cpp

    r67907 r68379  
    212212            u64WalClk = RT_MAX(u64WalClkSet, u64MicInAbsWalClk);
    213213#endif
    214             AssertMsg(u64WalClkSet > u64WalClkCur,
    215                       ("Setting WALCLK to a stale or backward value (%RU64 -> %RU64) isn't a good idea really. "
    216                        "Good luck with stuck audio stuff.\n", u64WalClkCur, u64WalClkSet));
     214
     215#ifdef VBOX_STRICT
     216            Assert(u64WalClkSet >= u64WalClkCur); /* Setting WALCLK to a value going backwards does not make any sense. */
     217            if (u64WalClkSet == u64WalClkCur)     /* Setting a stale value? */
     218            {
     219                if (pThis->u8WalClkStaleCnt++ > 3)
     220                    AssertMsgFailed(("Setting WALCLK to a stale value (%RU64) too often isn't a good idea really. "
     221                                     "Good luck with stuck audio stuff.\n", u64WalClkSet));
     222            }
     223            else
     224                pThis->u8WalClkStaleCnt = 0;
     225#endif
    217226        }
    218227
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