VirtualBox

Ignore:
Timestamp:
Sep 7, 2021 2:37:42 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

    r91139 r91141  
    287287
    288288        uint64_t        offStream          = 0;
    289         uint64_t        uTimeoutNs         = (pParms->msDuration * 4) * RT_NS_1MS; /* Four times the time playback should roughly take */
    290 
    291         while (cbToPlayTotal)
     289        uint64_t        nsTimeout          = RT_MS_5MIN_64 * RT_NS_1MS;
     290
     291        while (cbPlayedTotal < cbToPlayTotal)
    292292        {
    293293            /* Pace ourselves a little. */
     
    306306            if (cbCanWrite)
    307307            {
    308                 uint32_t const cbToGenerate = RT_MIN(RT_MIN(cbToPlayTotal, sizeof(abBuf)), cbCanWrite);
     308                uint32_t const cbToGenerate = RT_MIN(RT_MIN(cbToPlayTotal - cbPlayedTotal, sizeof(abBuf)), cbCanWrite);
    309309                uint32_t       cbToPlay;
    310310                rc = AudioTestToneGenerate(&TstTone, abBuf, cbToGenerate, &cbToPlay);
     
    321321                        if (RT_SUCCESS(rc))
    322322                        {
     323                            AssertBreakStmt(cbPlayed <= cbToPlay, rc = VERR_TOO_MUCH_DATA);
     324
    323325                            offStream += cbPlayed;
    324326
     
    341343
    342344            /* Fail-safe in case something screwed up while playing back. */
    343             if (RTTimeNanoTS() - nsStarted > uTimeoutNs)
     345            uint64_t const cNsElapsed = RTTimeNanoTS() - nsStarted;
     346            if (cNsElapsed > nsTimeout)
    344347            {
    345                 RTTestFailed(g_hTest, "Playback took too long (%RU32ms exceeded), aborting\n", uTimeoutNs / RT_NS_1MS);
     348                RTTestFailed(g_hTest, "Playback took too long (runng %RU64 vs. timeout %RU64), aborting\n", cNsElapsed, nsTimeout);
    346349                rc = VERR_TIMEOUT;
    347350            }
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