VirtualBox

Changeset 91143 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Sep 7, 2021 5:32:09 PM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Some more diagnostics to find out why some testbox guests refuse to play any test tones. ​bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp

    r91141 r91143  
    288288        uint64_t        offStream          = 0;
    289289        uint64_t        nsTimeout          = RT_MS_5MIN_64 * RT_NS_1MS;
     290        uint64_t        nsLastMsgCantWrite = 0; /* Timestamp (in ns) when the last message of an unwritable stream was shown. */
    290291
    291292        while (cbPlayedTotal < cbToPlayTotal)
    292293        {
     294            uint64_t const nsNow = RTTimeNanoTS();
     295
    293296            /* Pace ourselves a little. */
    294297            if (offStream >= cbPreBuffer)
    295298            {
    296299                if (!nsDonePreBuffering)
    297                     nsDonePreBuffering = RTTimeNanoTS();
     300                    nsDonePreBuffering = nsNow;
    298301                uint64_t const cNsWritten = PDMAudioPropsBytesToNano64(pMix->pProps, offStream - cbPreBuffer);
    299                 uint64_t const cNsElapsed = RTTimeNanoTS() - nsStarted;
     302                uint64_t const cNsElapsed = nsNow - nsStarted;
    300303                if (cNsWritten > cNsElapsed + RT_NS_10MS)
    301304                    RTThreadSleep((cNsWritten - cNsElapsed - RT_NS_10MS / 2) / RT_NS_1MS);
     
    333336                if (RT_FAILURE(rc))
    334337                    break;
     338
     339                nsLastMsgCantWrite = 0;
    335340            }
    336341            else if (AudioTestMixStreamIsOkay(&pStream->Mix))
     342            {
     343                if (!nsLastMsgCantWrite || nsNow - nsLastMsgCantWrite > RT_NS_10SEC) /* Don't spam the output too much. */
     344                {
     345                    RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Waiting for stream to be writable again ...\n");
     346                    nsLastMsgCantWrite = nsNow;
     347                }
    337348                RTThreadSleep(RT_MIN(RT_MAX(1, pStream->Cfg.Device.cMsSchedulingHint), 256));
     349            }
    338350            else
    339351                AssertFailedBreakStmt(rc = VERR_AUDIO_STREAM_NOT_READY);
     
    343355
    344356            /* Fail-safe in case something screwed up while playing back. */
    345             uint64_t const cNsElapsed = RTTimeNanoTS() - nsStarted;
     357            uint64_t const cNsElapsed = nsNow - nsStarted;
    346358            if (cNsElapsed > nsTimeout)
    347359            {
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